This would be typical to see in use of strtok function.
Example code from here
#include <string.h>
#include <stdio.h>
int main()
{
char str[80] = "This is - www.tutorialspoint.com - website";
const char s[2] = "-";
char *token;
/* get the first token */
token = strtok(str, s);
/* walk through other tokens */
while( token != NULL ) {
printf( " %s\n", token );
token = strtok(NULL, s);
}
}
Disassembly:
.LC0:
.string " %s\n"
main:
push rbp
mov rbp, rsp
sub rsp, 112
movabs rax, 2338328219631577172
movabs rdx, 8463440690376286253
mov QWORD PTR [rbp-96], rax
mov QWORD PTR [rbp-88], rdx
movabs rax, 8102939320206389108
movabs rdx, 7885630523722066287
mov QWORD PTR [rbp-80], rax
mov QWORD PTR [rbp-72], rdx
movabs rax, 7598525184233975072
mov edx, 25972
mov QWORD PTR [rbp-64], rax
mov QWORD PTR [rbp-56], rdx
mov QWORD PTR [rbp-48], 0
mov QWORD PTR [rbp-40], 0
mov QWORD PTR [rbp-32], 0
mov QWORD PTR [rbp-24], 0
mov WORD PTR [rbp-98], 45
lea rdx, [rbp-98]
lea rax, [rbp-96]
mov rsi, rdx
mov rdi, rax
call strtok
mov QWORD PTR [rbp-8], rax
.L3:
cmp QWORD PTR [rbp-8], 0
je .L2
mov rax, QWORD PTR [rbp-8]
mov rsi, rax
mov edi, OFFSET FLAT:.LC0
mov eax, 0
call printf
lea rax, [rbp-98]
mov rsi, rax
mov edi, 0
call strtok
mov QWORD PTR [rbp-8], rax
jmp .L3
.L2:
mov eax, 0
leave
ret
The token = strtok(NULL, s); line is compiled with
mov edi,0
call strtok
You can quickly check/compare different compilers and their assembly output with the website https://godbolt.org/