#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int check_user_token(char *, char *, char *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int mkstemp(char *);
int /*<<< orphan*/ remove(char *);
void test_check_user_token(void) {
  char file[] = "/tmp/pamtest.XXXXXX";
  int fd = mkstemp(file);
  FILE *handle;
  int ret;
  assert(fd != -1);
  handle = fdopen(fd, "w");
  fprintf(handle, "# This is a comment containing foobar:foobar\n");
  fprintf(handle, "foobar:hhhvhvhdhbid:hnhbhnhbhnhb:\n");
  fprintf(handle, "# This is a comment in the middle\n");
  fprintf(handle, "kaka:hdhrhbhjhvhu:hihbhdhrhbhj\n");
  fprintf(handle, "# foo2 is a user showing up twice in the file\n");
  fprintf(handle, "foo2:vvvvvvvvvvvv\n");
  fprintf(handle, "bar:hnhbhnhbhnhb\n");
  fprintf(handle, "foo2:cccccccccccc\n");
  fclose(handle);
  ret = check_user_token(file, "foobar", "hhhvhvhdhbid", 1);
  assert(ret == 1);
  ret = check_user_token(file, "foobar", "hnhbhnhbhnhb", 1);
  assert(ret == 1);
  ret = check_user_token(file, "foobar", "hnhbhnhbhnhc", 1);
  assert(ret == -1);
  ret = check_user_token(file, "kaka", "hihbhdhrhbhj", 1);
  assert(ret == 1);
  ret = check_user_token(file, "bar", "hnhbhnhbhnhb", 1);
  assert(ret == 1);
  ret = check_user_token(file, "foo", "hdhrhbhjhvhu", 1);
  assert(ret == -2);
  ret = check_user_token(file, "foo2", "cccccccccccc", 1);
  assert(ret == 1);
  ret = check_user_token(file, "foo2", "vvvvvvvvvvvv", 1);
  assert(ret == 1);
  ret = check_user_token(file, "foo2", "vvvvvvvvvvcc", 1);
  assert(ret == -1);
  ret = check_user_token(file, "foo2", "", 1);
  assert(ret == -1);
  ret = check_user_token(file, "foo", "", 1);
  assert(ret == -2);
  remove(file);
}


