#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 strtoll(char *, int /*<<< orphan*/ *, int);
int test_strtoll(void) {
  do {
    if (!(0 == strtoll("", NULL, 10))) {
      printf("expression '%s' untrue at %d\n", "0 == strtoll(\"\", NULL, 10)",
             46);
      return 0;
    }
  } while (0);
  do {
    if (!(1 == strtoll(" 1", NULL, 10))) {
      printf("expression '%s' untrue at %d\n", "1 == strtoll(\" 1\", NULL, 10)",
             47);
      return 0;
    }
  } while (0);
  do {
    if (!(1 == strtoll("\t 1", NULL, 10))) {
      printf("expression '%s' untrue at %d\n",
             "1 == strtoll(\"\\t 1\", NULL, 10)", 48);
      return 0;
    }
  } while (0);
  do {
    if (!(100000000000 == strtoll("100000000000", NULL, 10))) {
      printf("expression '%s' untrue at %d\n",
             "100000000000 == strtoll(\"100000000000\", NULL, 10)", 49);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_strtoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeee(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     116d <test_strtoll+0x4d>
lea    0xeb0(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    $0x2e,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1276 <test_strtoll+0x156>
jmp    1172 <test_strtoll+0x52>
jmp    1177 <test_strtoll+0x57>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     11bf <test_strtoll+0x9f>
lea    0xe5e(%rip),%rdi
lea    0xe90(%rip),%rsi
mov    $0x2f,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1276 <test_strtoll+0x156>
jmp    11c4 <test_strtoll+0xa4>
jmp    11c9 <test_strtoll+0xa9>
lea    0xe86(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1211 <test_strtoll+0xf1>
lea    0xe0c(%rip),%rdi
lea    0xe5f(%rip),%rsi
mov    $0x30,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1276 <test_strtoll+0x156>
jmp    1216 <test_strtoll+0xf6>
jmp    121b <test_strtoll+0xfb>
lea    0xe57(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
movslq %eax,%rcx
movabs $0x174876e800,%rax
cmp    %rcx,%rax
je     126a <test_strtoll+0x14a>
lea    0xdb3(%rip),%rdi
lea    0xe32(%rip),%rsi
mov    $0x31,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1276 <test_strtoll+0x156>
jmp    126f <test_strtoll+0x14f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strtoll>:
push   %rax
lea    0xef6(%rip),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
lea    0xec5(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x31,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [27 x i8] c"0 == strtoll(\22\22, NULL, 10)\00"
@.str.3 = [3 x i8] c" 1\00"
@.str.4 = [29 x i8] c"1 == strtoll(\22 1\22, NULL, 10)\00"
@.str.5 = [4 x i8] c"\09 1\00"
@.str.6 = [31 x i8] c"1 == strtoll(\22\\t 1\22, NULL, 10)\00"
@.str.7 = [13 x i8] c"100000000000\00"
@.str.8 = [50 x i8] c"100000000000 == strtoll(\22100000000000\22, NULL, 10)\00"
define i32 @test_strtoll() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @strtoll(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* null, i32 10)
%4 = icmp eq i32 0, %3
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 46)
store i32 0, i32* %1
br label %31
7: ; preds = %2
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
%10 = call i32 @strtoll(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* null, i32 10)
%11 = icmp eq i32 1, %10
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = 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.4, i64 0, i64 0), i32 47)
store i32 0, i32* %1
br label %31
14: ; preds = %9
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15
%17 = call i32 @strtoll(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32* null, i32 10)
%18 = icmp eq i32 1, %17
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = 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.6, i64 0, i64 0), i32 48)
store i32 0, i32* %1
br label %31
21: ; preds = %16
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
%24 = call i32 @strtoll(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32* null, i32 10)
%25 = sext i32 %24 to i64
%26 = icmp eq i64 100000000000, %25
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), i32 49)
store i32 0, i32* %1
br label %31
29: ; preds = %23
br label %30
30: ; preds = %29
store i32 1, i32* %1
br label %31
31: ; preds = %30, %27, %19, %12, %5
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.7 = [13 x i8] c"100000000000\00"
@.str.8 = [50 x i8] c"100000000000 == strtoll(\22100000000000\22, NULL, 10)\00"
define i32 @test_strtoll() {
%1 = tail call i32 @strtoll(i8* nocapture getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32* null, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), i32 49)
ret i32 0
}