xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Base_destroy(void *this) {
  printf("Base"
         "::destroy()\n");
}


x86 assembly (clang, -O0):
<Base_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Base_destroy>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Base::destroy()\0A\00"
define void @Base_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Base::destroy()\00"
define void @Base_destroy(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
int foo2(int x) { return x - 42; }


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
lea    -0x2a(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 42
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo2(i32 %0) {
%2 = add nsw i32 %0, -42
ret i32 %2
}
unsigned int get_sp(void) {
  __asm__("movl %esp,%eax");
  return -1;
}


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

x86 assembly (clang, -O2):
<get_sp>:
mov    %esp,%eax
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @get_sp() {
tail call void asm sideeffect "movl %esp,%eax", "~{dirflag},~{fpsr},~{flags}"()
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xfc() {
  Assert_real((isalpha(252) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1265, ("isalpha should be 0 for 0xfc"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xfc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfc,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4f1,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xfc>:
push   %rax
mov    $0xfc,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4f1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xfc\00"
define void @t_isalpha_0xfc() {
%1 = call i64 @isalpha(i32 252)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1265, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xfc\00"
define void @t_isalpha_0xfc() {
%1 = tail call i64 @isalpha(i32 252)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1265, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float xmin2s(float const, float, float);
float limdiff(float um, float u0, float up) {
  const float theta = 2.0;
  const float quarter = 0.25;
  float du1 = u0 - um;
  float du2 = up - u0;
  float duc = up - um;
  return xmin2s(quarter, xmin2s(theta, du1, du2), duc);
}


x86 assembly (clang, -O0):
<limdiff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  0xe84(%rip),%xmm0
call   1030 <xmin2s@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm2
movss  0xe6b(%rip),%xmm0
call   1030 <xmin2s@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limdiff>:
push   %rax
movaps %xmm2,%xmm3
subss  %xmm1,%xmm2
subss  %xmm0,%xmm1
subss  %xmm0,%xmm3
movss  %xmm3,0x4(%rsp)
movss  0xed2(%rip),%xmm0
call   1030 <xmin2s@plt>
movaps %xmm0,%xmm1
movss  0xec6(%rip),%xmm0
movss  0x4(%rsp),%xmm2
pop    %rax
jmp    1030 <xmin2s@plt>

LLVM IR (-O0):
define float @limdiff(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
store float 2.000000e+00, float* %7
store float 2.500000e-01, float* %8
%12 = load float, float* %5
%13 = load float, float* %4
%14 = fsub float %12, %13
store float %14, float* %9
%15 = load float, float* %6
%16 = load float, float* %5
%17 = fsub float %15, %16
store float %17, float* %10
%18 = load float, float* %6
%19 = load float, float* %4
%20 = fsub float %18, %19
store float %20, float* %11
%21 = load float, float* %9
%22 = load float, float* %10
%23 = call float @xmin2s(float 2.000000e+00, float %21, float %22)
%24 = load float, float* %11
%25 = call float @xmin2s(float 2.500000e-01, float %23, float %24)
ret float %25
}

LLVM IR (-O2):
define float @limdiff(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = fsub float %2, %1
%6 = fsub float %2, %0
%7 = tail call float @xmin2s(float 2.000000e+00, float %4, float %5)
%8 = tail call float @xmin2s(float 2.500000e-01, float %7, float %6)
ret float %8
}
void pollen_event_Events_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @pollen_event_Events_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float answer = 17 / 13;
  printf("%.2f\n", answer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca float
store float 1.000000e+00, float* %1
%2 = load float, float* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 1.000000e+00)
ret i32 0
}
int iscntrl(int c) { return c > 0 && c < ' '; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <iscntrl+0x20>
cmpl   $0x20,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x1f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 32
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 31
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int foo2(int);
int foo5(int n) { return foo2(n); }


x86 assembly (clang, -O0):
<foo5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo5>:
jmp    1030 <foo2@plt>

LLVM IR (-O0):
define i32 @foo5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo2(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo5(i32 %0) {
%2 = tail call i32 @foo2(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ xorr_gpr64(scalar_t__ *, scalar_t__ const *, size_t);
void maddrc2_gpr64(uint8_t *region1, const uint8_t *region2, uint8_t constant,
                   size_t length) {
  if (constant != 0)
    xorr_gpr64(region1, region2, length);
}


x86 assembly (clang, -O0):
<maddrc2_gpr64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1144 <maddrc2_gpr64+0x34>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <xorr_gpr64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maddrc2_gpr64>:
test   %rdx,%rdx
je     111d <maddrc2_gpr64+0xd>
mov    %rcx,%rdx
jmp    1030 <xorr_gpr64@plt>
ret

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

LLVM IR (-O2):
define void @maddrc2_gpr64(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @xorr_gpr64(i64* %0, i64* %1, i64 %3)
br label %8
8: ; preds = %6, %4
ret void
}
int number_occurrences_char(int char_to_count, char *source) {
  int count = 0;
  if (source) {
    while (*source) {
      if (*source == char_to_count)
        count++;
      source++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<number_occurrences_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <number_occurrences_char+0x5e>
jmp    1122 <number_occurrences_char+0x22>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <number_occurrences_char+0x59>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x4(%rbp),%eax
jne    1148 <number_occurrences_char+0x48>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1122 <number_occurrences_char+0x22>
jmp    115e <number_occurrences_char+0x5e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_occurrences_char>:
xor    %eax,%eax
test   %rsi,%rsi
je     1137 <number_occurrences_char+0x37>
mov    (%rsi),%cl
test   %cl,%cl
je     1137 <number_occurrences_char+0x37>
add    $0x1,%rsi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %cl,%ecx
xor    %edx,%edx
cmp    %edi,%ecx
sete   %dl
add    %edx,%eax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <number_occurrences_char+0x20>
ret

LLVM IR (-O0):
define i32 @number_occurrences_char(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %26
8: ; preds = %2
br label %9
9: ; preds = %22, %8
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i32, i32* %3
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %22
22: ; preds = %19, %13
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %9
25: ; preds = %9
br label %26
26: ; preds = %25, %2
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @number_occurrences_char(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %16, %7 ], [ %5, %4 ]
%9 = phi i32 [ %14, %7 ], [ 0, %4 ]
%10 = phi i8* [ %15, %7 ], [ %1, %4 ]
%11 = sext i8 %8 to i32
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %9, %13
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %7
18: ; preds = %7, %4, %2
%19 = phi i32 [ 0, %2 ], [ 0, %4 ], [ %14, %7 ]
ret i32 %19
}
const char *getUsage(void) {
  return "A fast and easy BitTorrent client\n"
         "\n"
         "Usage: "
         "transmission-cli"
         " [options] <torrent-filename>";
}


x86 assembly (clang, -O0):
<getUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUsage>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [88 x i8] c"A fast and easy BitTorrent client\0A\0AUsage: transmission-cli [options] <torrent-filename>\00"
define i8* @getUsage() {
ret i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [88 x i8] c"A fast and easy BitTorrent client\0A\0AUsage: transmission-cli [options] <torrent-filename>\00"
define i8* @getUsage() {
ret i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0)
}
void *xcalloc(nitems, size)
int nitems, size;
{
  void *value = (void *)calloc(nitems, size);
  if (!value)
    fatal("virtual memory exhausted");
  return value;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rdi
movslq -0x8(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <xcalloc+0x38>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
movslq %edi,%rdi
movslq %esi,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <xcalloc+0x22>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xcalloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = call i8* @calloc(i64 %7, i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xcalloc(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = tail call i8* @calloc(i64 %3, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int secondMaxItem(int *, int);
int main(void) {
  int a[10] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
  printf("%d", secondMaxItem(a, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <secondMaxItem@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <secondMaxItem@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @secondMaxItem(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @secondMaxItem(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void mixedSignedness16(int a) {
  unsigned min = (-((~0U) & ((~0U) >> 1)) - 1);
  clang_analyzer_eval(a <= min);
  clang_analyzer_eval((a + 2) <= min);
  clang_analyzer_eval((a + 2U) <= min);
}


x86 assembly (clang, -O0):
<mixedSignedness16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixedSignedness16>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x80000001,%ebx
setb   %dil
call   1030 <clang_analyzer_eval@plt>
add    $0x2,%ebx
xor    %ebp,%ebp
cmp    $0x80000001,%ebx
setb   %bpl
mov    %ebp,%edi
call   1030 <clang_analyzer_eval@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @mixedSignedness16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -2147483648, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp ule i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 2
%11 = load i32, i32* %3
%12 = icmp ule i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
%15 = load i32, i32* %2
%16 = add i32 %15, 2
%17 = load i32, i32* %3
%18 = icmp ule i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @clang_analyzer_eval(i32 %19)
ret void
}

LLVM IR (-O2):
define void @mixedSignedness16(i32 %0) {
%2 = icmp ult i32 %0, -2147483647
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
%5 = add nsw i32 %0, 2
%6 = icmp ult i32 %5, -2147483647
%7 = zext i1 %6 to i32
%8 = tail call i32 @clang_analyzer_eval(i32 %7)
%9 = tail call i32 @clang_analyzer_eval(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char const **);
void delete_found_commands(const char **p) { free(p); }


x86 assembly (clang, -O0):
<delete_found_commands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_found_commands>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @delete_found_commands(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i32 @free(i8** %3)
ret void
}

LLVM IR (-O2):
define void @delete_found_commands(i8** nocapture %0) {
%2 = tail call i32 @free(i8** %0)
ret void
}
void usb_enable_xhci_ports(struct pci_dev *xhci_pdev) {}


x86 assembly (clang, -O0):
<usb_enable_xhci_ports>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @usb_enable_xhci_ports(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @usb_enable_xhci_ports(%struct.pci_dev* nocapture %0) {
ret void
}
unsigned long arch_mmap_rnd(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @arch_mmap_rnd() {
ret i64 0
}

LLVM IR (-O2):
define i64 @arch_mmap_rnd() {
ret i64 0
}
/* Variables and functions */
void *old_memcpy(void *, void const *, size_t);
void *__wrap_memcpy(void *dest, const void *src, size_t n) {
  return old_memcpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__wrap_memcpy>:
jmp    1030 <old_memcpy@plt>

LLVM IR (-O0):
define i8* @__wrap_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @old_memcpy(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @__wrap_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @old_memcpy(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Type definitions */
struct read_set {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct read_set *);
struct read_set *get_empty_set(struct read_set *q[2]) {
  struct read_set *s;
  assert(q[0]);
  s = q[0];
  q[0] = q[1];
  q[1] = NULL;
  return s;
}


x86 assembly (clang, -O0):
<get_empty_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_empty_set>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <assert@plt>
mov    (%rbx),%rax
mov    0x8(%rbx),%rcx
mov    %rcx,(%rbx)
movq   $0x0,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.read_set = type { i32 }
define %struct.read_set* @get_empty_set(%struct.read_set** %0) {
%2 = alloca %struct.read_set**
%3 = alloca %struct.read_set*
store %struct.read_set** %0, %struct.read_set*** %2
%4 = load %struct.read_set**, %struct.read_set*** %2
%5 = getelementptr inbounds %struct.read_set*, %struct.read_set** %4, i64 0
%6 = load %struct.read_set*, %struct.read_set** %5
%7 = call i32 @assert(%struct.read_set* %6)
%8 = load %struct.read_set**, %struct.read_set*** %2
%9 = getelementptr inbounds %struct.read_set*, %struct.read_set** %8, i64 0
%10 = load %struct.read_set*, %struct.read_set** %9
store %struct.read_set* %10, %struct.read_set** %3
%11 = load %struct.read_set**, %struct.read_set*** %2
%12 = getelementptr inbounds %struct.read_set*, %struct.read_set** %11, i64 1
%13 = load %struct.read_set*, %struct.read_set** %12
%14 = load %struct.read_set**, %struct.read_set*** %2
%15 = getelementptr inbounds %struct.read_set*, %struct.read_set** %14, i64 0
store %struct.read_set* %13, %struct.read_set** %15
%16 = load %struct.read_set**, %struct.read_set*** %2
%17 = getelementptr inbounds %struct.read_set*, %struct.read_set** %16, i64 1
store %struct.read_set* null, %struct.read_set** %17
%18 = load %struct.read_set*, %struct.read_set** %3
ret %struct.read_set* %18
}

LLVM IR (-O2):
%struct.read_set = type { i32 }
define %struct.read_set* @get_empty_set(%struct.read_set** nocapture %0) {
%2 = load %struct.read_set*, %struct.read_set** %0
%3 = tail call i32 @assert(%struct.read_set* %2)
%4 = load %struct.read_set*, %struct.read_set** %0
%5 = getelementptr inbounds %struct.read_set*, %struct.read_set** %0, i64 1
%6 = load %struct.read_set*, %struct.read_set** %5
store %struct.read_set* %6, %struct.read_set** %0
store %struct.read_set* null, %struct.read_set** %5
ret %struct.read_set* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *sqlite3_libversion();
int main(void) {
  printf("%s\n", sqlite3_libversion());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <sqlite3_libversion@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @sqlite3_libversion()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ memcmp(char *, char *, int);
int confirmmatch(char *file1, char *file2, int size1, int size2) {
  if (size1 != size2)
    return -1;
  if (memcmp(file1, file2, size1))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<confirmmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     113e <confirmmatch+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <confirmmatch+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
je     1164 <confirmmatch+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <confirmmatch+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confirmmatch>:
mov    $0xffffffff,%eax
cmp    %ecx,%edx
jne    1128 <confirmmatch+0x18>
push   %rax
call   1030 <memcmp@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @confirmmatch(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i64 @memcmp(i8* %0, i8* %1, i32 %2)
%8 = icmp ne i64 %7, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ -1, %4 ], [ %9, %6 ]
ret i32 %11
}
int test_imm_E6int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xE6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E6int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xe6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E6int64_highword_mem>:
testb  $0xe6,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E6int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 230
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_E6int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 987842478080
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void instructions() {
  printf("To insert a value: press 1\n"
         "To locate a value: press 2\n"
         "To delete a value: press 3\n"
         "To view: press 4\n"
         "To view verbosely: press 5\n"
         "To import a *.txt file: press 6\n"
         "To exit: press 7\n");
}


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

x86 assembly (clang, -O2):
<instructions>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [175 x i8] c"To insert a value: press 1\0ATo locate a value: press 2\0ATo delete a value: press 3\0ATo view: press 4\0ATo view verbosely: press 5\0ATo import a *.txt file: press 6\0ATo exit: press 7\0A\00"
define void @instructions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [174 x i8] c"To insert a value: press 1\0ATo locate a value: press 2\0ATo delete a value: press 3\0ATo view: press 4\0ATo view verbosely: press 5\0ATo import a *.txt file: press 6\0ATo exit: press 7\00"
define void @instructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([174 x i8], [174 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void sigalrm_handler(int sig) {
  write(1, "[TIMEOUT]\n", 10);
  _exit(0);
}


x86 assembly (clang, -O0):
<sigalrm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec9(%rip),%rsi
mov    $0xa,%edx
call   1040 <write@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sigalrm_handler>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0xa,%edx
call   1040 <write@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"[TIMEOUT]\0A\00"
define void @sigalrm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"[TIMEOUT]\0A\00"
define void @sigalrm_handler(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%3 = tail call i32 @_exit(i32 0)
unreachable
}
unsigned euclid(unsigned a, unsigned b) {
  if (0 == b) {
    return a;
  } else {
    return euclid(b, a % b);
  }
}


x86 assembly (clang, -O0):
<euclid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jne    1134 <euclid+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <euclid+0x39>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%esi
call   1030 <euclid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid>:
mov    %edi,%eax
test   %esi,%esi
je     111e <euclid+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <euclid+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @euclid(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* %5
%7 = icmp eq i32 0, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = urem i32 %12, %13
%15 = call i32 @euclid(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @euclid(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = urem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int EXIT_SUCCESS;
int divisorCount(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ triangular(int);
int main(int argc, char *argv[]) {
  int n = 0;
  while (divisorCount(triangular(n)) <= 500) {
    n++;
  }
  printf("Solution: %lld.\n", triangular(n));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <triangular@plt>
mov    %eax,%edi
call   1050 <divisorCount@plt>
cmp    $0x1f4,%eax
jg     1175 <main+0x45>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
mov    -0x14(%rbp),%edi
call   1040 <triangular@plt>
mov    %eax,%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <triangular@plt>
mov    %eax,%edi
call   1050 <divisorCount@plt>
cmp    $0x1f5,%eax
jl     1140 <main+0x10>
mov    %ebx,%edi
call   1040 <triangular@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Solution: %lld.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %6
%9 = call i32 @triangular(i32 %8)
%10 = call i32 @divisorCount(i32 %9)
%11 = icmp sle i32 %10, 500
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
br label %7
15: ; preds = %7
%16 = load i32, i32* %6
%17 = call i32 @triangular(i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}

LLVM IR (-O2):
@.str = [17 x i8] c"Solution: %lld.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %8, %3 ]
%5 = tail call i32 @triangular(i32 %4)
%6 = tail call i32 @divisorCount(i32 %5)
%7 = icmp slt i32 %6, 501
%8 = add nuw nsw i32 %4, 1
br i1 %7, label %3, label %9
9: ; preds = %3
%10 = tail call i32 @triangular(i32 %4)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}
/* Type definitions */
struct msdata {
  int dummy;
};

/* Variables and functions */
scalar_t__ allocate_object(int);
struct msdata *newmsdata() {
  struct msdata *msd;
  msd = (struct msdata *)allocate_object(88);
  return (msd);
}


x86 assembly (clang, -O0):
<newmsdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x58,%edi
call   1030 <allocate_object@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newmsdata>:
mov    $0x58,%edi
jmp    1030 <allocate_object@plt>

LLVM IR (-O0):
%struct.msdata = type { i32 }
define %struct.msdata* @newmsdata() {
%1 = alloca %struct.msdata*
%2 = call i64 @allocate_object(i32 88)
%3 = inttoptr i64 %2 to %struct.msdata*
store %struct.msdata* %3, %struct.msdata** %1
%4 = load %struct.msdata*, %struct.msdata** %1
ret %struct.msdata* %4
}

LLVM IR (-O2):
%struct.msdata = type { i32 }
define %struct.msdata* @newmsdata() {
%1 = tail call i64 @allocate_object(i32 88)
%2 = inttoptr i64 %1 to %struct.msdata*
ret %struct.msdata* %2
}
/* Variables and functions */
int comparef2(long const, long const);
int __nesf2(float a, float b) {
  return comparef2((*(const long *)&a), (*(const long *)&b));
}


x86 assembly (clang, -O0):
<__nesf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    -0x4(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <comparef2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__nesf2>:
movss  %xmm0,-0x8(%rsp)
movss  %xmm1,-0x10(%rsp)
mov    -0x8(%rsp),%rdi
mov    -0x10(%rsp),%rsi
jmp    1030 <comparef2@plt>

LLVM IR (-O0):
define i32 @__nesf2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = bitcast float* %3 to i64*
%6 = load i64, i64* %5
%7 = bitcast float* %4 to i64*
%8 = load i64, i64* %7
%9 = call i32 @comparef2(i64 %6, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @__nesf2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = bitcast float* %3 to i64*
%6 = load i64, i64* %5
%7 = bitcast float* %4 to i64*
%8 = load i64, i64* %7
%9 = tail call i32 @comparef2(i64 %6, i64 %8)
ret i32 %9
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ f(int);
int main(void) {
  int i, sum = 0;
  struct timespec req __attribute__((unused));
  req.tv_sec = 0;
  req.tv_nsec = 100 * 1000 * 1000;
  for (i = 0; i < 1000 * 1000 * 10; i++) {
    sum += f(i & 0xff);
  }
  return (sum == 0xdeadbeef ? 1 : 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x5f5e100,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    1172 <main+0x62>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <f@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <main+0x2c>
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0xdeadbeef,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movzbl %bpl,%edi
call   1030 <f@plt>
add    %eax,%ebx
add    $0x1,%ebp
cmp    $0x989680,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
cmp    $0xdeadbeef,%ebx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timespec
store i32 0, i32* %1
store i32 0, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 100000000, i32* %6
store i32 0, i32* %2
br label %7
7: ; preds = %18, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 10000000
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %2
%12 = and i32 %11, 255
%13 = call i64 @f(i32 %12)
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %10
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %7
21: ; preds = %7
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, -559038737
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 1, i32 0
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = and i32 %2, 255
%5 = tail call i64 @f(i32 %4)
%6 = trunc i64 %5 to i32
%7 = add i32 %3, %6
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 10000000
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = icmp eq i32 %7, -559038737
%12 = zext i1 %11 to i32
ret i32 %12
}
unsigned xrop3_244_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_244_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_244_0_0>:
shl    $0x8,%edi
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_244_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_244_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *s;
  printf("Enter an arbitrary string: ");
  scanf("%s", s);
  printf("String = [%s]\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xed4(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1040 <scanf@plt>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter an arbitrary string: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"String = [%s]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter an arbitrary string: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"String = [%s]\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* undef)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MdmHangup();
void k_hangup() { MdmHangup(); }


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

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

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

LLVM IR (-O2):
define void @k_hangup() {
%1 = tail call i32 (...) @MdmHangup()
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(char **s, char **t) { return strcmp(*s, *t); }


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare(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** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
void caller_1_2_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_1_2_1_1_2() {
ret void
}