#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
char *strtok(char *, char const *);
bool get_list_from_state_file(char *text, char *buf, int *size, int *mode,
                              int *ctime) {
  const char delim[] = "\t\0";
  char *ptr = strtok(text, delim);
  if (ptr) {
    snprintf(buf, 4096, "%s", ptr);
    ptr = strtok(NULL, delim);
    if (ptr) {
      *size = atoi(ptr);
      ptr = strtok(NULL, delim);
      if (ptr) {
        *mode = atoi(ptr);
        ptr = strtok(NULL, delim);
        if (ptr) {
          *ctime = atoi(ptr);
          return true;
        }
      }
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<get_list_from_state_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    0xead(%rip),%ax
mov    %ax,-0x33(%rbp)
mov    0xea5(%rip),%al
mov    %al,-0x31(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x33(%rbp),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1237 <get_list_from_state_file+0x107>
mov    -0x18(%rbp),%rdi
mov    -0x40(%rbp),%rcx
mov    $0x1000,%esi
lea    0xe73(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x33(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <strtok@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1232 <get_list_from_state_file+0x102>
mov    -0x40(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
lea    -0x33(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <strtok@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     122d <get_list_from_state_file+0xfd>
mov    -0x40(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
lea    -0x33(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <strtok@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1228 <get_list_from_state_file+0xf8>
mov    -0x40(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    123e <get_list_from_state_file+0x10e>
jmp    122d <get_list_from_state_file+0xfd>
jmp    1232 <get_list_from_state_file+0x102>
jmp    1237 <get_list_from_state_file+0x107>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_list_from_state_file>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
movb   $0x0,0x6(%rsp)
movw   $0x9,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1040 <strtok@plt>
test   %rax,%rax
je     11d8 <get_list_from_state_file+0xa8>
lea    0xe9d(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1000,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
xor    %ebx,%ebx
lea    0x4(%rsp),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     11da <get_list_from_state_file+0xaa>
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,(%r12)
xor    %ebx,%ebx
lea    0x4(%rsp),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     11da <get_list_from_state_file+0xaa>
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,(%r15)
xor    %ebx,%ebx
lea    0x4(%rsp),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     11da <get_list_from_state_file+0xaa>
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,(%r14)
mov    $0x1,%ebx
jmp    11da <get_list_from_state_file+0xaa>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.get_list_from_state_file.delim = [3 x i8] c"\09\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @get_list_from_state_file(i8* %0, i8* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca [3 x i8]
%13 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
%14 = bitcast [3 x i8]* %12 to i8*
%15 = load i8*, i8** %7
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%17 = call i8* @strtok(i8* %15, i8* %16)
store i8* %17, i8** %13
%18 = load i8*, i8** %13
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %51
20: ; preds = %5
%21 = load i8*, i8** %8
%22 = load i8*, i8** %13
%23 = call i32 @snprintf(i8* %21, i32 4096, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%25 = call i8* @strtok(i8* null, i8* %24)
store i8* %25, i8** %13
%26 = load i8*, i8** %13
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %50
28: ; preds = %20
%29 = load i8*, i8** %13
%30 = call i32 @atoi(i8* %29)
%31 = load i32*, i32** %9
store i32 %30, i32* %31
%32 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%33 = call i8* @strtok(i8* null, i8* %32)
store i8* %33, i8** %13
%34 = load i8*, i8** %13
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %49
36: ; preds = %28
%37 = load i8*, i8** %13
%38 = call i32 @atoi(i8* %37)
%39 = load i32*, i32** %10
store i32 %38, i32* %39
%40 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%41 = call i8* @strtok(i8* null, i8* %40)
store i8* %41, i8** %13
%42 = load i8*, i8** %13
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %48
44: ; preds = %36
%45 = load i8*, i8** %13
%46 = call i32 @atoi(i8* %45)
%47 = load i32*, i32** %11
store i32 %46, i32* %47
store i32 1, i32* %6
br label %52
48: ; preds = %36
br label %49
49: ; preds = %48, %28
br label %50
50: ; preds = %49, %20
br label %51
51: ; preds = %50, %5
store i32 0, i32* %6
br label %52
52: ; preds = %51, %44
%53 = load i32, i32* %6
ret i32 %53
}

LLVM IR (-O2):
@__const.get_list_from_state_file.delim = [3 x i8] c"\09\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @get_list_from_state_file(i8* %0, i8* %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = alloca [3 x i8]
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%8 = call i8* @strtok(i8* %0, i8* %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %24, label %10
10: ; preds = %5
%11 = tail call i32 @snprintf(i8* %1, i32 4096, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%12 = call i8* @strtok(i8* null, i8* %7)
%13 = icmp eq i8* %12, null
br i1 %13, label %24, label %14
14: ; preds = %10
%15 = tail call i32 @atoi(i8* %12)
store i32 %15, i32* %2
%16 = call i8* @strtok(i8* null, i8* %7)
%17 = icmp eq i8* %16, null
br i1 %17, label %24, label %18
18: ; preds = %14
%19 = tail call i32 @atoi(i8* %16)
store i32 %19, i32* %3
%20 = call i8* @strtok(i8* null, i8* %7)
%21 = icmp eq i8* %20, null
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = tail call i32 @atoi(i8* %20)
store i32 %23, i32* %4
br label %24
24: ; preds = %5, %14, %18, %10, %22
%25 = phi i32 [ 1, %22 ], [ 0, %10 ], [ 0, %18 ], [ 0, %14 ], [ 0, %5 ]
ret i32 %25
}