xunge/DecIR huggingface dataset:
/* Variables and functions */
void *__asan_malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *__asan_calloc(size_t nmemb, size_t size) {
  size_t alloc_size = nmemb * size;
  void *ret = __asan_malloc(alloc_size);
  memset(ret, 0, alloc_size);
  return ret;
}


x86 assembly (clang, -O0):
<__asan_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <__asan_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__asan_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <__asan_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @__asan_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i8* @__asan_malloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i64, i64* %5
%14 = call i32 @memset(i8* %12, i32 0, i64 %13)
%15 = load i8*, i8** %6
ret i8* %15
}

LLVM IR (-O2):
define i8* @__asan_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @__asan_malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
void dummy_control(void *v, int a, int b, int c, int d) {}


x86 assembly (clang, -O0):
<dummy_control>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummy_control(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @dummy_control(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
void modplayer_code_lock_start(void) {}


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

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

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

LLVM IR (-O2):
define void @modplayer_code_lock_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void _error(char *msg) {
  perror(msg);
  exit(0);
}


x86 assembly (clang, -O0):
<_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_error>:
push   %rax
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int func_in_obj();
int main(int argc, char **argv) { return func_in_obj(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func_in_obj()
ret i32 %3
}
void GpibHwAdapter_release(struct GpibHwAdapter *ghwa) {}


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

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

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

LLVM IR (-O2):
%struct.GpibHwAdapter = type opaque
define void @GpibHwAdapter_release(%struct.GpibHwAdapter* nocapture %0) {
ret void
}
/* Variables and functions */
int identity(char);
char tor0(char x) {
  char y = (identity(x) | 0) ? 42 : 43;
  return y;
}


x86 assembly (clang, -O0):
<tor0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <identity@plt>
mov    %eax,%edx
or     $0x0,%edx
mov    $0x2b,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor0>:
push   %rax
call   1030 <identity@plt>
test   %eax,%eax
sete   %al
or     $0x2a,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @tor0(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @identity(i8 signext %4)
%6 = or i32 %5, 0
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 42, i32 43
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @tor0(i8 signext %0) {
%2 = tail call i32 @identity(i8 signext %0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8 43, i8 42
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x43() {
  Assert_real((isbdigit(67) == 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_isbdigit.c",
              340, ("isbdigit should be 0 for C"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x43>:
push   %rax
mov    $0x43,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x154,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for C\00"
define void @t_isbdigit_0x43() {
%1 = call i64 @isbdigit(i32 67)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for C\00"
define void @t_isbdigit_0x43() {
%1 = tail call i64 @isbdigit(i32 67)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_text_view_set_pixels_inside_wrap() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_to_montgomery(uintptr_t, uintptr_t);
void fiat_secp256k1_to_montgomery(uint32_t out1[8], const uint32_t arg1[8]) {
  internal_fiat_secp256k1_to_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_to_montgomery>:
jmp    1030 <internal_fiat_secp256k1_to_montgomery@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_to_montgomery(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_secp256k1_to_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_to_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_secp256k1_to_montgomery(i64 %3, i64 %4)
ret void
}
int precision(double value) {
  if (value < 100)
    return (2);
  else if (value < 100000)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<precision>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1128 <precision+0x28>
movl   $0x2,-0x4(%rbp)
jmp    1153 <precision+0x53>
movsd  0xed8(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1147 <precision+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1153 <precision+0x53>
jmp    114c <precision+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precision>:
movsd  0xef8(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
movsd  0xeef(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    $0x2,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @precision(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 1.000000e+02
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 2, i32* %2
br label %13
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 1.000000e+05
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %13
11: ; preds = %7
br label %12
12: ; preds = %11
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @precision(double %0) {
%2 = fcmp olt double %0, 1.000000e+02
%3 = fcmp olt double %0, 1.000000e+05
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 2, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func_message() { printf("Message is called.\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Message is called.\0A\00"
define void @func_message() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Message is called.\00"
define void @func_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XResizeRequestEvent;

/* Variables and functions */
void set_XResizeRequestEvent_send_event(void *_p, int _v) {
  ((XResizeRequestEvent *)_p)->send_event = (int)_v;
}


x86 assembly (clang, -O0):
<set_XResizeRequestEvent_send_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XResizeRequestEvent_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XResizeRequestEvent_send_event(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XResizeRequestEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
float filter_box(float x) {
  if (x < -0.5)
    return 0.0;
  if (x <= 0.5)
    return 1.0;
  return 0.0;
}


x86 assembly (clang, -O0):
<filter_box>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <filter_box+0x31>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1166 <filter_box+0x66>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     115e <filter_box+0x5e>
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1166 <filter_box+0x66>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_box>:
movaps %xmm0,%xmm1
cmpnless 0xef4(%rip),%xmm1
movss  0xef0(%rip),%xmm2
andnps %xmm2,%xmm1
cmpltss 0xee8(%rip),%xmm0
andnps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @filter_box(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, -5.000000e-01
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %14
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp ole double %10, 5.000000e-01
br i1 %11, label %12, label %13
12: ; preds = %8
store float 1.000000e+00, float* %2
br label %14
13: ; preds = %8
store float 0.000000e+00, float* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @filter_box(float %0) {
%2 = fcmp olt float %0, -5.000000e-01
%3 = fcmp ugt float %0, 5.000000e-01
%4 = or i1 %2, %3
%5 = select i1 %4, float 0.000000e+00, float 1.000000e+00
ret float %5
}
int samesignf(float lhs, float rhs) { return ((lhs >= 0.f) == (rhs >= 0.f)); }


x86 assembly (clang, -O0):
<samesignf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<samesignf>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
setb   %al
ucomiss %xmm2,%xmm1
setae  %cl
xor    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @samesignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fcmp oge float %5, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = load float, float* %4
%9 = fcmp oge float %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @samesignf(float %0, float %1) {
%3 = fcmp ult float %0, 0.000000e+00
%4 = fcmp oge float %1, 0.000000e+00
%5 = xor i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void gdk_notify_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_notify_type_get_type() {
ret void
}
int __ocl_any_short(short src) { return (src >> (16 - 1)) & 0x1; }


x86 assembly (clang, -O0):
<__ocl_any_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
sar    $0xf,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_any_short>:
movzwl %di,%eax
shr    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @__ocl_any_short(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = ashr i32 %4, 15
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @__ocl_any_short(i16 signext %0) {
%2 = lshr i16 %0, 15
%3 = zext i16 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_digit_char();
int /*<<< orphan*/ test_parse();
int /*<<< orphan*/ test_serialize();
int main(void) {
  test_parse();
  test_serialize();
  test_digit_char();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_parse@plt>
mov    $0x0,%al
call   1030 <test_serialize@plt>
mov    $0x0,%al
call   1040 <test_digit_char@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_parse@plt>
xor    %eax,%eax
call   1030 <test_serialize@plt>
xor    %eax,%eax
call   1040 <test_digit_char@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_parse()
%3 = call i32 (...) @test_serialize()
%4 = call i32 (...) @test_digit_char()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_parse()
%2 = tail call i32 (...) @test_serialize()
%3 = tail call i32 (...) @test_digit_char()
ret i32 0
}
void fn0000000000402CD0() { return; }


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

x86 assembly (clang, -O2):
ret

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

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


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

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

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

LLVM IR (-O2):
define void @avcodec_parameters_from_context() {
ret void
}
int atomic_cas_32(volatile unsigned long *ptr, unsigned long *_old,
                  unsigned long _new) {
  unsigned char res;
  __asm volatile("lock; cmpxchgq %2,%1 ;"
                 "		 sete	 %0 ;	 "
                 : "=a"(res), "+m"(*ptr)
                 : "r"(_new), "a"(*_old)
                 : "cc", "memory");
  return (res);
}


x86 assembly (clang, -O0):
<atomic_cas_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
lock cmpxchg %rdx,(%rcx)
sete   %al
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_cas_32>:
mov    (%rsi),%rax
lock cmpxchg %rdx,(%rdi)
sete   %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @atomic_cas_32(i64* %0, i64* %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i8
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
%8 = load i64*, i64** %4
%9 = load i64, i64* %6
%10 = load i64*, i64** %5
%11 = load i64, i64* %10
%12 = call i8 asm sideeffect "lock; cmpxchgq $2,$1 ;\09\09 sete\09 $0 ;\09 ", "={ax},=*m,r,{ax},*m,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %8, i64 %9, i64 %11, i64* elementtype(i64) %8)
store i8 %12, i8* %7
%13 = load i8, i8* %7
%14 = zext i8 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @atomic_cas_32(i64* %0, i64* nocapture %1, i64 %2) {
%4 = load i64, i64* %1
%5 = tail call i8 asm sideeffect "lock; cmpxchgq $2,$1 ;\09\09 sete\09 $0 ;\09 ", "={ax},=*m,r,{ax},*m,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %2, i64 %4, i64* elementtype(i64) %0)
%6 = zext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Database_close();
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void die(const char *message) {
  Database_close();
  if (errno) {
    perror(message);
  } else {
    printf("ERROR: %s\n", message);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <Database_close@plt>
mov    0x2e86(%rip),%rax
cmpq   $0x0,(%rax)
je     1172 <die+0x32>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    1182 <die+0x42>
mov    -0x8(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <Database_close@plt>
mov    0x2e8e(%rip),%rax
cmpq   $0x0,(%rax)
je     116a <die+0x2a>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die(i8* %0) {
%2 = tail call i32 (...) @Database_close()
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* %0)
br label %9
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %5
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t nextecmid(int32_t ecmid) {
  ecmid++;
  if (ecmid >= 4096)
    ecmid = 0;
  return ecmid;
}


x86 assembly (clang, -O0):
<nextecmid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1000,-0x4(%rbp)
jl     1124 <nextecmid+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextecmid>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0xfff,%edi
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @nextecmid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 4096
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @nextecmid(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = icmp sgt i32 %0, 4094
%4 = select i1 %3, i32 0, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ funa();
int main(int argc, char *argv[]) {
  funa();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <funa@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <funa@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @funa()
ret i32 0
}
/* Type definitions */
struct virtual_item {
  int dummy;
};

/* Variables and functions */
int indirect_check_left(struct virtual_item *, int, int /*<<< orphan*/,
                        int /*<<< orphan*/);
int indirect_check_right(struct virtual_item *vi, int free) {
  return indirect_check_left(vi, free, 0, 0);
}


x86 assembly (clang, -O0):
<indirect_check_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <indirect_check_left@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect_check_right>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <indirect_check_left@plt>

LLVM IR (-O0):
%struct.virtual_item = type { i32 }
define i32 @indirect_check_right(%struct.virtual_item* %0, i32 %1) {
%3 = alloca %struct.virtual_item*
%4 = alloca i32
store %struct.virtual_item* %0, %struct.virtual_item** %3
store i32 %1, i32* %4
%5 = load %struct.virtual_item*, %struct.virtual_item** %3
%6 = load i32, i32* %4
%7 = call i32 @indirect_check_left(%struct.virtual_item* %5, i32 %6, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.virtual_item = type { i32 }
define i32 @indirect_check_right(%struct.virtual_item* %0, i32 %1) {
%3 = tail call i32 @indirect_check_left(%struct.virtual_item* %0, i32 %1, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
unsigned char *xsalsa20poly1305_decrypt(unsigned char *, size_t *,
                                        unsigned char const *, size_t,
                                        unsigned char const *,
                                        unsigned char const *);
unsigned char *crypt_decrypt_xsalsa20poly1305(
    unsigned char *out, size_t *out_len, const unsigned char *in, size_t in_len,
    const unsigned char *nonce, const unsigned char *key) {
  return xsalsa20poly1305_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_xsalsa20poly1305>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <xsalsa20poly1305_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_xsalsa20poly1305>:
jmp    1030 <xsalsa20poly1305_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_xsalsa20poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @xsalsa20poly1305_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_xsalsa20poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @xsalsa20poly1305_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
void radix_sort() {}


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

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

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

LLVM IR (-O2):
define void @radix_sort() {
ret void
}
/* Variables and functions */
int kernel(int **);
int /*<<< orphan*/ reiniciarSudoku(int **);
void generarSudoku(int sudokuSolucion[9][9]) {
  int ok = 0;
  while (!ok) {
    reiniciarSudoku(sudokuSolucion);
    ok = kernel(sudokuSolucion);
  }
}


x86 assembly (clang, -O0):
<generarSudoku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1149 <generarSudoku+0x29>
jmp    1163 <generarSudoku+0x43>
mov    -0x8(%rbp),%rdi
call   1040 <reiniciarSudoku@plt>
mov    -0x8(%rbp),%rdi
call   1030 <kernel@plt>
mov    %eax,-0xc(%rbp)
jmp    1133 <generarSudoku+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generarSudoku>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <reiniciarSudoku@plt>
mov    %rbx,%rdi
call   1030 <kernel@plt>
test   %eax,%eax
je     1130 <generarSudoku+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @generarSudoku([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
store [9 x i32]* %0, [9 x i32]** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load [9 x i32]*, [9 x i32]** %2
%10 = bitcast [9 x i32]* %9 to i32**
%11 = call i32 @reiniciarSudoku(i32** %10)
%12 = load [9 x i32]*, [9 x i32]** %2
%13 = bitcast [9 x i32]* %12 to i32**
%14 = call i32 @kernel(i32** %13)
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @generarSudoku([9 x i32]* %0) {
%2 = bitcast [9 x i32]* %0 to i32**
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @reiniciarSudoku(i32** %2)
%5 = tail call i32 @kernel(i32** %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
ret void
}
double rgaunt(double x) { return (0.99 * x + 9.9e-3) * 1.00010001; }


x86 assembly (clang, -O0):
<rgaunt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeee(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgaunt>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @rgaunt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double 0x3FEFAE147AE147AE, double %3, double 9.900000e-03)
%5 = fmul double %4, 0x3FF00068DE3ADE4D
ret double %5
}

LLVM IR (-O2):
define double @rgaunt(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FEFAE147AE147AE, double 9.900000e-03)
%3 = fmul double %2, 0x3FF00068DE3ADE4D
ret double %3
}
int GetMidpoint(int min, int max) { return (min + ((max - min) / 2)); }


x86 assembly (clang, -O0):
<GetMidpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMidpoint>:
sub    %edi,%esi
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @GetMidpoint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = sdiv i32 %8, 2
%10 = add nsw i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @GetMidpoint(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int nlz(int /*<<< orphan*/);
size_t nibblew(uint64_t u) { return 16 - (nlz(u) >> 2) + !u; }


x86 assembly (clang, -O0):
<nibblew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <nlz@plt>
mov    %eax,%ecx
sar    $0x2,%ecx
mov    $0x10,%eax
sub    %ecx,%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibblew>:
push   %rbx
mov    %edi,%ebx
call   1030 <nlz@plt>
sar    $0x2,%eax
xor    %ecx,%ecx
test   %ebx,%ebx
sete   %cl
sub    %eax,%ecx
add    $0x10,%ecx
movslq %ecx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @nibblew(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @nlz(i32 %3)
%5 = ashr i32 %4, 2
%6 = sub nsw i32 16, %5
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = add nsw i32 %6, %10
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @nibblew(i32 %0) {
%2 = tail call i32 @nlz(i32 %0)
%3 = ashr i32 %2, 2
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 17, i32 16
%6 = sub nsw i32 %5, %3
%7 = sext i32 %6 to i64
ret i64 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long requestor;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
void set_XSelectionEvent_requestor(void *_p, unsigned long _v) {
  ((XSelectionEvent *)_p)->requestor = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XSelectionEvent_requestor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XSelectionEvent_requestor>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSelectionEvent_requestor(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSelectionEvent_requestor(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(
      stderr,
      "Usege: enigma [-k key_file] [-i initial_values] input_file output_file\n"
      "\t-k\t--key key_file\t specify the key file used\n"
      "\t\t\t\tif no key_file named used default key file("
      "$HOME/"
      ".engkey"
      ")\n"
      "\t-i\t--init initial_values\t specify the initial values for roters\n"
      "\t\t\t\t in form %%d;%%d;%%d (e.g. 2;132;17)\n"
      "\t-u\t--usage\t print this usage message\n"
      "\tif a single hyphen-minus (-) is given as a file) stdout(stdin) is "
      "used\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [396 x i8] c"Usege: enigma [-k key_file] [-i initial_values] input_file output_file\0A\09-k\09--key key_file\09 specify the key file used\0A\09\09\09\09if no key_file named used default key file($HOME/.engkey)\0A\09-i\09--init initial_values\09 specify the initial values for roters\0A\09\09\09\09 in form %%d;%%d;%%d (e.g. 2;132;17)\0A\09-u\09--usage\09 print this usage message\0A\09if a single hyphen-minus (-) is given as a file) stdout(stdin) is used\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([396 x i8], [396 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [396 x i8] c"Usege: enigma [-k key_file] [-i initial_values] input_file output_file\0A\09-k\09--key key_file\09 specify the key file used\0A\09\09\09\09if no key_file named used default key file($HOME/.engkey)\0A\09-i\09--init initial_values\09 specify the initial values for roters\0A\09\09\09\09 in form %%d;%%d;%%d (e.g. 2;132;17)\0A\09-u\09--usage\09 print this usage message\0A\09if a single hyphen-minus (-) is given as a file) stdout(stdin) is used\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([396 x i8], [396 x i8]* @.str, i64 0, i64 0))
ret void
}
float Float_neg(float x) { return -x; }


x86 assembly (clang, -O0):
<Float_neg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float_neg>:
xorps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @Float_neg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
ret float %4
}

LLVM IR (-O2):
define float @Float_neg(float %0) {
%2 = fneg float %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ reset_ball();
int /*<<< orphan*/ reset_bricks();
int /*<<< orphan*/ update_screen();
void setup() {
  reset_ball();
  reset_bricks();
  update_screen();
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <reset_ball@plt>
mov    $0x0,%al
call   1030 <reset_bricks@plt>
mov    $0x0,%al
call   1040 <update_screen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
xor    %eax,%eax
call   1050 <reset_ball@plt>
xor    %eax,%eax
call   1030 <reset_bricks@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <update_screen@plt>

LLVM IR (-O0):
define void @setup() {
%1 = call i32 (...) @reset_ball()
%2 = call i32 (...) @reset_bricks()
%3 = call i32 (...) @update_screen()
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 (...) @reset_ball()
%2 = tail call i32 (...) @reset_bricks()
%3 = tail call i32 (...) @update_screen()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_OPEN_MAX;
int /*<<< orphan*/ close(long);
long sysconf(int /*<<< orphan*/);
int closefrom_sysconf(int lower) {
  long max_files, fd;
  max_files = sysconf(_SC_OPEN_MAX);
  if (max_files == -1) {
    max_files = 65536;
  }
  for (fd = lower; fd < max_files; fd++) {
    close(fd);
  }
  return 0;
}


x86 assembly (clang, -O0):
<closefrom_sysconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1150 <closefrom_sysconf+0x30>
movq   $0x10000,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1180 <closefrom_sysconf+0x60>
mov    -0x18(%rbp),%rdi
call   1030 <close@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1158 <closefrom_sysconf+0x38>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closefrom_sysconf>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
cmp    $0xffffffffffffffff,%rax
mov    $0x10000,%r14d
cmovne %rax,%r14
movslq %ebx,%rbx
cmp    %rbx,%r14
jle    1161 <closefrom_sysconf+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <close@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1150 <closefrom_sysconf+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@_SC_OPEN_MAX = global i32 0
define i32 @closefrom_sysconf(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* @_SC_OPEN_MAX
%6 = call i64 @sysconf(i32 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = icmp eq i64 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i64 65536, i64* %3
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
store i64 %12, i64* %4
br label %13
13: ; preds = %20, %10
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = icmp slt i64 %14, %15
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i64, i64* %4
%19 = call i32 @close(i64 %18)
br label %20
20: ; preds = %17
%21 = load i64, i64* %4
%22 = add nsw i64 %21, 1
store i64 %22, i64* %4
br label %13
23: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@_SC_OPEN_MAX = global i32 0
define i32 @closefrom_sysconf(i32 %0) {
%2 = load i32, i32* @_SC_OPEN_MAX
%3 = tail call i64 @sysconf(i32 %2)
%4 = icmp eq i64 %3, -1
%5 = select i1 %4, i64 65536, i64 %3
%6 = sext i32 %0 to i64
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %1, %8
%9 = phi i64 [ %11, %8 ], [ %6, %1 ]
%10 = tail call i32 @close(i64 %9)
%11 = add i64 %9, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %8
13: ; preds = %8, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kill_this_task();
void disarm(void) { kill_this_task(); }


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

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

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

LLVM IR (-O2):
define void @disarm() {
%1 = tail call i32 (...) @kill_this_task()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x44() {
  Assert_real((ispunct(68) == 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_ispunct.c",
              345, ("ispunct should be 0 for D"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x44>:
push   %rax
mov    $0x44,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x159,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for D\00"
define void @t_ispunct_0x44() {
%1 = call i64 @ispunct(i32 68)
%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 345, i8* getelementptr inbounds ([26 x i8], [26 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for D\00"
define void @t_ispunct_0x44() {
%1 = tail call i64 @ispunct(i32 68)
%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 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo_1_1_2_2_2_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_2_2_1_1_1() {
ret void
}
/* Variables and functions */
int arr_sum(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a[] = {3, 2, 7, 6, 8};
  printf("%d\n", arr_sum(a, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <arr_sum@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <arr_sum@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 3, i32 2, i32 7, i32 6, i32 8]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @arr_sum(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void pinLow(int pin) { ; }


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

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

LLVM IR (-O0):
define void @pinLow(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @pinLow(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void clrscr() {
  fprintf(stdout, "\033[2J");
  fprintf(stdout, "\033[1;1H");
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[1;1H\00"
define void @clrscr() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[1;1H\00"
define void @clrscr() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int write(int, void *, int);
int rd_write_file(int fd, void *ptr, int len) { return write(fd, ptr, len); }


x86 assembly (clang, -O0):
<rd_write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_write_file>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @rd_write_file(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}