xunge/DecIR huggingface dataset:
float yPos(int idx, int nx, float y0, float dy, int numFeatures) {
  return y0 + dy * (0.5 + (idx / (nx * numFeatures)));
}


x86 assembly (clang, -O0):
<yPos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm3
movsd  0xebe(%rip),%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<yPos>:
mov    %edi,%eax
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
imul   %edx,%esi
cltd
idiv   %esi
cvtsi2sd %eax,%xmm2
addsd  0xee4(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @yPos(i32 %0, i32 %1, float %2, float %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store float %2, float* %8
store float %3, float* %9
store i32 %4, i32* %10
%11 = load float, float* %8
%12 = fpext float %11 to double
%13 = load float, float* %9
%14 = fpext float %13 to double
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %10
%18 = mul nsw i32 %16, %17
%19 = sdiv i32 %15, %18
%20 = sitofp i32 %19 to double
%21 = fadd double 5.000000e-01, %20
%22 = call double @llvm.fmuladd.f64(double %14, double %21, double %12)
%23 = fptrunc double %22 to float
ret float %23
}

LLVM IR (-O2):
define float @yPos(i32 %0, i32 %1, float %2, float %3, i32 %4) {
%6 = fpext float %2 to double
%7 = fpext float %3 to double
%8 = mul nsw i32 %4, %1
%9 = sdiv i32 %0, %8
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 5.000000e-01
%12 = tail call double @llvm.fmuladd.f64(double %7, double %11, double %6)
%13 = fptrunc double %12 to float
ret float %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32r14(uint32_t x) { return (x >> 14) | (x << 18); }


x86 assembly (clang, -O0):
<rot32r14>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xe,%eax
mov    -0x4(%rbp),%ecx
shl    $0x12,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32r14>:
mov    %edi,%eax
sar    $0xe,%eax
shl    $0x12,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32r14(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 14
%5 = load i32, i32* %2
%6 = shl i32 %5, 18
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32r14(i32 %0) {
%2 = ashr i32 %0, 14
%3 = shl i32 %0, 18
%4 = or i32 %2, %3
ret i32 %4
}
int shrfunc1(int x) { return x * 10; }


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

x86 assembly (clang, -O2):
<shrfunc1>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @shrfunc1(i32 %0) {
%2 = mul nsw i32 %0, 10
ret i32 %2
}
__attribute__((noipa)) unsigned long f1(unsigned long a, unsigned long b) {
  unsigned long i = __builtin_add_overflow(a, b, &a);
  return a + i;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
add    -0x10(%rbp),%rcx
setb   %al
mov    %rcx,-0x8(%rbp)
and    $0x1,%al
movzbl %al,%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %rdi,%rax
add    %rsi,%rax
adc    $0x0,%rax
ret

LLVM IR (-O0):
define i64 @f1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %6, i64 %7)
%9 = extractvalue { i64, i1 } %8, 1
%10 = extractvalue { i64, i1 } %8, 0
store i64 %10, i64* %3
%11 = zext i1 %9 to i64
store i64 %11, i64* %5
%12 = load i64, i64* %3
%13 = load i64, i64* %5
%14 = add i64 %12, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @f1(i64 %0, i64 %1) {
%3 = tail call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %0, i64 %1)
%4 = extractvalue { i64, i1 } %3, 1
%5 = extractvalue { i64, i1 } %3, 0
%6 = zext i1 %4 to i64
%7 = add i64 %5, %6
ret i64 %7
}
void cellgen_dma_start() {}


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

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

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

LLVM IR (-O2):
define void @cellgen_dma_start() {
ret void
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
void integer_overflow_by_subtraction_Bad() {
  char arr[10];
  int32_t x = -2000000000;
  int32_t y = 2000000000;
  int32_t z = x - y;
  if (z >= 0) {
    arr[z] = 0;
  }
}


x86 assembly (clang, -O0):
<integer_overflow_by_subtraction_Bad>:
push   %rbp
mov    %rsp,%rbp
movq   $0xffffffff88ca6c00,-0x18(%rbp)
88
movq   $0x77359400,-0x20(%rbp)
77
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jb     1134 <integer_overflow_by_subtraction_Bad+0x34>
mov    -0x28(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @integer_overflow_by_subtraction_Bad() {
%1 = alloca [10 x i8]
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 -2000000000, i64* %2
store i64 2000000000, i64* %3
%5 = load i64, i64* %2
%6 = load i64, i64* %3
%7 = sub i64 %5, %6
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = icmp uge i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i64, i64* %4
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
define void @integer_overflow_by_subtraction_Bad() {
ret void
}
int mDB_rebuildindex(fn, idx) { return mDBi_msg('B', fn, idx, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<mDB_rebuildindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x42,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1030 <mDBi_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mDB_rebuildindex>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
mov    $0x42,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   $0x0
push   $0x0
call   1030 <mDBi_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mDB_rebuildindex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 66, i32 %5, i32 %6, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mDB_rebuildindex(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 66, i32 %0, i32 %1, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %3
}
void curvep_(nsegments) int *nsegments;
{ curveprecision((short)*nsegments); }


x86 assembly (clang, -O0):
<curvep_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movswl %ax,%edi
mov    $0x0,%al
call   1030 <curveprecision@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curvep_>:
movswl (%rdi),%edi
xor    %eax,%eax
jmp    1030 <curveprecision@plt>

LLVM IR (-O0):
define void @curvep_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i16
%6 = sext i16 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @curveprecision to i32 (i32, ...)*)(i32 %6)
ret void
}

LLVM IR (-O2):
define void @curvep_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = ashr exact i32 %3, 16
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @curveprecision to i32 (i32, ...)*)(i32 %4)
ret void
}
void ff_hevc_put_hevc_uni_qpel_hv16_10_sse4() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_object_notify() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __crow_f5(int);
int expect(int, int /*<<< orphan*/);
int test_f5() { return expect(34, __crow_f5(9)); }


x86 assembly (clang, -O0):
<test_f5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
call   1040 <__crow_f5@plt>
mov    %eax,%esi
mov    $0x22,%edi
call   1030 <expect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_f5>:
push   %rax
mov    $0x9,%edi
call   1040 <__crow_f5@plt>
mov    $0x22,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <expect@plt>

LLVM IR (-O0):
define i32 @test_f5() {
%1 = call i32 @__crow_f5(i32 9)
%2 = call i32 @expect(i32 34, i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_f5() {
%1 = tail call i32 @__crow_f5(i32 9)
%2 = tail call i32 @expect(i32 34, i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x08() {
  Assert_real((isascii(8)),
              "/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_isascii.c",
              45, ("isascii should be 1 for 0x08"));
}


x86 assembly (clang, -O0):
<t_isascii_0x08>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x2d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x08>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x2d,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x08\00"
define void @t_isascii_0x08() {
%1 = call i32 @isascii(i32 8)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x08\00"
define void @t_isascii_0x08() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xmap_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xmap.window;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xmap_window>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xmap_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xmap_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x2c() {
  Assert_real((isascii(44)),
              "/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_isascii.c",
              225, ("isascii should be 1 for ,"));
}


x86 assembly (clang, -O0):
<t_isascii_0x2c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xe1,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x2c>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xe1,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for ,\00"
define void @t_isascii_0x2c() {
%1 = call i32 @isascii(i32 44)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 225, 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for ,\00"
define void @t_isascii_0x2c() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 225, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
resta(int a, int b) { return (a - b); }


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

x86 assembly (clang, -O2):
<resta>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @resta(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @resta(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int rewind_test(FILE *stream) {
  printf("rewind(): stream=0x%p\n", stream);
  fflush(NULL);
  rewind(stream);
  printf("\t\tret = (void)\n");
  fflush(NULL);
  return 0;
}


x86 assembly (clang, -O0):
<rewind_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1040 <rewind@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind_test>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <fflush@plt>
mov    %rbx,%rdi
call   1050 <rewind@plt>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <fflush@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"rewind(): stream=0x%p\0A\00"
@.str.1 = [16 x i8] c"\09\09ret = (void)\0A\00"
define i32 @rewind_test(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = call i32 @fflush(i32* null)
%6 = load i32*, i32** %2
%7 = call i32 @rewind(i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @fflush(i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"rewind(): stream=0x%p\0A\00"
@str = [15 x i8] c"\09\09ret = (void)\00"
define i32 @rewind_test(i32* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = tail call i32 @fflush(i32* null)
%4 = tail call i32 @rewind(i32* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @fflush(i32* null)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printabit(int n) {
  unsigned int k;
  k = 1 << (sizeof(n) * 8 - 1);
  while (k > 0) {
    if (n & k)
      printf("1");
    else
      printf("0");
    k >>= 1;
  }
}


x86 assembly (clang, -O0):
<printabit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1166 <printabit+0x56>
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     114c <printabit+0x3c>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <printabit+0x48>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printabit+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printabit>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    $0x80000000,%ebx
mov    $0x80000000,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
and    %r14d,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
shr    %ebp
cmp    $0x1,%ebx
mov    %ebp,%ebx
ja     1130 <printabit+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @printabit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -2147483648, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = icmp ugt i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = and i32 %8, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %7
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %3
%18 = lshr i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @printabit(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ -2147483648, %1 ], [ %8, %2 ]
%4 = and i32 %3, %0
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 48, i32 49
%7 = tail call i32 @putchar(i32 %6)
%8 = lshr i32 %3, 1
%9 = icmp ult i32 %3, 2
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
int cmp(void *pa, void *pb) {
  int a = *((int *)pa);
  int b = *((int *)pb);
  return (a >= b) ? ((a == b) ? 0 : 1) : -1;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     1144 <cmp+0x44>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <cmp+0x51>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <cmp+0x51>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sge i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp eq i32 %17, %18
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 0, i32 1
br label %23
22: ; preds = %2
br label %23
23: ; preds = %22, %16
%24 = phi i32 [ %21, %16 ], [ -1, %22 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int f();
void main() { int a = f(); }


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @f()
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @f()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void aesWriteBlock(uint32_t offset, uint32_t *pVal32, uint32_t numBytes) {
  void (*p_aesWriteBlock)(uint32_t offset, uint32_t * pVal32,
                          uint32_t numBytes);
  p_aesWriteBlock = (void (*)(uint32_t offset, uint32_t * pVal32,
                              uint32_t numBytes))0x030011c1U;
  p_aesWriteBlock(offset, pVal32, numBytes);
}


x86 assembly (clang, -O0):
<aesWriteBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x30011c1,%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aesWriteBlock>:
mov    $0x30011c1,%eax
jmp    *%rax

LLVM IR (-O0):
define void @aesWriteBlock(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca void (i32, i32*, i32)*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store void (i32, i32*, i32)* inttoptr (i64 50336193 to void (i32, i32*, i32)*), void (i32, i32*, i32)** %7
%8 = load void (i32, i32*, i32)*, void (i32, i32*, i32)** %7
%9 = load i32, i32* %4
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @aesWriteBlock(i32 %0, i32* %1, i32 %2) {
tail call void inttoptr (i64 50336193 to void (i32, i32*, i32)*)(i32 %0, i32* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xf6() {
  Assert_real((isdigit(246) == 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_isdigit.c",
              1235, ("isdigit should be 0 for 0xf6"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xf6>:
push   %rax
mov    $0xf6,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d3,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf6\00"
define void @t_isdigit_0xf6() {
%1 = call i64 @isdigit(i32 246)
%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 1235, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf6\00"
define void @t_isdigit_0xf6() {
%1 = tail call i64 @isdigit(i32 246)
%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 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawCellsBeginLine();
int /*<<< orphan*/ DrawCellsEndLine();
void DrawCellsBlankLine(void) {
  DrawCellsBeginLine();
  DrawCellsEndLine();
}


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

x86 assembly (clang, -O2):
<DrawCellsBlankLine>:
push   %rax
xor    %eax,%eax
call   1030 <DrawCellsBeginLine@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <DrawCellsEndLine@plt>

LLVM IR (-O0):
define void @DrawCellsBlankLine() {
%1 = call i32 (...) @DrawCellsBeginLine()
%2 = call i32 (...) @DrawCellsEndLine()
ret void
}

LLVM IR (-O2):
define void @DrawCellsBlankLine() {
%1 = tail call i32 (...) @DrawCellsBeginLine()
%2 = tail call i32 (...) @DrawCellsEndLine()
ret void
}
/* Variables and functions */
long factorial(int);
long find_ncr(int n, int r) {
  long result;
  result = factorial(n) / (factorial(r) * factorial(n - r));
  return result;
}


x86 assembly (clang, -O0):
<find_ncr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x20(%rbp),%rcx
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
imul   %rdx,%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_ncr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <factorial@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1030 <factorial@plt>
mov    %rax,%r15
sub    %ebp,%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
imul   %r15,%rcx
mov    %r14,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1153 <find_ncr+0x43>
mov    %r14,%rax
cqto
idiv   %rcx
jmp    115a <find_ncr+0x4a>
mov    %r14d,%eax
xor    %edx,%edx
div    %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @find_ncr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i64 @factorial(i32 %6)
%8 = load i32, i32* %4
%9 = call i64 @factorial(i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = call i64 @factorial(i32 %12)
%14 = mul nsw i64 %9, %13
%15 = sdiv i64 %7, %14
store i64 %15, i64* %5
%16 = load i64, i64* %5
ret i64 %16
}

LLVM IR (-O2):
define i64 @find_ncr(i32 %0, i32 %1) {
%3 = tail call i64 @factorial(i32 %0)
%4 = tail call i64 @factorial(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i64 @factorial(i32 %5)
%7 = mul nsw i64 %6, %4
%8 = sdiv i64 %3, %7
ret i64 %8
}
/* Variables and functions */
void *__dlsym(void *, char const *);
void *dlsym(void *handle, char const *name) { return __dlsym(handle, name); }


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

x86 assembly (clang, -O2):
<dlsym>:
jmp    1030 <__dlsym@plt>

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

LLVM IR (-O2):
define i8* @dlsym(i8* %0, i8* %1) {
%3 = tail call i8* @__dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
float produitScalaireFloat(float *, float *, int);
float distanceEuclidienneFloat(float *trainDescriptor, float *valDescriptor) {
  return produitScalaireFloat(trainDescriptor, valDescriptor, 56);
}


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

x86 assembly (clang, -O2):
<distanceEuclidienneFloat>:
mov    $0x38,%edx
jmp    1030 <produitScalaireFloat@plt>

LLVM IR (-O0):
define float @distanceEuclidienneFloat(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call float @produitScalaireFloat(float* %5, float* %6, i32 56)
ret float %7
}

LLVM IR (-O2):
define float @distanceEuclidienneFloat(float* %0, float* %1) {
%3 = tail call float @produitScalaireFloat(float* %0, float* %1, i32 56)
ret float %3
}
/* Variables and functions */
char *sm_request_file(const char *title, const char *path, int save,
                      const char *extension) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @sm_request_file(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sm_request_file(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ hello();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char point1[] = "Hello";
  char point2[] = "Xello";
  *point2 = *point1;
  printf("string2:%s\n", point2);
  hello();
  return 0;
}


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)
mov    0xec4(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    0xeb6(%rip),%eax
mov    %eax,-0x1c(%rbp)
mov    0xeb0(%rip),%ax
mov    %ax,-0x18(%rbp)
mov    -0x16(%rbp),%al
mov    %al,-0x1c(%rbp)
lea    -0x1c(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <hello@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x6c6c6558,(%rsp)
movw   $0x6f,0x4(%rsp)
movb   $0x48,(%rsp)
lea    0xecc(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <hello@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.point1 = [6 x i8] c"Hello\00"
@__const.main.point2 = [6 x i8] c"Xello\00"
@.str = [12 x i8] c"string2:%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i8]
%7 = alloca [6 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [6 x i8]* %6 to i8*
%9 = bitcast [6 x i8]* %7 to i8*
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%11 = load i8, i8* %10
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %7, i64 0, i64 0
store i8 %11, i8* %12
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %7, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 (...) @hello()
ret i32 0
}

LLVM IR (-O2):
@__const.main.point2 = [6 x i8] c"Xello\00"
@.str = [12 x i8] c"string2:%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
store i8 72, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @hello()
ret i32 0
}
void pmp_master_write(unsigned value) {
  while (*(volatile unsigned *)(0xBF800000 + (0x2E010)) & 0x8000)
    ;
  *(volatile unsigned *)(0xBF800000 + (0x2E040)) = value;
}


x86 assembly (clang, -O0):
<pmp_master_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xbf82e010,%eax
mov    (%rax),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1121 <pmp_master_write+0x21>
jmp    1107 <pmp_master_write+0x7>
mov    -0x4(%rbp),%ecx
mov    $0xbf82e040,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmp_master_write>:
mov    $0xbf82e010,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x8000,(%rax)
jne    1110 <pmp_master_write+0x10>
mov    %edi,0x30(%rax)
ret

LLVM IR (-O0):
define void @pmp_master_write(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i32, i32* inttoptr (i64 3213025296 to i32*)
%5 = and i32 %4, 32768
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* %2
store volatile i32 %9, i32* inttoptr (i64 3213025344 to i32*)
ret void
}

LLVM IR (-O2):
define void @pmp_master_write(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 3213025296 to i32*)
%4 = and i32 %3, 32768
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 3213025344 to i32*)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_memory(void *);
void manage_child(void *shared_memory) {
  printf("Child process (PID %d)\n", getpid());
  read_memory(shared_memory);
  printf("Child: memory has been consumed.\n");
}


x86 assembly (clang, -O0):
<manage_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <read_memory@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manage_child>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <read_memory@plt>
lea    0xeae(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Child process (PID %d)\0A\00"
@.str.1 = [34 x i8] c"Child: memory has been consumed.\0A\00"
define void @manage_child(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @getpid()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %2
%6 = call i32 @read_memory(i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Child process (PID %d)\0A\00"
@str = [33 x i8] c"Child: memory has been consumed.\00"
define void @manage_child(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @read_memory(i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *removeDotSegments(int /*<<< orphan*/);
int /*<<< orphan*/ removeEmptySegments(char *);
char *normalizePath(char *pcPath) {
  return removeDotSegments(removeEmptySegments(pcPath));
}


x86 assembly (clang, -O0):
<normalizePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <removeEmptySegments@plt>
mov    %eax,%edi
call   1030 <removeDotSegments@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalizePath>:
push   %rax
call   1040 <removeEmptySegments@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <removeDotSegments@plt>

LLVM IR (-O0):
define i8* @normalizePath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @removeEmptySegments(i8* %3)
%5 = call i8* @removeDotSegments(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @normalizePath(i8* %0) {
%2 = tail call i32 @removeEmptySegments(i8* %0)
%3 = tail call i8* @removeDotSegments(i32 %2)
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
volatile uint16_t *mem_get_reg16(uint32_t addr) {
  return (volatile uint16_t *)addr;
}


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

x86 assembly (clang, -O2):
<mem_get_reg16>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32* @mem_get_reg16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}

LLVM IR (-O2):
define i32* @mem_get_reg16(i64 %0) {
%2 = inttoptr i64 %0 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ japi_deselect(int, int);
void j_deselect(int arg0, int arg1) { japi_deselect(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_deselect>:
jmp    1030 <japi_deselect@plt>

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

LLVM IR (-O2):
define void @j_deselect(i32 %0, i32 %1) {
%3 = tail call i32 @japi_deselect(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prueba(int);
void main() {
  prueba(25000);
  prueba(50000);
  prueba(75000);
  prueba(100000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61a8,%edi
call   1030 <prueba@plt>
mov    $0xc350,%edi
call   1030 <prueba@plt>
mov    $0x124f8,%edi
call   1030 <prueba@plt>
mov    $0x186a0,%edi
call   1030 <prueba@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61a8,%edi
call   1030 <prueba@plt>
mov    $0xc350,%edi
call   1030 <prueba@plt>
mov    $0x124f8,%edi
call   1030 <prueba@plt>
mov    $0x186a0,%edi
pop    %rax
jmp    1030 <prueba@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @prueba(i32 25000)
%2 = call i32 @prueba(i32 50000)
%3 = call i32 @prueba(i32 75000)
%4 = call i32 @prueba(i32 100000)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @prueba(i32 25000)
%2 = tail call i32 @prueba(i32 50000)
%3 = tail call i32 @prueba(i32 75000)
%4 = tail call i32 @prueba(i32 100000)
ret void
}
/* Type definitions */
struct store_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ so_delete(struct store_object *);
int so_reg_delete(void *data, void *arg) {
  so_delete((struct store_object *)data);
  return (1);
}


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

x86 assembly (clang, -O2):
<so_reg_delete>:
push   %rax
call   1030 <so_delete@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.store_object = type { i32 }
define i32 @so_reg_delete(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.store_object*
%7 = call i32 @so_delete(%struct.store_object* %6)
ret i32 1
}

LLVM IR (-O2):
%struct.store_object = type { i32 }
define i32 @so_reg_delete(i8* %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to %struct.store_object*
%4 = tail call i32 @so_delete(%struct.store_object* %3)
ret i32 1
}
/* Type definitions */
typedef scalar_t__ const int64_t;

/* Variables and functions */
__attribute__((always_)) int64_t add64(const int64_t a, const int64_t b) {
  return a + b;
}


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

x86 assembly (clang, -O2):
<add64>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add64(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
int fun527() { return 527; }


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

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

LLVM IR (-O0):
define i32 @fun527() {
ret i32 527
}

LLVM IR (-O2):
define i32 @fun527() {
ret i32 527
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int searchRotatedArray(int, int *, int);
int main() {
  int ar[10] = {5, 6, 7, 8, 9, 0, 1, 2, 3, 4};
  printf("\n %d \n", searchRotatedArray(8, ar, 10));
}


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

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

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

LLVM IR (-O2):
@__const.main.ar = [10 x i32] [i32 5, i32 6, i32 7, i32 8, i32 9, i32 0, i32 1, i32 2, i32 3, i32 4]
@.str = [7 x i8] c"\0A %d \0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @searchRotatedArray(i32 8, i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int f344(int *);
int f345(int *p) { return f344(p); }


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

x86 assembly (clang, -O2):
<f345>:
jmp    1030 <f344@plt>

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

LLVM IR (-O2):
define i32 @f345(i32* %0) {
%2 = tail call i32 @f344(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void T3D_PrintBanner(void) {
  (void)fprintf(
      stdout, "\nbtime23d  Copyright (C) 2014-2015 Dave Gorst\n"
              "============================================\n\n"
              "This program comes with ABSOLUTELY NO WARRANTY.\n"
              "This is free software, and you are welcome to redistribute it\n"
              "under certain conditions.\n\n");
}


x86 assembly (clang, -O0):
<T3D_PrintBanner>:
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):
<T3D_PrintBanner>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [230 x i8] c"\0Abtime23d Copyright (C) 2014-2015 Dave Gorst\0A============================================\0A\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions.\0A\0A\00"
define void @T3D_PrintBanner() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [230 x i8] c"\0Abtime23d Copyright (C) 2014-2015 Dave Gorst\0A============================================\0A\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions.\0A\0A\00"
define void @T3D_PrintBanner() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/ *);
void *xx(void *arg) {
  pthread_mutex_t *mutex = (pthread_mutex_t *)arg;
  foo(mutex);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @xx(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @foo(i32* %6)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @xx(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @foo(i32* %2)
ret i8* null
}