#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*/ perror(char *);
char *strtok(char *, char *);
void _parse_line(char *in_line, char **user_name, int *user_id) {
  char *tok;
  *user_name = strtok(in_line, ":");
  (void)strtok(NULL, ":");
  tok = strtok(NULL, ":");
  if (tok)
    *user_id = atoi(tok);
  else {
    perror("strtok");
    *user_id = 0;
  }
}


x86 assembly (clang, -O0):
<_parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe97(%rip),%rsi
call   1040 <strtok@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe87(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11a3 <_parse_line+0x73>
mov    -0x20(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    11b9 <_parse_line+0x89>
lea    0xe58(%rip),%rdi
call   1030 <perror@plt>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_parse_line>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xebe(%rip),%r15
mov    %r15,%rsi
call   1040 <strtok@plt>
mov    %rax,(%rbx)
xor    %ebx,%ebx
xor    %edi,%edi
mov    %r15,%rsi
call   1040 <strtok@plt>
xor    %edi,%edi
mov    %r15,%rsi
call   1040 <strtok@plt>
test   %rax,%rax
je     117b <_parse_line+0x4b>
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %ebx,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe80(%rip),%rdi
call   1030 <perror@plt>
jmp    1172 <_parse_line+0x42>

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
@.str.1 = [7 x i8] c"strtok\00"
define void @_parse_line(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = call i8* @strtok(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i8**, i8*** %5
store i8* %9, i8** %10
%11 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i8*, i8** %7
%17 = call i32 @atoi(i8* %16)
%18 = load i32*, i32** %6
store i32 %17, i32* %18
br label %22
19: ; preds = %3
%20 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32*, i32** %6
store i32 0, i32* %21
br label %22
22: ; preds = %19, %15
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c":\00"
@.str.1 = [7 x i8] c"strtok\00"
define void @_parse_line(i8* %0, i8** nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %1
%5 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @atoi(i8* %6)
br label %12
10: ; preds = %3
%11 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ 0, %10 ], [ %9, %8 ]
store i32 %13, i32* %2
ret void
}