xunge/DecIR huggingface dataset:
/* Type definitions */
struct iio_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct iio_context *iio_create_xml_context(const char *xml_file) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<iio_create_xml_context>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iio_create_xml_context>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.iio_context = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.iio_context* @iio_create_xml_context(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret %struct.iio_context* null
}

LLVM IR (-O2):
%struct.iio_context = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.iio_context* @iio_create_xml_context(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret %struct.iio_context* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void expected_string(char *got, char *expect) {
  if (strcmp(got, expect) != 0) {
    printf("got '%s' expected '%s'\n", got, expect);
  }
}


x86 assembly (clang, -O0):
<expected_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     115b <expected_string+0x3b>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expected_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strcmp@plt>
test   %rax,%rax
je     114d <expected_string+0x2d>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"got '%s' expected '%s'\0A\00"
define void @expected_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
br label %13
13: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"got '%s' expected '%s'\0A\00"
define void @expected_string(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
unsigned p_ASCIIToDec(const char *buf) {
  unsigned v = 0;
  while (*buf) {
    v *= 10;
    v += (*buf++) - '0';
  }
  return (v);
}


x86 assembly (clang, -O0):
<p_ASCIIToDec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1143 <p_ASCIIToDec+0x43>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <p_ASCIIToDec+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_ASCIIToDec>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <p_ASCIIToDec+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <p_ASCIIToDec+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @p_ASCIIToDec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i32, i32* %3
%10 = mul i32 %9, 10
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 48
%16 = load i32, i32* %3
%17 = add i32 %16, %15
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @p_ASCIIToDec(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 10
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, -48
%12 = add i32 %11, %10
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ listen(int, int);
int /*<<< orphan*/ perror(char *);
void Listen(int fd, int backlog) {
  if (listen(fd, backlog) < 0) {
    perror("listen error");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
cmp    $0x0,%rax
jge    1169 <Listen+0x39>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1030 <listen@plt>
test   %rax,%rax
js     113d <Listen+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"listen error\00"
define void @Listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @listen(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"listen error\00"
define void @Listen(i32 %0, i32 %1) {
%3 = tail call i64 @listen(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_aggrpriotbl_usage(void) {
  printf("\nUsage : aggrpriotbl <m0> <n0> <m1> <n1> ... <m7> <n7>");
  printf("\nOptions: <mx> : 0 - 7, 0xff to disable AMPDU aggregation.");
  printf("\n         <nx> : 0 - 7, 0xff to disable AMSDU aggregation.");
  printf("\n         empty - get the priority table\n");
  return;
}


x86 assembly (clang, -O0):
<print_aggrpriotbl_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3f(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6e(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_aggrpriotbl_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf03(%rip),%rdi
call   1040 <printf@plt>
lea    0xf32(%rip),%rdi
call   1040 <printf@plt>
lea    0xf61(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"\0AUsage : aggrpriotbl <m0> <n0> <m1> <n1> ... <m7> <n7>\00"
@.str.1 = [59 x i8] c"\0AOptions: <mx> : 0 - 7, 0xff to disable AMPDU aggregation.\00"
@.str.2 = [59 x i8] c"\0A <nx> : 0 - 7, 0xff to disable AMSDU aggregation.\00"
@.str.3 = [42 x i8] c"\0A empty - get the priority table\0A\00"
define void @print_aggrpriotbl_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"\0AUsage : aggrpriotbl <m0> <n0> <m1> <n1> ... <m7> <n7>\00"
@.str.1 = [59 x i8] c"\0AOptions: <mx> : 0 - 7, 0xff to disable AMPDU aggregation.\00"
@.str.2 = [59 x i8] c"\0A <nx> : 0 - 7, 0xff to disable AMSDU aggregation.\00"
@str = [41 x i8] c"\0A empty - get the priority table\00"
define void @print_aggrpriotbl_usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int isaac_strcmp(const char *s1, const char *s2) {
  if (!s1 || !s2)
    return 1;
  return strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<isaac_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <isaac_strcmp+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <isaac_strcmp+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1152 <isaac_strcmp+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isaac_strcmp>:
test   %rdi,%rdi
je     111f <isaac_strcmp+0xf>
test   %rsi,%rsi
je     111f <isaac_strcmp+0xf>
jmp    1030 <strcmp@plt>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isaac_strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 1, i32* %3
br label %16
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @strcmp(i8* %13, i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @isaac_strcmp(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 1, %2 ]
ret i32 %9
}
int isboolok() { return 1; }


x86 assembly (clang, -O0):
<isboolok>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isboolok>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isboolok() {
ret i32 1
}

LLVM IR (-O2):
define i32 @isboolok() {
ret i32 1
}
float calculate_area(float pi, float r) { return pi * r * r; }


x86 assembly (clang, -O0):
<calculate_area>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_area>:
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @calculate_area(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
%8 = load float, float* %4
%9 = fmul float %7, %8
ret float %9
}

LLVM IR (-O2):
define float @calculate_area(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fmul float %3, %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage:\n");
  fprintf(stderr, "   rtctest --full         = do all tests\n");
  fprintf(stderr,
          "   rtctest --no-periodic  = don't do periodic interrupt tests\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xee4(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef5(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [42 x i8] c" rtctest --full = do all tests\0A\00"
@.str.2 = [63 x i8] c" rtctest --no-periodic = don't do periodic interrupt tests\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [42 x i8] c" rtctest --full = do all tests\0A\00"
@.str.2 = [63 x i8] c" rtctest --no-periodic = don't do periodic interrupt tests\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ gmp_randstate_t;

/* Variables and functions */
int /*<<< orphan*/ gen_number(int /*<<< orphan*/, int, int /*<<< orphan*/);
int mpz_probab_prime_p(int /*<<< orphan*/, int);
void gen_prime(mpz_t p, int bitlength, gmp_randstate_t r_state) {
  gen_number(p, bitlength, r_state);
  while (mpz_probab_prime_p(p, 25) < 1) {
    gen_number(p, bitlength, r_state);
  }
}


x86 assembly (clang, -O0):
<gen_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <gen_number@plt>
mov    -0x4(%rbp),%edi
mov    $0x19,%esi
call   1030 <mpz_probab_prime_p@plt>
cmp    $0x1,%eax
jge    1168 <gen_prime+0x48>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <gen_number@plt>
jmp    113f <gen_prime+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_prime>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
nopl   0x0(%rax,%rax,1)
call   1040 <gen_number@plt>
mov    %ebx,%edi
mov    $0x19,%esi
call   1030 <mpz_probab_prime_p@plt>
test   %eax,%eax
jg     114e <gen_prime+0x2e>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
jmp    1130 <gen_prime+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @gen_prime(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @gen_number(i32 %7, i32 %8, i32 %9)
br label %11
11: ; preds = %15, %3
%12 = load i32, i32* %4
%13 = call i32 @mpz_probab_prime_p(i32 %12, i32 25)
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = call i32 @gen_number(i32 %16, i32 %17, i32 %18)
br label %11
20: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @gen_prime(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @gen_number(i32 %0, i32 %1, i32 %2)
%5 = tail call i32 @mpz_probab_prime_p(i32 %0, i32 25)
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %3, %7
%8 = tail call i32 @gen_number(i32 %0, i32 %1, i32 %2)
%9 = tail call i32 @mpz_probab_prime_p(i32 %0, i32 25)
%10 = icmp slt i32 %9, 1
br i1 %10, label %7, label %11
11: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ destroy_thread_fast_rng();
void crypto_prefork(void) { destroy_thread_fast_rng(); }


x86 assembly (clang, -O0):
<crypto_prefork>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <destroy_thread_fast_rng@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_prefork>:
xor    %eax,%eax
jmp    1030 <destroy_thread_fast_rng@plt>

LLVM IR (-O0):
define void @crypto_prefork() {
%1 = call i32 (...) @destroy_thread_fast_rng()
ret void
}

LLVM IR (-O2):
define void @crypto_prefork() {
%1 = tail call i32 (...) @destroy_thread_fast_rng()
ret void
}
void foo141() {}


x86 assembly (clang, -O0):
<foo141>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo141>:
ret

LLVM IR (-O0):
define void @foo141() {
ret void
}

LLVM IR (-O2):
define void @foo141() {
ret void
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
int hash_add_unique_bin(struct hash *, char const *, size_t, void const *);
size_t strlen(char const *);
int hash_add_unique(struct hash *hash, const char *key, const void *value) {
  size_t keylen = strlen(key);
  return hash_add_unique_bin(hash, key, keylen, value);
}


x86 assembly (clang, -O0):
<hash_add_unique>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <hash_add_unique_bin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_add_unique>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <hash_add_unique_bin@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define i32 @hash_add_unique(%struct.hash* %0, i8* %1, i8* %2) {
%4 = alloca %struct.hash*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store %struct.hash* %0, %struct.hash** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %7
%10 = load %struct.hash*, %struct.hash** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %7
%13 = load i8*, i8** %6
%14 = call i32 @hash_add_unique_bin(%struct.hash* %10, i8* %11, i64 %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define i32 @hash_add_unique(%struct.hash* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = tail call i32 @hash_add_unique_bin(%struct.hash* %0, i8* %1, i64 %4, i8* %2)
ret i32 %5
}
int compare_int(int *num1, int *num2) {
  if ((*num1) < (*num2))
    return -1;
  if ((*num1) > (*num2))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <compare_int+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <compare_int+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    1148 <compare_int+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <compare_int+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_int(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %20
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = icmp sgt i32 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %3
br label %20
19: ; preds = %12
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @compare_int(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = icmp sgt i32 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
int do_777() { return 777; }


x86 assembly (clang, -O0):
<do_777>:
push   %rbp
mov    %rsp,%rbp
mov    $0x309,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_777>:
mov    $0x309,%eax
ret

LLVM IR (-O0):
define i32 @do_777() {
ret i32 777
}

LLVM IR (-O2):
define i32 @do_777() {
ret i32 777
}
/* Type definitions */
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
scalar_t__ is_dasd(unsigned short);
int /*<<< orphan*/ major(int /*<<< orphan*/);
int /*<<< orphan*/ makedev(int /*<<< orphan*/, int);
int minor(int /*<<< orphan*/);
dev_t get_partition_base(unsigned short type, dev_t dev) {
  return makedev(major(dev), minor(dev) & (is_dasd(type) ? ~0x03 : ~0x0f));
}


x86 assembly (clang, -O0):
<get_partition_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <major@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <minor@plt>
mov    %eax,-0x10(%rbp)
movzwl -0x2(%rbp),%edi
call   1050 <is_dasd@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
mov    $0xfffffff0,%eax
mov    $0xfffffffc,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
and    %eax,%esi
call   1060 <makedev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_partition_base>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <major@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <minor@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1050 <is_dasd@plt>
test   %rax,%rax
mov    $0xfffffff0,%eax
mov    $0xfffffffc,%esi
cmove  %eax,%esi
and    %ebx,%esi
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <makedev@plt>

LLVM IR (-O0):
define i32 @get_partition_base(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @major(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @minor(i32 %7)
%9 = load i16, i16* %3
%10 = call i64 @is_dasd(i16 zeroext %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -4, i32 -16
%14 = and i32 %8, %13
%15 = call i32 @makedev(i32 %6, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_partition_base(i16 zeroext %0, i32 %1) {
%3 = tail call i32 @major(i32 %1)
%4 = tail call i32 @minor(i32 %1)
%5 = tail call i64 @is_dasd(i16 zeroext %0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 -16, i32 -4
%8 = and i32 %7, %4
%9 = tail call i32 @makedev(i32 %3, i32 %8)
ret i32 %9
}
void init_process() {}


x86 assembly (clang, -O0):
<init_process>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_process>:
ret

LLVM IR (-O0):
define void @init_process() {
ret void
}

LLVM IR (-O2):
define void @init_process() {
ret void
}
int ioInitPrintJob(void) { return 1; }


x86 assembly (clang, -O0):
<ioInitPrintJob>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioInitPrintJob>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ioInitPrintJob() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ioInitPrintJob() {
ret i32 1
}
int IDLRotLibUnload(int argc, void *argv[]) { return 1; }


x86 assembly (clang, -O0):
<IDLRotLibUnload>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IDLRotLibUnload>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @IDLRotLibUnload(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 1
}

LLVM IR (-O2):
define i32 @IDLRotLibUnload(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void show_usage(char *argv0) {
  printf("Usage:\n");
  printf("%% %s varname step\n", argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [20 x i8] c"%% %s varname step\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"%% %s varname step\0A\00"
@str = [7 x i8] c"Usage:\00"
define void @show_usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *file_extension(const char *filename) {
  const char *dot = strrchr(filename, '.');
  if (!dot || dot == filename) {
    return "";
  }
  return dot + 1;
}


x86 assembly (clang, -O0):
<file_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <file_extension+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <file_extension+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <file_extension+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_extension>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
cmp    %rbx,%rax
lea    0xed4(%rip),%rdx
cmove  %rdx,%rcx
test   %rax,%rax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @file_extension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %17
17: ; preds = %14, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @file_extension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
void pread() {}


x86 assembly (clang, -O0):
<pread>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pread>:
ret

LLVM IR (-O0):
define void @pread() {
ret void
}

LLVM IR (-O2):
define void @pread() {
ret void
}
double floor(double input) { return ((double)((int)input)); }


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "Usage: %s <executable>\n", progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s <executable>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s <executable>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
bool nrf53_errata_93(void) { return false; }


x86 assembly (clang, -O0):
<nrf53_errata_93>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf53_errata_93>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nrf53_errata_93() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf53_errata_93() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parse_cm_file(char *);
int /*<<< orphan*/ print_credits();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  print_credits();
  if (argc != 2) {
    printf("Error: you have to provide an input file\n");
    return 1;
  }
  parse_cm_file(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <print_credits@plt>
cmpl   $0x2,-0x8(%rbp)
je     116f <main+0x3f>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1183 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <parse_cm_file@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <print_credits@plt>
cmp    $0x2,%ebp
jne    1152 <main+0x22>
mov    0x8(%r14),%rdi
call   1050 <parse_cm_file@plt>
jmp    1163 <main+0x33>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Error: you have to provide an input file\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @print_credits()
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @parse_cm_file(i8* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [41 x i8] c"Error: you have to provide an input file\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @print_credits()
%4 = icmp eq i32 %0, 2
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @parse_cm_file(i8* %9)
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
extern void vec_clear(void *vec) {
  (*(size_t *)(((char *)vec - (sizeof(size_t) * 3)) + sizeof(size_t))) = 0;
}


x86 assembly (clang, -O0):
<vec_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,-0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_clear>:
movq   $0x0,-0x10(%rdi)
ret

LLVM IR (-O0):
define void @vec_clear(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 -24
%5 = getelementptr inbounds i8, i8* %4, i64 8
%6 = bitcast i8* %5 to i64*
store i64 0, i64* %6
ret void
}

LLVM IR (-O2):
define void @vec_clear(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -16
%3 = bitcast i8* %2 to i64*
store i64 0, i64* %3
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  int i;
  for (i = 0; str[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <strlen+0x34>
jmp    1126 <strlen+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
mov    %eax,%eax
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %4
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
ret i64 %17
}

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
ret i64 %9
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t load32_littleendian(const uint8_t x[4]) {
  uint32_t r;
  r = (uint32_t)x[0];
  r |= (uint32_t)x[1] << 8;
  r |= (uint32_t)x[2] << 16;
  r |= (uint32_t)x[3] << 24;
  return r;
}


x86 assembly (clang, -O0):
<load32_littleendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load32_littleendian>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @load32_littleendian(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 8
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
%15 = load i64*, i64** %2
%16 = getelementptr inbounds i64, i64* %15, i64 2
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = shl i32 %18, 16
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i64*, i64** %2
%23 = getelementptr inbounds i64, i64* %22, i64 3
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = shl i32 %25, 24
%27 = load i32, i32* %3
%28 = or i32 %27, %26
store i32 %28, i32* %3
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @load32_littleendian(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int error(int, char *);
int /*<<< orphan*/ waitforcmd(int);
int b_wait(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  waitforcmd(-1);
  return 0;
}


x86 assembly (clang, -O0):
<b_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1152 <b_wait+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1040 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <b_wait+0x43>
mov    $0xffffffff,%edi
call   1030 <waitforcmd@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_wait>:
push   %rax
cmp    $0x2,%edi
jl     1134 <b_wait+0x14>
mov    (%rsi),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1040 <error@plt>
mov    $0xffffffff,%edi
call   1030 <waitforcmd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @b_wait(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @error(i32 1, i8* %11)
store i32 %12, i32* %3
br label %15
13: ; preds = %2
%14 = call i32 @waitforcmd(i32 -1)
store i32 0, i32* %3
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @b_wait(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @error(i32 1, i8* %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @waitforcmd(i32 -1)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ 0, %7 ]
ret i32 %10
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int bt_sys_write(int, char *, int);
int _write_r(struct _reent *r, int file, char *ptr, int len) {
  return bt_sys_write(file, ptr, len);
}


x86 assembly (clang, -O0):
<_write_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <bt_sys_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_r>:
mov    %esi,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <bt_sys_write@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
define i32 @_write_r(%struct._reent* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @bt_sys_write(i32 %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i32 @_write_r(%struct._reent* nocapture readnone %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @bt_sys_write(i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int IsPasswordOK();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  bool PwStatus;
  puts("Enter password:");
  PwStatus = IsPasswordOK();
  if (PwStatus == false) {
    puts("Access denied");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <IsPasswordOK@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    116e <main+0x3e>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <IsPasswordOK@plt>
test   %eax,%eax
je     114c <main+0x1c>
xor    %eax,%eax
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Enter password:\00"
@.str.1 = [14 x i8] c"Access denied\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @IsPasswordOK()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter password:\00"
@.str.1 = [14 x i8] c"Access denied\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @IsPasswordOK()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
ret i32 0
}
int do_871() { return 871; }


x86 assembly (clang, -O0):
<do_871>:
push   %rbp
mov    %rsp,%rbp
mov    $0x367,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_871>:
mov    $0x367,%eax
ret

LLVM IR (-O0):
define i32 @do_871() {
ret i32 871
}

LLVM IR (-O2):
define i32 @do_871() {
ret i32 871
}
main() {
  struct A {
    int i;
  } x[2], *p;
  p = &x[0];
  p++->i = 2;
  p--->i = 3;
  return p->i + (p + 1)->i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0x2,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
add    0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%eax
ret

LLVM IR (-O0):
%struct.A = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x %struct.A]
%3 = alloca %struct.A*
store i32 0, i32* %1
%4 = getelementptr inbounds [2 x %struct.A], [2 x %struct.A]* %2, i64 0, i64 0
store %struct.A* %4, %struct.A** %3
%5 = load %struct.A*, %struct.A** %3
%6 = getelementptr inbounds %struct.A, %struct.A* %5, i32 1
store %struct.A* %6, %struct.A** %3
%7 = getelementptr inbounds %struct.A, %struct.A* %5, i32 0, i32 0
store i32 2, i32* %7
%8 = load %struct.A*, %struct.A** %3
%9 = getelementptr inbounds %struct.A, %struct.A* %8, i32 -1
store %struct.A* %9, %struct.A** %3
%10 = getelementptr inbounds %struct.A, %struct.A* %8, i32 0, i32 0
store i32 3, i32* %10
%11 = load %struct.A*, %struct.A** %3
%12 = getelementptr inbounds %struct.A, %struct.A* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load %struct.A*, %struct.A** %3
%15 = getelementptr inbounds %struct.A, %struct.A* %14, i64 1
%16 = getelementptr inbounds %struct.A, %struct.A* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = add nsw i32 %13, %17
ret i32 %18
}

LLVM IR (-O2):
%struct.A = type { i32 }
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) { printf("%d\n", INT_MAX); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @INT_MAX
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @INT_MAX
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int nondet() {
  int x;
  return x;
}


x86 assembly (clang, -O0):
<nondet>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nondet>:
ret

LLVM IR (-O0):
define i32 @nondet() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @nondet() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test18_head() {
  do {
    printf("test18");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test18_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test18_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test18_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test18\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test18_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test18\00"
define void @test18_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}