#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 /*<<< orphan*/ printf(char *, char *, int);
int strtoul(char *, char **, int);
int test_strtoul(void) {
  char *p = NULL;
  do {
    if (!(0 == strtoul("", &p, 10))) {
      printf("expression '%s' untrue at %d\n", "0 == strtoul(\"\", &p, 10)",
             29);
      return 0;
    }
  } while (0);
  do {
    if (!(*p == 0)) {
      printf("expression '%s' untrue at %d\n", "*p == 0", 30);
      return 0;
    }
  } while (0);
  do {
    if (!(1 == strtoul("1", NULL, 10))) {
      printf("expression '%s' untrue at %d\n", "1 == strtoul(\"1\", NULL, 10)",
             31);
      return 0;
    }
  } while (0);
  do {
    if (!(10 == strtoul("10", NULL, 10))) {
      printf("expression '%s' untrue at %d\n",
             "10 == strtoul(\"10\", NULL, 10)", 32);
      return 0;
    }
  } while (0);
  do {
    if (!(8765432 == strtoul("8765432", NULL, 10))) {
      printf("expression '%s' untrue at %d\n",
             "8765432 == strtoul(\"8765432\", NULL, 10)", 33);
      return 0;
    }
  } while (0);
  do {
    if (!(1 == strtoul("+1", NULL, 10))) {
      printf("expression '%s' untrue at %d\n", "1 == strtoul(\"+1\", NULL, 10)",
             34);
      return 0;
    }
  } while (0);
  do {
    if (!(-1 == strtoul("-1", NULL, 10))) {
      printf("expression '%s' untrue at %d\n",
             "-1 == strtoul(\"-1\", NULL, 10)", 35);
      return 0;
    }
  } while (0);
  do {
    if (!(0x10 == strtoul("0x10", NULL, 16))) {
      printf("expression '%s' untrue at %d\n",
             "0x10 == strtoul(\"0x10\", NULL, 16)", 36);
      return 0;
    }
  } while (0);
  do {
    if (!(123 == strtoul("123x", &p, 10))) {
      printf("expression '%s' untrue at %d\n",
             "123 == strtoul(\"123x\", &p, 10)", 37);
      return 0;
    }
  } while (0);
  do {
    if (!(*p == 'x')) {
      printf("expression '%s' untrue at %d\n", "*p == 'x'", 38);
      return 0;
    }
  } while (0);
  do {
    if (!(127 == strtoul("0x7f", &p, 16))) {
      printf("expression '%s' untrue at %d\n",
             "127 == strtoul(\"0x7f\", &p, 16)", 39);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_strtoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
lea    0xee6(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1175 <test_strtoul+0x55>
lea    0xea8(%rip),%rdi
lea    0xebf(%rip),%rsi
mov    $0x1d,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    117a <test_strtoul+0x5a>
jmp    117f <test_strtoul+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11b3 <test_strtoul+0x93>
lea    0xe6a(%rip),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x1e,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    11b8 <test_strtoul+0x98>
jmp    11bd <test_strtoul+0x9d>
lea    0xee6(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1205 <test_strtoul+0xe5>
lea    0xe18(%rip),%rdi
lea    0xe50(%rip),%rsi
mov    $0x1f,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    120a <test_strtoul+0xea>
jmp    120f <test_strtoul+0xef>
lea    0xed6(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
je     1257 <test_strtoul+0x137>
lea    0xdc6(%rip),%rdi
lea    0xe1a(%rip),%rsi
mov    $0x20,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    125c <test_strtoul+0x13c>
jmp    1261 <test_strtoul+0x141>
lea    0xe11(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    $0x85bff8,%eax
cmp    %ecx,%eax
je     12a9 <test_strtoul+0x189>
lea    0xd74(%rip),%rdi
lea    0xdee(%rip),%rsi
mov    $0x21,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    12ae <test_strtoul+0x18e>
jmp    12b3 <test_strtoul+0x193>
lea    0xdef(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     12fb <test_strtoul+0x1db>
lea    0xd22(%rip),%rdi
lea    0xdc7(%rip),%rsi
mov    $0x22,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    1300 <test_strtoul+0x1e0>
jmp    1305 <test_strtoul+0x1e5>
lea    0xdbd(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
je     134d <test_strtoul+0x22d>
lea    0xcd0(%rip),%rdi
lea    0xd95(%rip),%rsi
mov    $0x23,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    1352 <test_strtoul+0x232>
jmp    1357 <test_strtoul+0x237>
lea    0xd8c(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    $0x10,%eax
cmp    %ecx,%eax
je     139f <test_strtoul+0x27f>
lea    0xc7e(%rip),%rdi
lea    0xd66(%rip),%rsi
mov    $0x24,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    13a4 <test_strtoul+0x284>
jmp    13a9 <test_strtoul+0x289>
lea    0xd61(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    $0x7b,%eax
cmp    %ecx,%eax
je     13f1 <test_strtoul+0x2d1>
lea    0xc2c(%rip),%rdi
lea    0xd3b(%rip),%rsi
mov    $0x25,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    13f6 <test_strtoul+0x2d6>
jmp    13fb <test_strtoul+0x2db>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x78,%eax
je     142f <test_strtoul+0x30f>
lea    0xbee(%rip),%rdi
lea    0xd1c(%rip),%rsi
mov    $0x26,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    1434 <test_strtoul+0x314>
jmp    1439 <test_strtoul+0x319>
lea    0xcff(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    $0x7f,%eax
cmp    %ecx,%eax
je     1481 <test_strtoul+0x361>
lea    0xb9c(%rip),%rdi
lea    0xcd9(%rip),%rsi
mov    $0x27,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    148d <test_strtoul+0x36d>
jmp    1486 <test_strtoul+0x366>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strtoul>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0xee8(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1040 <strtoul@plt>
test   %eax,%eax
je     115d <test_strtoul+0x3d>
lea    0xeb1(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0x1d,%edx
jmp    117a <test_strtoul+0x5a>
mov    0x8(%rsp),%rax
cmpb   $0x0,(%rax)
je     1189 <test_strtoul+0x69>
lea    0xe92(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x1e,%edx
call   1030 <printf@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xf1a(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
cmp    $0x1,%eax
jne    123e <test_strtoul+0x11e>
lea    0xf3e(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
cmp    $0xa,%eax
jne    125b <test_strtoul+0x13b>
lea    0xead(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
cmp    $0x85bff8,%eax
jne    1278 <test_strtoul+0x158>
lea    0xebd(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
cmp    $0x1,%eax
jne    1295 <test_strtoul+0x175>
lea    0xebf(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
cmp    $0xffffffff,%eax
je     12b2 <test_strtoul+0x192>
lea    0xdd8(%rip),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x23,%edx
call   1030 <printf@plt>
jmp    1181 <test_strtoul+0x61>
lea    0xdbb(%rip),%rdi
lea    0xdf3(%rip),%rsi
mov    $0x1f,%edx
call   1030 <printf@plt>
jmp    1181 <test_strtoul+0x61>
lea    0xd9e(%rip),%rdi
lea    0xdf2(%rip),%rsi
mov    $0x20,%edx
call   1030 <printf@plt>
jmp    1181 <test_strtoul+0x61>
lea    0xd81(%rip),%rdi
lea    0xdfb(%rip),%rsi
mov    $0x21,%edx
call   1030 <printf@plt>
jmp    1181 <test_strtoul+0x61>
lea    0xd64(%rip),%rdi
lea    0xe09(%rip),%rsi
mov    $0x22,%edx
call   1030 <printf@plt>
jmp    1181 <test_strtoul+0x61>
lea    0xe31(%rip),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
cmp    $0x10,%eax
jne    132b <test_strtoul+0x20b>
lea    0xe40(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1040 <strtoul@plt>
cmp    $0x7b,%eax
jne    1343 <test_strtoul+0x223>
mov    0x8(%rsp),%rax
cmpb   $0x78,(%rax)
jne    135b <test_strtoul+0x23b>
lea    0xe49(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    $0x1,%ebx
cmp    $0x7f,%eax
je     1181 <test_strtoul+0x61>
lea    0xce6(%rip),%rdi
lea    0xe23(%rip),%rsi
mov    $0x27,%edx
jmp    117a <test_strtoul+0x5a>
lea    0xcce(%rip),%rdi
lea    0xdb6(%rip),%rsi
mov    $0x24,%edx
jmp    117a <test_strtoul+0x5a>
lea    0xcb6(%rip),%rdi
lea    0xdc5(%rip),%rsi
mov    $0x25,%edx
jmp    117a <test_strtoul+0x5a>
lea    0xc9e(%rip),%rdi
lea    0xdcc(%rip),%rsi
mov    $0x26,%edx
jmp    117a <test_strtoul+0x5a>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [25 x i8] c"0 == strtoul(\22\22, &p, 10)\00"
@.str.3 = [8 x i8] c"*p == 0\00"
@.str.4 = [2 x i8] c"1\00"
@.str.5 = [28 x i8] c"1 == strtoul(\221\22, NULL, 10)\00"
@.str.6 = [3 x i8] c"10\00"
@.str.7 = [30 x i8] c"10 == strtoul(\2210\22, NULL, 10)\00"
@.str.8 = [8 x i8] c"8765432\00"
@.str.9 = [40 x i8] c"8765432 == strtoul(\228765432\22, NULL, 10)\00"
@.str.10 = [3 x i8] c"+1\00"
@.str.11 = [29 x i8] c"1 == strtoul(\22+1\22, NULL, 10)\00"
@.str.12 = [3 x i8] c"-1\00"
@.str.13 = [30 x i8] c"-1 == strtoul(\22-1\22, NULL, 10)\00"
@.str.14 = [5 x i8] c"0x10\00"
@.str.15 = [34 x i8] c"0x10 == strtoul(\220x10\22, NULL, 16)\00"
@.str.16 = [5 x i8] c"123x\00"
@.str.17 = [31 x i8] c"123 == strtoul(\22123x\22, &p, 10)\00"
@.str.18 = [10 x i8] c"*p == 'x'\00"
@.str.19 = [5 x i8] c"0x7f\00"
@.str.20 = [31 x i8] c"127 == strtoul(\220x7f\22, &p, 16)\00"
define i32 @test_strtoul() {
%1 = alloca i32
%2 = alloca i8*
store i8* null, i8** %2
br label %3
3: ; preds = %0
%4 = call i32 @strtoul(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2, i32 10)
%5 = icmp eq i32 0, %4
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 29)
store i32 0, i32* %1
br label %84
8: ; preds = %3
br label %9
9: ; preds = %8
br label %10
10: ; preds = %9
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %10
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 30)
store i32 0, i32* %1
br label %84
17: ; preds = %10
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18
%20 = call i32 @strtoul(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** null, i32 10)
%21 = icmp eq i32 1, %20
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 31)
store i32 0, i32* %1
br label %84
24: ; preds = %19
br label %25
25: ; preds = %24
br label %26
26: ; preds = %25
%27 = call i32 @strtoul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8** null, i32 10)
%28 = icmp eq i32 10, %27
br i1 %28, label %31, label %29
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 32)
store i32 0, i32* %1
br label %84
31: ; preds = %26
br label %32
32: ; preds = %31
br label %33
33: ; preds = %32
%34 = call i32 @strtoul(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8** null, i32 10)
%35 = icmp eq i32 8765432, %34
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 33)
store i32 0, i32* %1
br label %84
38: ; preds = %33
br label %39
39: ; preds = %38
br label %40
40: ; preds = %39
%41 = call i32 @strtoul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8** null, i32 10)
%42 = icmp eq i32 1, %41
br i1 %42, label %45, label %43
43: ; preds = %40
%44 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 34)
store i32 0, i32* %1
br label %84
45: ; preds = %40
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
%48 = call i32 @strtoul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8** null, i32 10)
%49 = icmp eq i32 -1, %48
br i1 %49, label %52, label %50
50: ; preds = %47
%51 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i32 35)
store i32 0, i32* %1
br label %84
52: ; preds = %47
br label %53
53: ; preds = %52
br label %54
54: ; preds = %53
%55 = call i32 @strtoul(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8** null, i32 16)
%56 = icmp eq i32 16, %55
br i1 %56, label %59, label %57
57: ; preds = %54
%58 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), i32 36)
store i32 0, i32* %1
br label %84
59: ; preds = %54
br label %60
60: ; preds = %59
br label %61
61: ; preds = %60
%62 = call i32 @strtoul(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i8** %2, i32 10)
%63 = icmp eq i32 123, %62
br i1 %63, label %66, label %64
64: ; preds = %61
%65 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i32 37)
store i32 0, i32* %1
br label %84
66: ; preds = %61
br label %67
67: ; preds = %66
br label %68
68: ; preds = %67
%69 = load i8*, i8** %2
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 120
br i1 %72, label %75, label %73
73: ; preds = %68
%74 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 38)
store i32 0, i32* %1
br label %84
75: ; preds = %68
br label %76
76: ; preds = %75
br label %77
77: ; preds = %76
%78 = call i32 @strtoul(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8** %2, i32 16)
%79 = icmp eq i32 127, %78
br i1 %79, label %82, label %80
80: ; preds = %77
%81 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.20, i64 0, i64 0), i32 39)
store i32 0, i32* %1
br label %84
82: ; preds = %77
br label %83
83: ; preds = %82
store i32 1, i32* %1
br label %84
84: ; preds = %83, %80, %73, %64, %57, %50, %43, %36, %29, %22, %15, %6
%85 = load i32, i32* %1
ret i32 %85
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [25 x i8] c"0 == strtoul(\22\22, &p, 10)\00"
@.str.3 = [8 x i8] c"*p == 0\00"
@.str.4 = [2 x i8] c"1\00"
@.str.5 = [28 x i8] c"1 == strtoul(\221\22, NULL, 10)\00"
@.str.6 = [3 x i8] c"10\00"
@.str.7 = [30 x i8] c"10 == strtoul(\2210\22, NULL, 10)\00"
@.str.8 = [8 x i8] c"8765432\00"
@.str.9 = [40 x i8] c"8765432 == strtoul(\228765432\22, NULL, 10)\00"
@.str.10 = [3 x i8] c"+1\00"
@.str.11 = [29 x i8] c"1 == strtoul(\22+1\22, NULL, 10)\00"
@.str.12 = [3 x i8] c"-1\00"
@.str.13 = [30 x i8] c"-1 == strtoul(\22-1\22, NULL, 10)\00"
@.str.14 = [5 x i8] c"0x10\00"
@.str.15 = [34 x i8] c"0x10 == strtoul(\220x10\22, NULL, 16)\00"
@.str.16 = [5 x i8] c"123x\00"
@.str.17 = [31 x i8] c"123 == strtoul(\22123x\22, &p, 10)\00"
@.str.18 = [10 x i8] c"*p == 'x'\00"
@.str.19 = [5 x i8] c"0x7f\00"
@.str.20 = [31 x i8] c"127 == strtoul(\220x7f\22, &p, 16)\00"
define i32 @test_strtoul() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = call i32 @strtoul(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1, i32 10)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 29)
br label %59
7: ; preds = %0
%8 = load i8*, i8** %1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 30)
br label %59
13: ; preds = %7
%14 = tail call i32 @strtoul(i8* nocapture getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** null, i32 10)
%15 = icmp eq i32 %14, 1
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 31)
br label %59
18: ; preds = %13
%19 = tail call i32 @strtoul(i8* nocapture getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8** null, i32 10)
%20 = icmp eq i32 %19, 10
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 32)
br label %59
23: ; preds = %18
%24 = tail call i32 @strtoul(i8* nocapture getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8** null, i32 10)
%25 = icmp eq i32 %24, 8765432
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 33)
br label %59
28: ; preds = %23
%29 = tail call i32 @strtoul(i8* nocapture getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8** null, i32 10)
%30 = icmp eq i32 %29, 1
br i1 %30, label %33, label %31
31: ; preds = %28
%32 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 34)
br label %59
33: ; preds = %28
%34 = tail call i32 @strtoul(i8* nocapture getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8** null, i32 10)
%35 = icmp eq i32 %34, -1
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i32 35)
br label %59
38: ; preds = %33
%39 = tail call i32 @strtoul(i8* nocapture getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8** null, i32 16)
%40 = icmp eq i32 %39, 16
br i1 %40, label %43, label %41
41: ; preds = %38
%42 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), i32 36)
br label %59
43: ; preds = %38
%44 = call i32 @strtoul(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i8** %1, i32 10)
%45 = icmp eq i32 %44, 123
br i1 %45, label %48, label %46
46: ; preds = %43
%47 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i32 37)
br label %59
48: ; preds = %43
%49 = load i8*, i8** %1
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 120
br i1 %51, label %54, label %52
52: ; preds = %48
%53 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 38)
br label %59
54: ; preds = %48
%55 = call i32 @strtoul(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8** %1, i32 16)
%56 = icmp eq i32 %55, 127
br i1 %56, label %59, label %57
57: ; preds = %54
%58 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.20, i64 0, i64 0), i32 39)
br label %59
59: ; preds = %54, %57, %52, %46, %41, %36, %31, %26, %21, %16, %11, %5
%60 = phi i32 [ 0, %57 ], [ 0, %52 ], [ 0, %46 ], [ 0, %41 ], [ 0, %36 ], [ 0, %31 ], [ 0, %26 ], [ 0, %21 ], [ 0, %16 ], [ 0, %11 ], [ 0, %5 ], [ 1, %54 ]
ret i32 %60
}