xunge/DecIR huggingface dataset:
void bigN_add(char *a, int k) {
  int i = 0;
  while (k > 0) {
    a[i++] += k % 10;
    k /= 10;
  }
}


x86 assembly (clang, -O0):
<bigN_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1157 <bigN_add+0x57>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
add    %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1112 <bigN_add+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigN_add>:
test   %esi,%esi
jle    1131 <bigN_add+0x31>
mov    $0xcccccccd,%r8d
nopw   0x0(%rax,%rax,1)
mov    %esi,%ecx
imul   %r8,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %esi,%eax
sub    %edx,%eax
add    %al,(%rdi)
add    $0x1,%rdi
cmp    $0x9,%esi
mov    %ecx,%esi
ja     1110 <bigN_add+0x10>
ret

LLVM IR (-O0):
define void @bigN_add(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %4
%11 = srem i32 %10, 10
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = add nsw i32 %18, %11
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
%21 = load i32, i32* %4
%22 = sdiv i32 %21, 10
store i32 %22, i32* %4
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @bigN_add(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = urem i32 %6, 10
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %5
%10 = load i8, i8* %9
%11 = trunc i32 %7 to i8
%12 = add i8 %10, %11
store i8 %12, i8* %9
%13 = udiv i32 %6, 10
%14 = icmp ult i32 %6, 10
br i1 %14, label %15, label %4
15: ; preds = %4, %2
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int raio;
  scanf("%d", &raio);
  printf("VOLUME = %.3f\n", 4.0 / 3 * 3.14159 * raio * raio * raio);
  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)
lea    0xecb(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xead(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm1
movsd  0xec0(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"VOLUME = %.3f\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
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = sitofp i32 %8 to double
%10 = fmul double 0x4010C1514ABD0449, %9
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = fmul double %10, %12
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fmul double %13, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"VOLUME = %.3f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 0x4010C1514ABD0449
%9 = fmul double %8, %7
%10 = fmul double %9, %7
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_RENDER;
int /*<<< orphan*/ drawSquares(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  drawSquares(GL_RENDER);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <drawSquares@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <drawSquares@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_RENDER = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = load i32, i32* @GL_RENDER
%4 = call i32 @drawSquares(i32 %3)
%5 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_RENDER = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = load i32, i32* @GL_RENDER
%4 = tail call i32 @drawSquares(i32 %3)
%5 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_loopbreak();
void termination_handler(int signum) { event_loopbreak(); }


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

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

LLVM IR (-O0):
define void @termination_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @event_loopbreak()
ret void
}

LLVM IR (-O2):
define void @termination_handler(i32 %0) {
%2 = tail call i32 (...) @event_loopbreak()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RST(int);
void RST30() { RST(0x30); }


x86 assembly (clang, -O0):
<RST30>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
call   1030 <RST@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RST30>:
mov    $0x30,%edi
jmp    1030 <RST@plt>

LLVM IR (-O0):
define void @RST30() {
%1 = call i32 @RST(i32 48)
ret void
}

LLVM IR (-O2):
define void @RST30() {
%1 = tail call i32 @RST(i32 48)
ret void
}
/* Type definitions */
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_SUCCESS;
enum nss_status _nss_noenum_setpwent(void) { return NSS_STATUS_SUCCESS; }


x86 assembly (clang, -O0):
<_nss_noenum_setpwent>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_noenum_setpwent>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_noenum_setpwent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}

LLVM IR (-O2):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_noenum_setpwent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, unsigned int);
void testCase(double value, unsigned int expected) {
  unsigned int result = (unsigned int)value;
  if (result != expected) {
    printf("%d\n", result);
    abort();
  }
}


x86 assembly (clang, -O0):
<testCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     115b <testCase+0x3b>
mov    -0x10(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCase>:
cvttsd2si %xmm0,%rsi
cmp    %edi,%esi
jne    112a <testCase+0xa>
ret
push   %rax
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @testCase(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%6 = load double, double* %3
%7 = fptoui double %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @testCase(double %0, i32 %1) {
%3 = fptoui double %0 to i32
%4 = icmp eq i32 %3, %1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_parent(char *, int, char **);
int main(int argc, char *argv[]) { setup_parent("mmap", argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
call   1030 <setup_parent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"mmap\00"
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* %3
%6 = load i8**, i8*** %4
%7 = call i32 @setup_parent(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5, i8** %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"mmap\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setup_parent(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int ObjectSize0(void *const);
int IndirectObjectSize0(void *const p __attribute__((pass_object_size(0)))) {
  return ObjectSize0(p);
}


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

x86 assembly (clang, -O2):
<IndirectObjectSize0>:
jmp    1030 <ObjectSize0@plt>

LLVM IR (-O0):
define i32 @IndirectObjectSize0(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @ObjectSize0(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @IndirectObjectSize0(i8* %0, i64 %1) {
%3 = tail call i32 @ObjectSize0(i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x04() {
  Assert_real((isupper(4) == 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_isupper.c",
              25, ("isupper should be 0 for 0x04"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x04>:
push   %rax
mov    $0x4,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x19,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x04\00"
define void @t_isupper_0x04() {
%1 = call i64 @isupper(i32 4)
%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 25, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x04\00"
define void @t_isupper_0x04() {
%1 = tail call i64 @isupper(i32 4)
%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 25, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct wl_touch {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_touch, user_data);
}


x86 assembly (clang, -O0):
<wl_touch_set_user_data>:
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   1030 <wl_proxy_set_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_touch_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.wl_touch = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_touch_set_user_data(%struct.wl_touch* %0, i8* %1) {
%3 = alloca %struct.wl_touch*
%4 = alloca i8*
store %struct.wl_touch* %0, %struct.wl_touch** %3
store i8* %1, i8** %4
%5 = load %struct.wl_touch*, %struct.wl_touch** %3
%6 = bitcast %struct.wl_touch* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_touch = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_touch_set_user_data(%struct.wl_touch* %0, i8* %1) {
%3 = bitcast %struct.wl_touch* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
/* Variables and functions */
int charncmp(char *s1, char s2, size_t n) {
  do {
    if (*s1++ != s2)
      return 1;
  } while (--n > 0);
  return 0;
}


x86 assembly (clang, -O0):
<charncmp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     113c <charncmp+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115e <charncmp+0x5e>
jmp    1141 <charncmp+0x41>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
ja     1112 <charncmp+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charncmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %sil,(%rdi,%rax,1)
jne    1122 <charncmp+0x22>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <charncmp+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @charncmp(i8* nocapture %0, i8 signext %1, i64 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %10, %9 ]
%6 = phi i64 [ %2, %3 ], [ %11, %9 ]
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, %1
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = add i64 %6, -1
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %9, %4
%14 = phi i32 [ 1, %4 ], [ 0, %9 ]
ret i32 %14
}
/* Type definitions */
struct ibv_pd {
  int dummy;
};
struct ibv_context {
  int dummy;
};

/* Variables and functions */
struct ibv_pd *_alloc_pd(struct ibv_context *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
struct ibv_pd *ibv_alloc_pd(struct ibv_context *context) {
  dmtcp_plugin_disable_ckpt();
  struct ibv_pd *user_copy = _alloc_pd(context);
  dmtcp_plugin_enable_ckpt();
  return user_copy;
}


x86 assembly (clang, -O0):
<ibv_alloc_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_alloc_pd@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_alloc_pd>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
call   1030 <_alloc_pd@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ibv_pd = type { i32 }
%struct.ibv_context = type { i32 }
define %struct.ibv_pd* @ibv_alloc_pd(%struct.ibv_context* %0) {
%2 = alloca %struct.ibv_context*
%3 = alloca %struct.ibv_pd*
store %struct.ibv_context* %0, %struct.ibv_context** %2
%4 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%5 = load %struct.ibv_context*, %struct.ibv_context** %2
%6 = call %struct.ibv_pd* @_alloc_pd(%struct.ibv_context* %5)
store %struct.ibv_pd* %6, %struct.ibv_pd** %3
%7 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%8 = load %struct.ibv_pd*, %struct.ibv_pd** %3
ret %struct.ibv_pd* %8
}

LLVM IR (-O2):
%struct.ibv_pd = type { i32 }
%struct.ibv_context = type { i32 }
define %struct.ibv_pd* @ibv_alloc_pd(%struct.ibv_context* %0) {
%2 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%3 = tail call %struct.ibv_pd* @_alloc_pd(%struct.ibv_context* %0)
%4 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret %struct.ibv_pd* %3
}
int _kill(int pid, int sig) { return -1; }


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_kill(i32 %0, i32 %1) {
ret i32 -1
}
int portaudio_get_total_len(struct audiotap *audiotap) { return -1; }


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

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

LLVM IR (-O0):
%struct.audiotap = type opaque
define i32 @portaudio_get_total_len(%struct.audiotap* %0) {
%2 = alloca %struct.audiotap*
store %struct.audiotap* %0, %struct.audiotap** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.audiotap = type opaque
define i32 @portaudio_get_total_len(%struct.audiotap* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
struct cheat_test_suite {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cheat_test_assert(struct cheat_test_suite *, int, char *,
                                     char *, int);
void test_maths_still_work(struct cheat_test_suite *suite) {
  cheat_test_assert(
      suite, 4 == 2 + 2, "4 == 2+2",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/Tordek/cheat/refs/heads/master/sampletest.c",
      27);
}


x86 assembly (clang, -O0):
<test_maths_still_work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    0xed4(%rip),%rdx
lea    0xed6(%rip),%rcx
mov    $0x1b,%r8d
call   1030 <cheat_test_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_maths_still_work>:
lea    0xee9(%rip),%rdx
lea    0xeeb(%rip),%rcx
mov    $0x1,%esi
mov    $0x1b,%r8d
jmp    1030 <cheat_test_assert@plt>

LLVM IR (-O0):
%struct.cheat_test_suite = type { i32 }
@.str = [9 x i8] c"4 == 2+2\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tordek/cheat/refs/heads/master/sampletest.c\00"
define void @test_maths_still_work(%struct.cheat_test_suite* %0) {
%2 = alloca %struct.cheat_test_suite*
store %struct.cheat_test_suite* %0, %struct.cheat_test_suite** %2
%3 = load %struct.cheat_test_suite*, %struct.cheat_test_suite** %2
%4 = call i32 @cheat_test_assert(%struct.cheat_test_suite* %3, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 27)
ret void
}

LLVM IR (-O2):
%struct.cheat_test_suite = type { i32 }
@.str = [9 x i8] c"4 == 2+2\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tordek/cheat/refs/heads/master/sampletest.c\00"
define void @test_maths_still_work(%struct.cheat_test_suite* %0) {
%2 = tail call i32 @cheat_test_assert(%struct.cheat_test_suite* %0, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 27)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int childFunc(void *arg) {
  char **argv = arg;
  execvp(argv[0], &argv[0]);
  do {
    perror("execvp");
    exit(EXIT_FAILURE);
  } while (0);
}


x86 assembly (clang, -O0):
<childFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <execvp@plt>
lea    0xea5(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<childFunc>:
push   %rax
mov    %rdi,%rsi
mov    (%rdi),%rdi
call   1040 <execvp@plt>
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"execvp\00"
@EXIT_FAILURE = global i32 0
define i32 @childFunc(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
store i8** %6, i8*** %4
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = call i32 @execvp(i8* %9, i8** %11)
br label %13
13: ; preds = %1
%14 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; No predecessors!
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [7 x i8] c"execvp\00"
@EXIT_FAILURE = global i32 0
define i32 @childFunc(i8* %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @execvp(i8* %3, i8** %2)
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
int max1363_update_scan_mode(struct iio_dev *indio_dev, const long *scan_mask) {
  return 0;
}


x86 assembly (clang, -O0):
<max1363_update_scan_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @max1363_update_scan_mode(%struct.iio_dev* %0, i64* %1) {
%3 = alloca %struct.iio_dev*
%4 = alloca i64*
store %struct.iio_dev* %0, %struct.iio_dev** %3
store i64* %1, i64** %4
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @max1363_update_scan_mode(%struct.iio_dev* nocapture readnone %0, i64* nocapture readnone %1) {
ret i32 0
}
void OCSP_BASICRESP_new(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_BASICRESP_new() {
ret void
}
int dobra(int x) { return x = x * x; }


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

x86 assembly (clang, -O2):
<dobra>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @dobra(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void usage() {
  fputs("ut2lt -h\n"
        "\n"
        "   -h print this help\n",
        stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"ut2lt -h\0A\0A -h print this help\0A\00"
@stdout = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"ut2lt -h\0A\0A -h print this help\0A\00"
@stdout = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double atof(char *);
scalar_t__ getlin(char *, int);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  char line[1000];
  double sum = 0;
  while (getlin(line, 1000) > 0)
    printf("\t%g\n", sum += atof(line));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x3f8(%rbp)
ff
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getlin@plt>
cmp    $0x0,%rax
jle    1195 <main+0x65>
lea    -0x3f0(%rbp),%rdi
call   1030 <atof@plt>
addsd  -0x3f8(%rbp),%xmm0
ff
movsd  %xmm0,-0x3f8(%rbp)
ff
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3f8,%rsp
lea    0x10(%rsp),%rdi
mov    $0x3e8,%esi
call   1050 <getlin@plt>
test   %rax,%rax
jle    11a6 <main+0x76>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0xe9c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
mov    %r14,%rdi
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getlin@plt>
test   %rax,%rax
jg     1170 <main+0x40>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\09%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %3
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i64 @getlin(i8* %5, i32 1000)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%10 = call double @atof(i8* %9)
%11 = load double, double* %3
%12 = fadd double %11, %10
store double %12, double* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %12)
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\09%g\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i64 @getlin(i8* %2, i32 1000)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0, %5
%6 = phi double [ %8, %5 ], [ 0.000000e+00, %0 ]
%7 = call double @atof(i8* %2)
%8 = fadd double %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %8)
%10 = call i64 @getlin(i8* %2, i32 1000)
%11 = icmp sgt i64 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ r_core_syscmd_mkdir(char const *);
int cmd_mkdir(void *data, const char *input) {
  r_core_syscmd_mkdir(input);
  return 0;
}


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

x86 assembly (clang, -O2):
<cmd_mkdir>:
push   %rax
mov    %rsi,%rdi
call   1030 <r_core_syscmd_mkdir@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmd_mkdir(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @r_core_syscmd_mkdir(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_mkdir(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @r_core_syscmd_mkdir(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ htobe64(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void pack_to_be64(void *v, uint64_t u) {
  u = htobe64(u);
  memcpy(v, &u, sizeof(uint64_t));
}


x86 assembly (clang, -O0):
<pack_to_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <htobe64@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_to_be64>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <htobe64@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @pack_to_be64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htobe64(i32 %5)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i8* %7, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @pack_to_be64(i8* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htobe64(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MessageBoxA(int, char *, char *, int);
void ShowMsg(char *s) {
  MessageBoxA(0x0, s, "Msg", 0x0);
  return;
}


x86 assembly (clang, -O0):
<ShowMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %ecx,%ecx
lea    0xed7(%rip),%rdx
mov    %ecx,%edi
call   1030 <MessageBoxA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowMsg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdx
xor    %edi,%edi
xor    %ecx,%ecx
jmp    1030 <MessageBoxA@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"Msg\00"
define void @ShowMsg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @MessageBoxA(i32 0, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"Msg\00"
define void @ShowMsg(i8* %0) {
%2 = tail call i32 @MessageBoxA(i32 0, i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
int key(int string) {
  if (string == 'y' || string == 'u' || string == 'i' || string == 'o' ||
      string == 'p' || string == 'h' || string == 'j' || string == 'k' ||
      string == 'l' || string == 'n' || string == 'm') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x79,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x75,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x69,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x6f,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x70,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x68,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x6a,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x6b,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x6c,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x6e,-0x8(%rbp)
je     1175 <key+0x75>
cmpl   $0x6d,-0x8(%rbp)
jne    1181 <key+0x81>
movl   $0x1,-0x4(%rbp)
jmp    1188 <key+0x88>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
add    $0xffffff98,%edi
xor    %eax,%eax
cmp    $0x11,%edi
ja     1117 <key+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @key(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 121
br i1 %5, label %36, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 117
br i1 %8, label %36, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 105
br i1 %11, label %36, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 111
br i1 %14, label %36, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 112
br i1 %17, label %36, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 104
br i1 %20, label %36, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 106
br i1 %23, label %36, label %24
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 107
br i1 %26, label %36, label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 108
br i1 %29, label %36, label %30
30: ; preds = %27
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 110
br i1 %32, label %36, label %33
33: ; preds = %30
%34 = load i32, i32* %3
%35 = icmp eq i32 %34, 109
br i1 %35, label %36, label %37
36: ; preds = %33, %30, %27, %24, %21, %18, %15, %12, %9, %6, %1
store i32 1, i32* %2
br label %38
37: ; preds = %33
store i32 0, i32* %2
br label %38
38: ; preds = %37, %36
%39 = load i32, i32* %2
ret i32 %39
}

LLVM IR (-O2):
@switch.table.key = [18 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 1]
define i32 @key(i32 %0) {
%2 = add i32 %0, -104
%3 = icmp ult i32 %2, 18
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [18 x i32], [18 x i32]* @switch.table.key, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int FUTEX_PRIVATE_FLAG;
int FUTEX_WAKE;
int /*<<< orphan*/ futex(int *, int, int, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *, int /*<<< orphan*/);
void muggle_futex_wake_one(int *futex_addr) {
  futex(futex_addr, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<muggle_futex_wake_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
mov    $0x1,%edx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <futex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<muggle_futex_wake_one>:
mov    0x2eb9(%rip),%rax
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <futex@plt>

LLVM IR (-O0):
@FUTEX_WAKE = global i32 0
@FUTEX_PRIVATE_FLAG = global i32 0
define void @muggle_futex_wake_one(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @FUTEX_WAKE
%5 = load i32, i32* @FUTEX_PRIVATE_FLAG
%6 = or i32 %4, %5
%7 = call i32 @futex(i32* %3, i32 %6, i32 1, i32* null, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
@FUTEX_WAKE = global i32 0
@FUTEX_PRIVATE_FLAG = global i32 0
define void @muggle_futex_wake_one(i32* %0) {
%2 = load i32, i32* @FUTEX_WAKE
%3 = load i32, i32* @FUTEX_PRIVATE_FLAG
%4 = or i32 %3, %2
%5 = tail call i32 @futex(i32* %0, i32 %4, i32 1, i32* null, i32* null, i32 0)
ret void
}
/* Variables and functions */
short prussdrv_get_channel_to_host_map(short);
short prussdrv_get_event_to_channel_map(unsigned int);
short prussdrv_get_event_to_host_map(unsigned int eventnum) {
  short ans = prussdrv_get_event_to_channel_map(eventnum);
  if (ans < 0)
    return ans;
  return prussdrv_get_channel_to_host_map(ans);
}


x86 assembly (clang, -O0):
<prussdrv_get_event_to_host_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <prussdrv_get_event_to_channel_map@plt>
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
cmp    $0x0,%eax
jge    1151 <prussdrv_get_event_to_host_map+0x31>
mov    -0xa(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115e <prussdrv_get_event_to_host_map+0x3e>
movswl -0xa(%rbp),%edi
call   1040 <prussdrv_get_channel_to_host_map@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prussdrv_get_event_to_host_map>:
push   %rax
call   1030 <prussdrv_get_event_to_channel_map@plt>
test   %ax,%ax
js     1134 <prussdrv_get_event_to_host_map+0x14>
movswl %ax,%edi
pop    %rax
jmp    1040 <prussdrv_get_channel_to_host_map@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @prussdrv_get_event_to_host_map(i32 %0) {
%2 = alloca i16
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call signext i16 @prussdrv_get_event_to_channel_map(i32 %5)
store i16 %6, i16* %4
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i16, i16* %4
store i16 %11, i16* %2
br label %15
12: ; preds = %1
%13 = load i16, i16* %4
%14 = call signext i16 @prussdrv_get_channel_to_host_map(i16 signext %13)
store i16 %14, i16* %2
br label %15
15: ; preds = %12, %10
%16 = load i16, i16* %2
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @prussdrv_get_event_to_host_map(i32 %0) {
%2 = tail call signext i16 @prussdrv_get_event_to_channel_map(i32 %0)
%3 = icmp slt i16 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call signext i16 @prussdrv_get_channel_to_host_map(i16 signext %2)
br label %6
6: ; preds = %1, %4
%7 = phi i16 [ %5, %4 ], [ %2, %1 ]
ret i16 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(void const *, size_t, int, int /*<<< orphan*/ *);
void elf_write(void *user, uint32_t addr, const void *buf, size_t count) {
  FILE *f = user;
  fseek(f, addr, SEEK_SET);
  fwrite(buf, count, 1, f);
}


x86 assembly (clang, -O0):
<elf_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_write>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @elf_write(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = load i32, i32* %6
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i32 %13, i32 %14)
%16 = load i8*, i8** %7
%17 = load i64, i64* %8
%18 = load i32*, i32** %9
%19 = call i32 @fwrite(i8* %16, i64 %17, i32 1, i32* %18)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @elf_write(i8* nocapture %0, i32 %1, i8* nocapture %2, i64 %3) {
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %5, i32 %1, i32 %6)
%8 = tail call i32 @fwrite(i8* %2, i64 %3, i32 1, i32* %5)
ret void
}
int tls13_client_hello_retry_send(struct tls13_ctx *ctx) { return 1; }


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

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

LLVM IR (-O0):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_hello_retry_send(%struct.tls13_ctx* %0) {
%2 = alloca %struct.tls13_ctx*
store %struct.tls13_ctx* %0, %struct.tls13_ctx** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_hello_retry_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
void netgear_readynas_init(void) {}


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

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

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

LLVM IR (-O2):
define void @netgear_readynas_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int ungetc(int, int /*<<< orphan*/ *);
void crash_ungetc() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  int i = ungetc(10, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_ungetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1040 <ungetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_ungetc>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    $0xa,%edi
mov    %rax,%rsi
call   1040 <ungetc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_ungetc() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @ungetc(i32 10, i32* %4)
store i32 %5, i32* %2
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_ungetc() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @ungetc(i32 10, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mpga_set_sampling_freq(uint8_t *p_mpga, uint8_t i_freq) {
  p_mpga[2] &= ~0x0c;
  p_mpga[2] |= (i_freq & 0x3) << 2;
}


x86 assembly (clang, -O0):
<mpga_set_sampling_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
and    $0xfffffff3,%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x2,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_set_sampling_freq>:
mov    0x8(%rdi),%eax
and    $0xfffffff3,%eax
and    $0x3,%esi
lea    (%rax,%rsi,4),%eax
mov    %eax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @mpga_set_sampling_freq(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 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = and i32 %7, -13
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 3
%11 = shl i32 %10, 2
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @mpga_set_sampling_freq(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = load i32, i32* %3
%5 = and i32 %4, -13
%6 = shl i32 %1, 2
%7 = and i32 %6, 12
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}