#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 StringToInt(char const *, int /*<<< orphan*/, int *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strlen(char const *);
void TestInts() {
  const char *str1 = "1";
  const char *str2 = "5";
  const char *str3 = "123";
  const char *str4 = "456";
  int val = 0;
  printf("\n-------------------------------------------------------------------"
         "---------\n");
  printf("  Test int functions\n");
  printf("---------------------------------------------------------------------"
         "-------\n");
  {
    printf("Convert \"%s\" to int: ", str1);
    assert(StringToInt(str1, strlen(str1), &val));
    assert(val == 1);
    printf("[OK]\n");
  };
  {
    printf("Convert \"%s\" to int: ", str2);
    assert(StringToInt(str2, strlen(str2), &val));
    assert(val == 5);
    printf("[OK]\n");
  };
  {
    printf("Convert \"%s\" to int: ", str3);
    assert(StringToInt(str3, strlen(str3), &val));
    assert(val == 123);
    printf("[OK]\n");
  };
  {
    printf("Convert \"%s\" to int: ", str4);
    assert(StringToInt(str4, strlen(str4), &val));
    assert(val == 456);
    printf("[OK]\n");
  };
  {
    printf("Convert \"%s\" to int: ", "-15");
    assert(StringToInt("-15", strlen("-15"), &val));
    assert(val == -15);
    printf("[OK]\n");
  };
  {
    printf("Convert \"%s\" to int: ", "+25");
    assert(StringToInt("+25", strlen("+25"), &val));
    assert(val == 25);
    printf("[OK]\n");
  };
  printf("\n");
  {
    printf("Fail to convert \"%s\" to int: ", "42bad");
    assert(StringToInt("42bad", strlen("42bad"), &val) == 0);
    printf("[OK]\n");
  };
  {
    printf("Fail to convert \"%s\" to int: ", "doomsauce");
    assert(StringToInt("doomsauce", strlen("doomsauce"), &val) == 0);
    printf("[OK]\n");
  };
  {
    printf("Fail to convert \"%s\" to int: ", "10.2");
    assert(StringToInt("10.2", strlen("10.2"), &val) == 0);
    printf("[OK]\n");
  };
  printf("---------------------------------------------------------------------"
         "-------\n");
  printf("  Done.\n");
  printf("---------------------------------------------------------------------"
         "-------\n\n");
}


