xunge/DecIR huggingface dataset:
void netcdf_WriteHeaderSpatial(short int imxb, short int jmxb) {}


x86 assembly (clang, -O0):
<netcdf_WriteHeaderSpatial>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @netcdf_WriteHeaderSpatial(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @netcdf_WriteHeaderSpatial(i16 signext %0, i16 signext %1) {
ret void
}
void ff_hevc_put_hevc_pel_pixels48_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels48_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_abort();
int /*<<< orphan*/ test_failure();
int /*<<< orphan*/ test_finished();
int /*<<< orphan*/ test_start(int, char **);
int /*<<< orphan*/ test_successful();
int main(int argc, char **argv) {
  test_start(argc, argv);
  test_successful();
  test_failure();
  test_abort();
  test_finished();
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <test_start@plt>
mov    $0x0,%al
call   1040 <test_successful@plt>
mov    $0x0,%al
call   1060 <test_failure@plt>
mov    $0x0,%al
call   1070 <test_abort@plt>
mov    $0x0,%al
call   1030 <test_finished@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <test_start@plt>
xor    %eax,%eax
call   1040 <test_successful@plt>
xor    %eax,%eax
call   1060 <test_failure@plt>
xor    %eax,%eax
call   1070 <test_abort@plt>
xor    %eax,%eax
call   1030 <test_finished@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_start(i32 %6, i8** %7)
%9 = call i32 (...) @test_successful()
%10 = call i32 (...) @test_failure()
%11 = call i32 (...) @test_abort()
%12 = call i32 (...) @test_finished()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_start(i32 %0, i8** %1)
%4 = tail call i32 (...) @test_successful()
%5 = tail call i32 (...) @test_failure()
%6 = tail call i32 (...) @test_abort()
%7 = tail call i32 (...) @test_finished()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xa7() {
  Assert_real((isupper(167) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              840, ("isupper should be 0 for 0xa7"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xa7\00"
define void @t_isupper_0xa7() {
%1 = call i64 @isupper(i32 167)
%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 840, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xa7\00"
define void @t_isupper_0xa7() {
%1 = tail call i64 @isupper(i32 167)
%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 840, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int reverse(int n) {
  int r = 0;
  while (n > 0) {
    r = 10 * r + n % 10;
    n = n / 10;
  }
  return r;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <reverse+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <reverse+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <reverse+0x10>
ret

LLVM IR (-O0):
define i32 @reverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul nsw i32 10, %8
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
%12 = add nsw i32 %9, %11
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
store i32 %14, i32* %2
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
int d_lt_mr1(double *a1, double a2) { return (((*a1) < (a2))); }


x86 assembly (clang, -O0):
<d_lt_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_lt_mr1>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @d_lt_mr1(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp olt double %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_lt_mr1(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp olt double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cginc2ib(void) { ngen("%s\t(%%rdx)", "incb", 0); }


x86 assembly (clang, -O0):
<cginc2ib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginc2ib>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09(%%rdx)\00"
@.str.1 = [5 x i8] c"incb\00"
define void @cginc2ib() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09(%%rdx)\00"
@.str.1 = [5 x i8] c"incb\00"
define void @cginc2ib() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t u64_invert(uint64_t x) { return x ^ 0xFFFFFFFFFFFFFFFFULL; }


x86 assembly (clang, -O0):
<u64_invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
xor    $0xffffffffffffffff,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @u64_invert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = xor i64 %4, -1
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @u64_invert(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
int func2() {}


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

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

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

LLVM IR (-O2):
define i32 @func2() {
ret i32 undef
}
/* Variables and functions */
int getnpar(int /*<<< orphan*/, char *, char *, void *);
int getpar(char *name, char *type, void *ptr) {
  return getnpar(0, name, type, ptr);
}


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

x86 assembly (clang, -O2):
<getpar>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <getnpar@plt>

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

LLVM IR (-O2):
define i32 @getpar(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @getnpar(i32 0, i8* %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int msg(char *);
int think(void) { return msg("#think should not be called"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"#think should not be called\00"
define i32 @think() {
%1 = call i32 @msg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [28 x i8] c"#think should not be called\00"
define i32 @think() {
%1 = tail call i32 @msg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
scalar_t__ CheckCentOff();
scalar_t__ CheckHitT();
scalar_t__ CheckLeftOn();
unsigned char CheckEventsForward(void) {
  if (CheckHitT() != 0)
    return 7;
  if (CheckCentOff() != 0)
    return 4;
  if (CheckLeftOn() != 0)
    return 1;
}


x86 assembly (clang, -O0):
<CheckEventsForward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <CheckHitT@plt>
cmp    $0x0,%rax
je     1152 <CheckEventsForward+0x22>
movb   $0x7,-0x1(%rbp)
jmp    1181 <CheckEventsForward+0x51>
mov    $0x0,%al
call   1050 <CheckCentOff@plt>
cmp    $0x0,%rax
je     116c <CheckEventsForward+0x3c>
movb   $0x4,-0x1(%rbp)
jmp    1181 <CheckEventsForward+0x51>
mov    $0x0,%al
call   1040 <CheckLeftOn@plt>
cmp    $0x0,%rax
je     1181 <CheckEventsForward+0x51>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckEventsForward>:
push   %rax
xor    %eax,%eax
call   1030 <CheckHitT@plt>
mov    %rax,%rcx
mov    $0x7,%al
test   %rcx,%rcx
je     1144 <CheckEventsForward+0x14>
pop    %rcx
ret
xor    %eax,%eax
call   1050 <CheckCentOff@plt>
mov    %rax,%rcx
mov    $0x4,%al
test   %rcx,%rcx
jne    1142 <CheckEventsForward+0x12>
xor    %eax,%eax
call   1040 <CheckLeftOn@plt>
mov    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CheckEventsForward() {
%1 = alloca i8
%2 = call i64 (...) @CheckHitT()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8 7, i8* %1
br label %13
5: ; preds = %0
%6 = call i64 (...) @CheckCentOff()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i8 4, i8* %1
br label %13
9: ; preds = %5
%10 = call i64 (...) @CheckLeftOn()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i8 1, i8* %1
br label %13
13: ; preds = %4, %8, %12, %9
%14 = load i8, i8* %1
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @CheckEventsForward() {
%1 = tail call i64 (...) @CheckHitT()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i64 (...) @CheckCentOff()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i64 (...) @CheckLeftOn()
br label %8
8: ; preds = %6, %3, %0
%9 = phi i8 [ 7, %0 ], [ 4, %3 ], [ 1, %6 ]
ret i8 %9
}
/* Type definitions */
struct type {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
struct type *alloc_type(void) {
  abort();
}


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

x86 assembly (clang, -O2):
<alloc_type>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.type = type { i32 }
define %struct.type* @alloc_type() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.type = type { i32 }
define noalias %struct.type* @alloc_type() {
%1 = tail call i32 (...) @abort()
unreachable
}
void XtAppPeekEvent() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SwapByteOrder_32(int /*<<< orphan*/);
void bswap_32(const int n, void *u) {
  uint32_t *T = u;
  int i;
  for (i = 0; i < n; i++) {
    *(T + i) = SwapByteOrder_32(*(T + i));
  }
  return;
}


x86 assembly (clang, -O0):
<bswap_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <bswap_32+0x55>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <SwapByteOrder_32@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <bswap_32+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_32>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <bswap_32+0x36>
mov    %rsi,%r15
mov    %edi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <SwapByteOrder_32@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <bswap_32+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @bswap_32(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %3, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @SwapByteOrder_32(i32 %10)
store i32 %11, i32* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
char *ft_strcpy(char *dst, char *src) {
  int i;
  i = 0;
  while (src[i]) {
    dst[i] = src[i];
    i++;
  }
  dst[i] = '\0';
  return (dst);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1149 <ft_strcpy+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <ft_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <ft_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <ft_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Variables and functions */
int bma222_read_reg(unsigned char, unsigned char *, int);
int bma222_read_reg_byte(unsigned char adr) {
  unsigned char buf = 0xff;
  int err;
  err = bma222_read_reg(adr, &buf, 1);
  if (err == 0) {
    return buf;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bma222_read_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movb   $0xff,-0x6(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <bma222_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114d <bma222_read_reg_byte+0x3d>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <bma222_read_reg_byte+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bma222_read_reg_byte>:
push   %rax
movb   $0xff,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <bma222_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bma222_read_reg_byte(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 -1, i8* %4
%6 = load i8, i8* %3
%7 = call i32 @bma222_read_reg(i8 zeroext %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @bma222_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
store i8 -1, i8* %2
%3 = call i32 @bma222_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void debug(char *string) { printf("%s\n", string); }


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

x86 assembly (clang, -O2):
<debug>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @debug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned int fibo(int);
int compute_child(int argl, void *args) {
  unsigned int fib = fibo(35);
  return fib % 3 == 1;
}


x86 assembly (clang, -O0):
<compute_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x23,%edi
call   1030 <fibo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x1,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_child>:
push   %rax
mov    $0x23,%edi
call   1030 <fibo@plt>
imul   $0xaaaaaaab,%eax,%ecx
add    $0x55555555,%ecx
xor    %eax,%eax
cmp    $0x55555555,%ecx
setb   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @compute_child(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @fibo(i32 35)
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = urem i32 %7, 3
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @compute_child(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @fibo(i32 35)
%4 = urem i32 %3, 3
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
void JmpU() {}


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

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

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

LLVM IR (-O2):
define void @JmpU() {
ret void
}
unsigned int hash_str(char *str) {
  unsigned int hash = 0;
  for (; *str; str++)
    hash = (hash * 32) - hash + *str;
  return hash;
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <hash_str+0x42>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
sub    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash_str+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_str+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_str+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 31
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
int CG_im5(i)
int i;
{ return ((i & 0x10) >> 4) | ((i & 0xf) << 1); }


x86 assembly (clang, -O0):
<CG_im5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10,%eax
sar    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_im5>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0x1,%eax
and    $0xf,%edi
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @CG_im5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16
%5 = ashr i32 %4, 4
%6 = load i32, i32* %2
%7 = and i32 %6, 15
%8 = shl i32 %7, 1
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @CG_im5(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 1
%4 = shl i32 %0, 1
%5 = and i32 %4, 30
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
double fmod(double, double);
double pmod(double x, double y) {
  double z = fmod(x, y);
  if (z < 0)
    z += y;
  return (z);
}


x86 assembly (clang, -O0):
<pmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1153 <pmod+0x43>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmod>:
sub    $0x18,%rsp
movapd %xmm1,(%rsp)
call   1030 <fmod@plt>
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm1,%xmm2
movapd (%rsp),%xmm3
andpd  %xmm2,%xmm3
movsd  0xec4(%rip),%xmm1
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @pmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @fmod(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %5
%14 = fadd double %13, %12
store double %14, double* %5
br label %15
15: ; preds = %11, %2
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @pmod(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
%4 = fcmp olt double %3, 0.000000e+00
%5 = select i1 %4, double %1, double -0.000000e+00
%6 = fadd double %3, %5
ret double %6
}
void put_prev_task_idle(struct rq *rq, struct task_struct *prev) {}


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

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

LLVM IR (-O0):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @put_prev_task_idle(%struct.rq* %0, %struct.task_struct* %1) {
%3 = alloca %struct.rq*
%4 = alloca %struct.task_struct*
store %struct.rq* %0, %struct.rq** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @put_prev_task_idle(%struct.rq* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t size) {
  void *ret = realloc(p, size);
  if (ret == NULL)
    err(1, "realloc() failed");
  return ret;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115d <xrealloc+0x3d>
mov    $0x1,%edi
lea    0xea8(%rip),%rsi
call   1030 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xrealloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"realloc() failed\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @err(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"realloc() failed\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ mkfifo(char *, int);
int open(char *, int);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int fd;
  char *fifo = "myfifo";
  mkfifo(fifo, 0666);
  fd = open(fifo, 0666);
  write(fd, "Testing 123 !", 1024);
  close(fd);
  unlink(fifo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1b6,%esi
call   1060 <mkfifo@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1b6,%esi
call   1070 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xe74(%rip),%rsi
mov    $0x400,%edx
call   1040 <write@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xea6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1b6,%esi
call   1060 <mkfifo@plt>
mov    %rbx,%rdi
mov    $0x1b6,%esi
call   1070 <open@plt>
mov    %eax,%ebp
lea    0xe8a(%rip),%rsi
mov    %eax,%edi
mov    $0x400,%edx
call   1040 <write@plt>
mov    %ebp,%edi
call   1050 <close@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"myfifo\00"
@.str.1 = [14 x i8] c"Testing 123 !\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @mkfifo(i8* %4, i32 438)
%6 = load i8*, i8** %3
%7 = call i32 @open(i8* %6, i32 438)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @write(i32 %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1024)
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
%12 = load i8*, i8** %3
%13 = call i32 @unlink(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"myfifo\00"
@.str.1 = [14 x i8] c"Testing 123 !\00"
define i32 @main() {
%1 = tail call i32 @mkfifo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 438)
%2 = tail call i32 @open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 438)
%3 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1024)
%4 = tail call i32 @close(i32 %2)
%5 = tail call i32 @unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isspace(int);
void t_isspace_0x20() {
  Assert_real((isspace(32)),
              "/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_isspace.c",
              165, ("isspace should be 1 for  "));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x20>:
push   %rax
mov    $0x20,%edi
call   1030 <isspace@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xa5,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 1 for \00"
define void @t_isspace_0x20() {
%1 = call i32 @isspace(i32 32)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 165, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 1 for \00"
define void @t_isspace_0x20() {
%1 = tail call i32 @isspace(i32 32)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 165, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void test_two(int x, int y) {
#pragma omp target parallel for simd
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vstart_init(uint8_t *p_mp2vstart, uint8_t startcode) {
  p_mp2vstart[0] = 0x0;
  p_mp2vstart[1] = 0x0;
  p_mp2vstart[2] = 0x1;
  p_mp2vstart[3] = startcode;
}


x86 assembly (clang, -O0):
<mp2vstart_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vstart_init>:
movq   $0x0,(%rdi)
movl   $0x1,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @mp2vstart_init(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 0, i32* %6
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 0, i32* %8
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 2
store i32 1, i32* %10
%11 = load i32, i32* %4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 3
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @mp2vstart_init(i32* nocapture writeonly %0, i32 %1) {
store i32 0, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
store i32 0, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32 1, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %5
ret void
}
/* Variables and functions */
bool uc_is_trailing_surrogate(int c) { return c >= 0xdc00 && c <= 0xdfff; }


x86 assembly (clang, -O0):
<uc_is_trailing_surrogate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xdc00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <uc_is_trailing_surrogate+0x26>
cmpl   $0xdfff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc_is_trailing_surrogate>:
and    $0xfffffc00,%edi
xor    %eax,%eax
cmp    $0xdc00,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @uc_is_trailing_surrogate(i32 %0) {
%2 = and i32 %0, -1024
%3 = icmp eq i32 %2, 56320
%4 = zext i1 %3 to i32
ret i32 %4
}
void __attribute__((annotate("!realtime"))) bad_function(void) {}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"!realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp9y3b5sgy/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (void ()* @bad_function to i8*), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 1, i8* null }], section "llvm.metadata"
define void @bad_function() {
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"!realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp9y3b5sgy/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (void ()* @bad_function to i8*), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 1, i8* null }], section "llvm.metadata"
define void @bad_function() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fprintf(int /*<<< orphan*/ *, char *, double);
int print_basic_score(FILE *fp, double score) {
  if (1 != fprintf(fp, "BASIC_SCORE=%lf\n", score)) {
    return EOF;
  }
  return 1;
}


x86 assembly (clang, -O0):
<print_basic_score>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1156 <print_basic_score+0x46>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <print_basic_score+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_basic_score>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x1,%eax
je     112b <print_basic_score+0x1b>
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"BASIC_SCORE=%lf\0A\00"
@EOF = global i32 0
define i32 @print_basic_score(i32* %0, double %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double
store i32* %0, i32** %4
store double %1, double* %5
%6 = load i32*, i32** %4
%7 = load double, double* %5
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %7)
%9 = icmp ne i32 1, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @EOF
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 1, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"BASIC_SCORE=%lf\0A\00"
@EOF = global i32 0
define i32 @print_basic_score(i32* nocapture %0, double %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %1)
%4 = icmp eq i32 %3, 1
%5 = load i32, i32* @EOF
%6 = select i1 %4, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Cleari80186Ram();
int /*<<< orphan*/ RomCopy();
int /*<<< orphan*/ reset();
void copro_i80186_reset() {
  Cleari80186Ram();
  RomCopy();
  reset();
}


x86 assembly (clang, -O0):
<copro_i80186_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Cleari80186Ram@plt>
mov    $0x0,%al
call   1040 <RomCopy@plt>
mov    $0x0,%al
call   1050 <reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copro_i80186_reset>:
push   %rax
xor    %eax,%eax
call   1030 <Cleari80186Ram@plt>
xor    %eax,%eax
call   1040 <RomCopy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <reset@plt>

LLVM IR (-O0):
define void @copro_i80186_reset() {
%1 = call i32 (...) @Cleari80186Ram()
%2 = call i32 (...) @RomCopy()
%3 = call i32 (...) @reset()
ret void
}

LLVM IR (-O2):
define void @copro_i80186_reset() {
%1 = tail call i32 (...) @Cleari80186Ram()
%2 = tail call i32 (...) @RomCopy()
%3 = tail call i32 (...) @reset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpq_t;

/* Variables and functions */
int /*<<< orphan*/ mpq_init(int /*<<< orphan*/);
extern void QINIT(mpq_t *q, char *format, ...) {
  mpq_init(*q);
  ;
}


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

x86 assembly (clang, -O2):
<QINIT>:
mov    (%rdi),%edi
jmp    1030 <mpq_init@plt>

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

LLVM IR (-O2):
define void @QINIT(i32* nocapture %0, i8* nocapture readnone %1, ...) {
%3 = load i32, i32* %0
%4 = tail call i32 @mpq_init(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pfn();
void indirect1() { pfn(); }


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

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

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

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

/* Variables and functions */
int mbsinit(int /*<<< orphan*/ const *);
__attribute__((__weak__, __always___)) int
softboundcets_mbsinit(const mbstate_t *ps) {
  return mbsinit(ps);
}


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

x86 assembly (clang, -O2):
<softboundcets_mbsinit>:
jmp    1030 <mbsinit@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_mbsinit(i32* %0) {
%2 = tail call i32 @mbsinit(i32* %0)
ret i32 %2
}
unsigned test_48(unsigned char *p, unsigned char *q) {
  return (unsigned int)(p - q);
}


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

x86 assembly (clang, -O2):
<test_48>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @test_48(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 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_48(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
void CMovableEntity_OnEndClass(void) {}


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

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

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

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