x86 assembly (clang, -O0):
<test_check_user_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xe81(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe7e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe7c(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1080 <mkstemp@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x24(%rbp),%edi
lea    0xe56(%rip),%rsi
call   1090 <fdopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x20(%rbp),%rdi
lea    0xeb6(%rip),%rsi
lea    0xeb6(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe86(%rip),%rsi
lea    0xe93(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe56(%rip),%rsi
lea    0xe70(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe54(%rip),%rsi
lea    0xe52(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xdf9(%rip),%rsi
lea    0xe03(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe06(%rip),%rsi
lea    0xe03(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xfffffffe,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xde7(%rip),%rsi
lea    0xde5(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xdb7(%rip),%rsi
lea    0xdc2(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xd87(%rip),%rsi
lea    0xd9f(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xd57(%rip),%rsi
lea    0xc54(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xd16(%rip),%rsi
lea    0xc24(%rip),%rdx
mov    $0x1,%ecx
call   1070 <check_user_token@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xfffffffe,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
call   1030 <remove@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_check_user_token>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movaps 0xe7e(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x585858,0x10(%rsp)
mov    %rsp,%r15
mov    %r15,%rdi
call   1070 <mkstemp@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0xffffffff,%eax
setne  %dil
call   1050 <assert@plt>
lea    0xe64(%rip),%rsi
mov    %ebx,%edi
call   1080 <fdopen@plt>
mov    %rax,%rbx
lea    0xe55(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1090 <fwrite@plt>
lea    0xe6a(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xe74(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xe7e(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xe85(%rip),%rdi
mov    $0x2e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xe9b(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xe95(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xe8e(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xe80(%rip),%rbx
lea    0xe80(%rip),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe68(%rip),%r14
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe4d(%rip),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe35(%rip),%rsi
lea    0xe33(%rip),%rdx
mov    %r15,%rdi
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xde1(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdf9(%rip),%r14
lea    0xdf6(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0xfffffffe,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdde(%rip),%r12
lea    0xddc(%rip),%rdx
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdc4(%rip),%rdx
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdac(%rip),%rdx
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xc6c(%rip),%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1060 <check_user_token@plt>
xor    %edi,%edi
cmp    $0xfffffffe,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r15,%rdi
call   1030 <remove@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.test_check_user_token.file = [20 x i8] c"/tmp/pamtest.XXXXXX\00"
@.str = [2 x i8] c"w\00"
@.str.1 = [46 x i8] c"# This is a comment containing foobar:foobar\0A\00"
@.str.2 = [35 x i8] c"foobar:hhhvhvhdhbid:hnhbhnhbhnhb:\0A\00"
@.str.3 = [35 x i8] c"# This is a comment in the middle\0A\00"
@.str.4 = [32 x i8] c"kaka:hdhrhbhjhvhu:hihbhdhrhbhj\0A\00"
@.str.5 = [47 x i8] c"# foo2 is a user showing up twice in the file\0A\00"
@.str.6 = [19 x i8] c"foo2:vvvvvvvvvvvv\0A\00"
@.str.7 = [18 x i8] c"bar:hnhbhnhbhnhb\0A\00"
@.str.8 = [19 x i8] c"foo2:cccccccccccc\0A\00"
@.str.9 = [7 x i8] c"foobar\00"
@.str.10 = [13 x i8] c"hhhvhvhdhbid\00"
@.str.11 = [13 x i8] c"hnhbhnhbhnhb\00"
@.str.12 = [13 x i8] c"hnhbhnhbhnhc\00"
@.str.13 = [5 x i8] c"kaka\00"
@.str.14 = [13 x i8] c"hihbhdhrhbhj\00"
@.str.15 = [4 x i8] c"bar\00"
@.str.16 = [4 x i8] c"foo\00"
@.str.17 = [13 x i8] c"hdhrhbhjhvhu\00"
@.str.18 = [5 x i8] c"foo2\00"
@.str.19 = [13 x i8] c"cccccccccccc\00"
@.str.20 = [13 x i8] c"vvvvvvvvvvvv\00"
@.str.21 = [13 x i8] c"vvvvvvvvvvcc\00"
@.str.22 = [1 x i8] zeroinitializer
define void @test_check_user_token() {
%1 = alloca [20 x i8]
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = bitcast [20 x i8]* %1 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%7 = call i32 @mkstemp(i8* %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, -1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = call i32* @fdopen(i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %13, i32** %3
%14 = load i32*, i32** %3
%15 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32*, i32** %3
%17 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32*, i32** %3
%19 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%20 = load i32*, i32** %3
%21 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%22 = load i32*, i32** %3
%23 = call i32 @fprintf(i32* %22, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
%24 = load i32*, i32** %3
%25 = call i32 @fprintf(i32* %24, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%26 = load i32*, i32** %3
%27 = call i32 @fprintf(i32* %26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%28 = load i32*, i32** %3
%29 = call i32 @fprintf(i32* %28, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%30 = load i32*, i32** %3
%31 = call i32 @fclose(i32* %30)
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%33 = call i32 @check_user_token(i8* %32, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 1)
store i32 %33, i32* %4
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 1
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%39 = call i32 @check_user_token(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 1)
store i32 %39, i32* %4
%40 = load i32, i32* %4
%41 = icmp eq i32 %40, 1
%42 = zext i1 %41 to i32
%43 = call i32 @assert(i32 %42)
%44 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%45 = call i32 @check_user_token(i8* %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), i32 1)
store i32 %45, i32* %4
%46 = load i32, i32* %4
%47 = icmp eq i32 %46, -1
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%51 = call i32 @check_user_token(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i32 1)
store i32 %51, i32* %4
%52 = load i32, i32* %4
%53 = icmp eq i32 %52, 1
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
%56 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%57 = call i32 @check_user_token(i8* %56, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 1)
store i32 %57, i32* %4
%58 = load i32, i32* %4
%59 = icmp eq i32 %58, 1
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%63 = call i32 @check_user_token(i8* %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0), i32 1)
store i32 %63, i32* %4
%64 = load i32, i32* %4
%65 = icmp eq i32 %64, -2
%66 = zext i1 %65 to i32
%67 = call i32 @assert(i32 %66)
%68 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%69 = call i32 @check_user_token(i8* %68, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i32 1)
store i32 %69, i32* %4
%70 = load i32, i32* %4
%71 = icmp eq i32 %70, 1
%72 = zext i1 %71 to i32
%73 = call i32 @assert(i32 %72)
%74 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%75 = call i32 @check_user_token(i8* %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i32 1)
store i32 %75, i32* %4
%76 = load i32, i32* %4
%77 = icmp eq i32 %76, 1
%78 = zext i1 %77 to i32
%79 = call i32 @assert(i32 %78)
%80 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%81 = call i32 @check_user_token(i8* %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.21, i64 0, i64 0), i32 1)
store i32 %81, i32* %4
%82 = load i32, i32* %4
%83 = icmp eq i32 %82, -1
%84 = zext i1 %83 to i32
%85 = call i32 @assert(i32 %84)
%86 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%87 = call i32 @check_user_token(i8* %86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.22, i64 0, i64 0), i32 1)
store i32 %87, i32* %4
%88 = load i32, i32* %4
%89 = icmp eq i32 %88, -1
%90 = zext i1 %89 to i32
%91 = call i32 @assert(i32 %90)
%92 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%93 = call i32 @check_user_token(i8* %92, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.22, i64 0, i64 0), i32 1)
store i32 %93, i32* %4
%94 = load i32, i32* %4
%95 = icmp eq i32 %94, -2
%96 = zext i1 %95 to i32
%97 = call i32 @assert(i32 %96)
%98 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%99 = call i32 @remove(i8* %98)
ret void
}

LLVM IR (-O2):
@__const.test_check_user_token.file = [20 x i8] c"/tmp/pamtest.XXXXXX\00"
@.str = [2 x i8] c"w\00"
@.str.1 = [46 x i8] c"# This is a comment containing foobar:foobar\0A\00"
@.str.2 = [35 x i8] c"foobar:hhhvhvhdhbid:hnhbhnhbhnhb:\0A\00"
@.str.3 = [35 x i8] c"# This is a comment in the middle\0A\00"
@.str.4 = [32 x i8] c"kaka:hdhrhbhjhvhu:hihbhdhrhbhj\0A\00"
@.str.5 = [47 x i8] c"# foo2 is a user showing up twice in the file\0A\00"
@.str.6 = [19 x i8] c"foo2:vvvvvvvvvvvv\0A\00"
@.str.7 = [18 x i8] c"bar:hnhbhnhbhnhb\0A\00"
@.str.8 = [19 x i8] c"foo2:cccccccccccc\0A\00"
@.str.9 = [7 x i8] c"foobar\00"
@.str.10 = [13 x i8] c"hhhvhvhdhbid\00"
@.str.11 = [13 x i8] c"hnhbhnhbhnhb\00"
@.str.12 = [13 x i8] c"hnhbhnhbhnhc\00"
@.str.13 = [5 x i8] c"kaka\00"
@.str.14 = [13 x i8] c"hihbhdhrhbhj\00"
@.str.15 = [4 x i8] c"bar\00"
@.str.16 = [4 x i8] c"foo\00"
@.str.17 = [13 x i8] c"hdhrhbhjhvhu\00"
@.str.18 = [5 x i8] c"foo2\00"
@.str.19 = [13 x i8] c"cccccccccccc\00"
@.str.20 = [13 x i8] c"vvvvvvvvvvvv\00"
@.str.21 = [13 x i8] c"vvvvvvvvvvcc\00"
@.str.22 = [1 x i8] zeroinitializer
define void @test_check_user_token() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @mkstemp(i8* %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32* @fdopen(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i64 45, i64 1, i32* %7)
%9 = call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i64 34, i64 1, i32* %7)
%10 = call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i64 34, i64 1, i32* %7)
%11 = call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i64 31, i64 1, i32* %7)
%12 = call i64 @fwrite(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i64 46, i64 1, i32* %7)
%13 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i64 18, i64 1, i32* %7)
%14 = call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i64 17, i64 1, i32* %7)
%15 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i64 18, i64 1, i32* %7)
%16 = call i32 @fclose(i32* %7)
%17 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 1)
%18 = icmp eq i32 %17, 1
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 1)
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), i32 1)
%26 = icmp eq i32 %25, -1
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i32 1)
%30 = icmp eq i32 %29, 1
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 1)
%34 = icmp eq i32 %33, 1
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0), i32 1)
%38 = icmp eq i32 %37, -2
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i32 1)
%42 = icmp eq i32 %41, 1
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i32 1)
%46 = icmp eq i32 %45, 1
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
%49 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.21, i64 0, i64 0), i32 1)
%50 = icmp eq i32 %49, -1
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
%53 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.22, i64 0, i64 0), i32 1)
%54 = icmp eq i32 %53, -1
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = call i32 @check_user_token(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.22, i64 0, i64 0), i32 1)
%58 = icmp eq i32 %57, -2
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
%61 = call i32 @remove(i8* %2)
ret void
}