x86 assembly (clang, -O0):
<TestInts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xf33(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe96(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%esi
lea    -0x24(%rbp),%rdx
call   1030 <StringToInt@plt>
mov    %eax,%edi
call   1060 <assert@plt>
cmpl   $0x1,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
lea    -0x24(%rbp),%rdx
call   1030 <StringToInt@plt>
mov    %eax,%edi
call   1060 <assert@plt>
cmpl   $0x5,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
lea    -0x24(%rbp),%rdx
call   1030 <StringToInt@plt>
mov    %eax,%edi
call   1060 <assert@plt>
cmpl   $0x7b,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
lea    -0x24(%rbp),%rdx
call   1030 <StringToInt@plt>
mov    %eax,%edi
call   1060 <assert@plt>
cmpl   $0x1c8,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd60(%rip),%rdi
lea    0xd75(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd67(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xd59(%rip),%rdi
lea    -0x24(%rbp),%rdx
call   1030 <StringToInt@plt>
mov    %eax,%edi
call   1060 <assert@plt>
cmpl   $0xfffffff1,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd07(%rip),%rdi
lea    0xd20(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd12(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xd04(%rip),%rdi
lea    -0x24(%rbp),%rdx
call   1030 <StringToInt@plt>
mov    %eax,%edi
call   1060 <assert@plt>
cmpl   $0x19,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xcc4(%rip),%rdi
lea    0xcdb(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xccd(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xcbf(%rip),%rdi
lea    -0x24(%rbp),%rdx
call   1030 <StringToInt@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc73(%rip),%rdi
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc82(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xc74(%rip),%rdi
lea    -0x24(%rbp),%rdx
call   1030 <StringToInt@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xc22(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc22(%rip),%rdi
lea    0xc49(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc3b(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xc2d(%rip),%rdi
lea    -0x24(%rbp),%rdx
call   1030 <StringToInt@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xbd1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xb49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xbf6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xbf1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestInts>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xedf(%rip),%rdi
call   1040 <puts@plt>
lea    0xf21(%rip),%rdi
call   1040 <puts@plt>
lea    0xec8(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xe67(%rip),%r13
lea    0xe56(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
lea    0xc(%rsp),%r15
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <StringToInt@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0x1,0xc(%rsp)
sete   %dil
call   1080 <assert@plt>
lea    0xecf(%rip),%r12
mov    %r12,%rdi
call   1040 <puts@plt>
lea    0xe24(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <StringToInt@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0x5,0xc(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
lea    0xdbc(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <StringToInt@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0x7b,0xc(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
lea    0xd78(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <StringToInt@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0x1c8,0xc(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
lea    0xd47(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <StringToInt@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0xfffffff1,0xc(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
lea    0xd03(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <StringToInt@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0x19,0xc(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcb5(%rip),%r13
lea    0xccc(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <StringToInt@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1080 <assert@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
lea    0xc94(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <StringToInt@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1080 <assert@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
lea    0xc60(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <StringToInt@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1080 <assert@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xc87(%rip),%rdi
call   1040 <puts@plt>
lea    0xc83(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"5\00"
@.str.2 = [4 x i8] c"123\00"
@.str.3 = [4 x i8] c"456\00"
@.str.4 = [79 x i8] c"\0A----------------------------------------------------------------------------\0A\00"
@.str.5 = [22 x i8] c" Test int functions\0A\00"
@.str.6 = [78 x i8] c"----------------------------------------------------------------------------\0A\00"
@.str.7 = [22 x i8] c"Convert \22%s\22 to int: \00"
@.str.8 = [6 x i8] c"[OK]\0A\00"
@.str.9 = [4 x i8] c"-15\00"
@.str.10 = [4 x i8] c"+25\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [30 x i8] c"Fail to convert \22%s\22 to int: \00"
@.str.13 = [6 x i8] c"42bad\00"
@.str.14 = [10 x i8] c"doomsauce\00"
@.str.15 = [5 x i8] c"10.2\00"
@.str.16 = [9 x i8] c" Done.\0A\00"
@.str.17 = [79 x i8] c"----------------------------------------------------------------------------\0A\0A\00"
define void @TestInts() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %4
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.6, i64 0, i64 0))
%9 = load i8*, i8** %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %1
%12 = load i8*, i8** %1
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @StringToInt(i8* %11, i32 %13, i32* %5)
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 1
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%21 = load i8*, i8** %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %21)
%23 = load i8*, i8** %2
%24 = load i8*, i8** %2
%25 = call i32 @strlen(i8* %24)
%26 = call i32 @StringToInt(i8* %23, i32 %25, i32* %5)
%27 = call i32 @assert(i32 %26)
%28 = load i32, i32* %5
%29 = icmp eq i32 %28, 5
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%33 = load i8*, i8** %3
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %33)
%35 = load i8*, i8** %3
%36 = load i8*, i8** %3
%37 = call i32 @strlen(i8* %36)
%38 = call i32 @StringToInt(i8* %35, i32 %37, i32* %5)
%39 = call i32 @assert(i32 %38)
%40 = load i32, i32* %5
%41 = icmp eq i32 %40, 123
%42 = zext i1 %41 to i32
%43 = call i32 @assert(i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%45 = load i8*, i8** %4
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %45)
%47 = load i8*, i8** %4
%48 = load i8*, i8** %4
%49 = call i32 @strlen(i8* %48)
%50 = call i32 @StringToInt(i8* %47, i32 %49, i32* %5)
%51 = call i32 @assert(i32 %50)
%52 = load i32, i32* %5
%53 = icmp eq i32 %52, 456
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%58 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%59 = call i32 @StringToInt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %58, i32* %5)
%60 = call i32 @assert(i32 %59)
%61 = load i32, i32* %5
%62 = icmp eq i32 %61, -15
%63 = zext i1 %62 to i32
%64 = call i32 @assert(i32 %63)
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%67 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%68 = call i32 @StringToInt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 %67, i32* %5)
%69 = call i32 @assert(i32 %68)
%70 = load i32, i32* %5
%71 = icmp eq i32 %70, 25
%72 = zext i1 %71 to i32
%73 = call i32 @assert(i32 %72)
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%77 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%78 = call i32 @StringToInt(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i32 %77, i32* %5)
%79 = icmp eq i32 %78, 0
%80 = zext i1 %79 to i32
%81 = call i32 @assert(i32 %80)
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%84 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%85 = call i32 @StringToInt(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i32 %84, i32* %5)
%86 = icmp eq i32 %85, 0
%87 = zext i1 %86 to i32
%88 = call i32 @assert(i32 %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%91 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%92 = call i32 @StringToInt(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 %91, i32* %5)
%93 = icmp eq i32 %92, 0
%94 = zext i1 %93 to i32
%95 = call i32 @assert(i32 %94)
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.6, i64 0, i64 0))
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0))
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.17, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"5\00"
@.str.2 = [4 x i8] c"123\00"
@.str.3 = [4 x i8] c"456\00"
@.str.7 = [22 x i8] c"Convert \22%s\22 to int: \00"
@.str.9 = [4 x i8] c"-15\00"
@.str.10 = [4 x i8] c"+25\00"
@.str.12 = [30 x i8] c"Fail to convert \22%s\22 to int: \00"
@.str.13 = [6 x i8] c"42bad\00"
@.str.14 = [10 x i8] c"doomsauce\00"
@.str.15 = [5 x i8] c"10.2\00"
@str = [78 x i8] c"\0A----------------------------------------------------------------------------\00"
@str.18 = [21 x i8] c" Test int functions\00"
@str.28 = [5 x i8] c"[OK]\00"
@str.29 = [77 x i8] c"----------------------------------------------------------------------------\00"
@str.30 = [8 x i8] c" Done.\00"
@str.31 = [78 x i8] c"----------------------------------------------------------------------------\0A\00"
define void @TestInts() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.18, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.29, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @StringToInt(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %7, i32* %1)
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.28, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @StringToInt(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32* %1)
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %1
%20 = icmp eq i32 %19, 5
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.28, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @StringToInt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %25, i32* %1)
%27 = call i32 @assert(i32 %26)
%28 = load i32, i32* %1
%29 = icmp eq i32 %28, 123
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.28, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%35 = call i32 @StringToInt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %34, i32* %1)
%36 = call i32 @assert(i32 %35)
%37 = load i32, i32* %1
%38 = icmp eq i32 %37, 456
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.28, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%43 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%44 = call i32 @StringToInt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %43, i32* %1)
%45 = call i32 @assert(i32 %44)
%46 = load i32, i32* %1
%47 = icmp eq i32 %46, -15
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.28, i64 0, i64 0))
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%52 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%53 = call i32 @StringToInt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 %52, i32* %1)
%54 = call i32 @assert(i32 %53)
%55 = load i32, i32* %1
%56 = icmp eq i32 %55, 25
%57 = zext i1 %56 to i32
%58 = call i32 @assert(i32 %57)
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.28, i64 0, i64 0))
%60 = call i32 @putchar(i32 10)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%62 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%63 = call i32 @StringToInt(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i32 %62, i32* %1)
%64 = icmp eq i32 %63, 0
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.28, i64 0, i64 0))
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%69 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%70 = call i32 @StringToInt(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i32 %69, i32* %1)
%71 = icmp eq i32 %70, 0
%72 = zext i1 %71 to i32
%73 = call i32 @assert(i32 %72)
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.28, i64 0, i64 0))
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%76 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%77 = call i32 @StringToInt(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 %76, i32* %1)
%78 = icmp eq i32 %77, 0
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.28, i64 0, i64 0))
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.29, i64 0, i64 0))
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.30, i64 0, i64 0))
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.31, i64 0, i64 0))
ret void
}