xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  printf("input a and b\n");
  scanf("%d %d", &a, &b);
  printf("a+b=%d\n", a + b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"input a and b\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [8 x i8] c"a+b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [8 x i8] c"a+b=%d\0A\00"
@str = [14 x i8] c"input a and b\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
int main() {
  int z = 7;
  int i = 0, j = 0, MAX = 32767;
  for (i = 0; i < MAX; i++) {
    for (j = 0; j < MAX; j++) {
      z << 1;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x7fff,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116e <main+0x6e>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <main+0x5b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1141 <main+0x41>
jmp    1160 <main+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <main+0x2e>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x5c() {
  Assert_real((isodigit(92) == 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_isodigit.c",
              465, ("isodigit should be 0 for 0x5c"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x5c\00"
define void @t_isodigit_0x5c() {
%1 = tail call i64 @isodigit(i32 92)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int validate_path(const char *path) {
  struct stat s = {0};
  return 1;
}


x86 assembly (clang, -O0):
<validate_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @validate_path(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = bitcast %struct.stat* %3 to i8*
ret i32 1
}

LLVM IR (-O2):
define i32 @validate_path(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ DMA2_DriverIRQHandler();
__attribute__((weak)) void DMA2_IRQHandler(void) { DMA2_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DMA2_IRQHandler() {
%1 = call i32 (...) @DMA2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA2_IRQHandler() {
%1 = tail call i32 (...) @DMA2_DriverIRQHandler()
ret void
}
signed int f9(signed long long v_x, signed int v_y) {
  signed long long v_shr6 = ((unsigned long long)v_x) >> 48;
  signed int v_conv = (unsigned int)v_shr6;
  signed int v_and1 = v_y & -65536;
  signed int v_or = v_conv | v_and1;
  return v_or;
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x30,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff0000,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
shr    $0x30,%rdi
and    $0xffff0000,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @f9(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%9 = load i64, i64* %3
%10 = lshr i64 %9, 48
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %4
%14 = and i32 %13, -65536
store i32 %14, i32* %7
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = or i32 %15, %16
store i32 %17, i32* %8
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
define i32 @f9(i64 %0, i32 %1) {
%3 = lshr i64 %0, 48
%4 = trunc i64 %3 to i32
%5 = and i32 %1, -65536
%6 = or i32 %5, %4
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t clock(void) {
  clock_t ans;
  return ans;
}


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

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

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

LLVM IR (-O2):
define i32 @clock() {
ret i32 undef
}
/* Variables and functions */
double SIM_power_gatecap(double, int);
double SIM_iwin_sel_chgreq_cap(void) {
  return (SIM_power_gatecap((10.0 * 0.0875) + (15.0 * 0.0875), 1));
}


x86 assembly (clang, -O0):
<SIM_iwin_sel_chgreq_cap>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_iwin_sel_chgreq_cap>:
movsd  0xee8(%rip),%xmm0
mov    $0x1,%edi
jmp    1030 <SIM_power_gatecap@plt>

LLVM IR (-O0):
define double @SIM_iwin_sel_chgreq_cap() {
%1 = call double @SIM_power_gatecap(double 2.187500e+00, i32 1)
ret double %1
}

LLVM IR (-O2):
define double @SIM_iwin_sel_chgreq_cap() {
%1 = tail call double @SIM_power_gatecap(double 2.187500e+00, i32 1)
ret double %1
}
/* Variables and functions */
int drand();
int irand(int size) { return (int)(drand() * size); }


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

x86 assembly (clang, -O2):
<irand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <drand@plt>
imul   %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @irand(i32 %0) {
%2 = tail call i32 (...) @drand()
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void tests_init(void) {
  printk("ERROR! Module compiled without debugging support!\n");
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"ERROR! Module compiled without debugging support!\0A\00"
define void @tests_init() {
%1 = call i32 @printk(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"ERROR! Module compiled without debugging support!\0A\00"
define void @tests_init() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f203(int *);
int f204(int *p) { return f203(p); }


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

x86 assembly (clang, -O2):
<f204>:
jmp    1030 <f203@plt>

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

LLVM IR (-O2):
define i32 @f204(i32* %0) {
%2 = tail call i32 @f203(i32* %0)
ret i32 %2
}
/* Type definitions */
struct product {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
struct product *product_ops_clone(struct product *product) {
  printf("product::clone()\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<product_ops_clone>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.product = type { i32 }
@.str = [18 x i8] c"product::clone()\0A\00"
define %struct.product* @product_ops_clone(%struct.product* %0) {
%2 = alloca %struct.product*
store %struct.product* %0, %struct.product** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret %struct.product* null
}

LLVM IR (-O2):
%struct.product = type { i32 }
@str = [17 x i8] c"product::clone()\00"
define noalias %struct.product* @product_ops_clone(%struct.product* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret %struct.product* null
}
void adj_acc(struct ThreeAxis *acc) {}


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

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

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

LLVM IR (-O2):
%struct.ThreeAxis = type opaque
define void @adj_acc(%struct.ThreeAxis* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_op(int, int, int /*<<< orphan*/);
void lcd_clear(void) { lcd_op(0x1, 0x1, 0); }


x86 assembly (clang, -O0):
<lcd_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1030 <lcd_op@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_clear>:
mov    $0x1,%edi
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <lcd_op@plt>

LLVM IR (-O0):
define void @lcd_clear() {
%1 = call i32 @lcd_op(i32 1, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @lcd_clear() {
%1 = tail call i32 @lcd_op(i32 1, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plah();
main() { plah(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @plah()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @plah()
ret i32 0
}
void g_array_free() {}


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

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

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

LLVM IR (-O2):
define void @g_array_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CX4_str(int, int);
void CX4_op89(void) {
  CX4_str(0, 0x054336);
  CX4_str(1, 0xffffff);
}


x86 assembly (clang, -O0):
<CX4_op89>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x54336,%esi
call   1030 <CX4_str@plt>
mov    $0x1,%edi
mov    $0xffffff,%esi
call   1030 <CX4_str@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CX4_op89>:
push   %rax
xor    %edi,%edi
mov    $0x54336,%esi
call   1030 <CX4_str@plt>
mov    $0x1,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1030 <CX4_str@plt>

LLVM IR (-O0):
define void @CX4_op89() {
%1 = call i32 @CX4_str(i32 0, i32 344886)
%2 = call i32 @CX4_str(i32 1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @CX4_op89() {
%1 = tail call i32 @CX4_str(i32 0, i32 344886)
%2 = tail call i32 @CX4_str(i32 1, i32 16777215)
ret void
}
unsigned psi_get_uint16_be(const void *buf, unsigned idx) {
  unsigned val;
  const unsigned char *tmp;
  tmp = (const unsigned char *)buf + idx;
  val = tmp[0] & 0xff;
  val = (val << 8) | (tmp[1] & 0xff);
  return (val);
}


x86 assembly (clang, -O0):
<psi_get_uint16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_get_uint16_be>:
mov    %esi,%eax
movzwl (%rdi,%rax,1),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @psi_get_uint16_be(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = and i32 %14, 255
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = shl i32 %16, 8
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = and i32 %21, 255
%23 = or i32 %17, %22
store i32 %23, i32* %5
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @psi_get_uint16_be(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = or i32 %7, %10
ret i32 %11
}
/* Variables and functions */
int recursive_file_count(char *);
int rejected_count(void) {
  return recursive_file_count("/var/lib/pkg/rejected");
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"/var/lib/pkg/rejected\00"
define i32 @rejected_count() {
%1 = call i32 @recursive_file_count(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [22 x i8] c"/var/lib/pkg/rejected\00"
define i32 @rejected_count() {
%1 = tail call i32 @recursive_file_count(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
char sin(char);
char internal_sin_b(char value) { return sin(value); }


x86 assembly (clang, -O0):
<internal_sin_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
movsbl %al,%edi
call   1030 <sin@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_sin_b>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define signext i8 @internal_sin_b(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @sin(i8 signext %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @internal_sin_b(i8 signext %0) {
%2 = tail call signext i8 @sin(i8 signext %0)
ret i8 %2
}
/* Variables and functions */
int _xte_utf8_streq(char const *, long, char const *, long);
int xte_cstrings_szd_equal(char const *in_string1, long in_bytes1,
                           char const *in_string2, long in_bytes2) {
  return _xte_utf8_streq(in_string1, in_bytes1, in_string2, in_bytes2);
}


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

x86 assembly (clang, -O2):
<xte_cstrings_szd_equal>:
jmp    1030 <_xte_utf8_streq@plt>

LLVM IR (-O0):
define i32 @xte_cstrings_szd_equal(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @_xte_utf8_streq(i8* %9, i64 %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @xte_cstrings_szd_equal(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @_xte_utf8_streq(i8* %0, i64 %1, i8* %2, i64 %3)
ret i32 %5
}
int main() {
  int z = ({
    int x = 0;
    x;
  });
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int do_870() { return 870; }


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

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

LLVM IR (-O0):
define i32 @do_870() {
ret i32 870
}

LLVM IR (-O2):
define i32 @do_870() {
ret i32 870
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_midi(int midi_fd) { close(midi_fd); }


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

x86 assembly (clang, -O2):
<close_midi>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_midi(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
unsigned int vrna_file_fasta_read_record(char **, char **, char ***,
                                         int /*<<< orphan*/ *, unsigned int);
unsigned int read_record(char **header, char **sequence, char ***rest,
                         unsigned int options) {
  return vrna_file_fasta_read_record(header, sequence, rest, NULL, options);
}


x86 assembly (clang, -O0):
<read_record>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <vrna_file_fasta_read_record@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_record>:
mov    %ecx,%r8d
xor    %ecx,%ecx
jmp    1030 <vrna_file_fasta_read_record@plt>

LLVM IR (-O0):
define i32 @read_record(i8** %0, i8** %1, i8*** %2, i32 %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8***
%8 = alloca i32
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i8*** %2, i8**** %7
store i32 %3, i32* %8
%9 = load i8**, i8*** %5
%10 = load i8**, i8*** %6
%11 = load i8***, i8**** %7
%12 = load i32, i32* %8
%13 = call i32 @vrna_file_fasta_read_record(i8** %9, i8** %10, i8*** %11, i32* null, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @read_record(i8** %0, i8** %1, i8*** %2, i32 %3) {
%5 = tail call i32 @vrna_file_fasta_read_record(i8** %0, i8** %1, i8*** %2, i32* null, i32 %3)
ret i32 %5
}
double fact_rec(double a) {
  if (a <= 0)
    return 1;
  else
    return a * fact_rec(a - 1);
}


x86 assembly (clang, -O0):
<fact_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     113d <fact_rec+0x2d>
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116e <fact_rec+0x5e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fact_rec@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact_rec>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    113c <fact_rec+0x2c>
movsd  0xee1(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <fact_rec@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xebc(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @fact_rec(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1, %5
%4 = phi double [ %8, %5 ], [ 1.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = fadd double %0, -1.000000e+00
%7 = tail call double @fact_rec(double %6)
%8 = fmul double %7, %0
br label %3
}
/* Type definitions */
struct sigevent {
  int dummy;
};
struct aiocb {
  int aio_fildes;
  int aio_offset;
  int aio_reqprio;
  struct sigevent aio_sigevent;
  scalar_t__ aio_nbytes;
  int /*<<< orphan*/ *aio_buf;
};

/* Variables and functions */
int main(void) {
  struct aiocb aiocb;
  struct sigevent sigevent;
  aiocb.aio_fildes = -1;
  aiocb.aio_offset = -1;
  aiocb.aio_buf = NULL;
  aiocb.aio_nbytes = 0;
  aiocb.aio_sigevent = sigevent;
  aiocb.aio_reqprio = -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x20(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.aiocb = type { i32, i32, i32, %struct.sigevent, i64, i32* }
%struct.sigevent = type { i32 }
define i32 @main() {
%1 = alloca %struct.aiocb
%2 = alloca %struct.sigevent
%3 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %1, i32 0, i32 0
store i32 -1, i32* %3
%4 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %1, i32 0, i32 1
store i32 -1, i32* %4
%5 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %1, i32 0, i32 5
store i32* null, i32** %5
%6 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %1, i32 0, i32 4
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %1, i32 0, i32 3
%8 = bitcast %struct.sigevent* %7 to i8*
%9 = bitcast %struct.sigevent* %2 to i8*
%10 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %1, i32 0, i32 2
store i32 -1, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *name) {
  printf("Usage: %s [-m] sfifiles\n\n", name);
  printf("    This program converts sfi images to pgm format.\n\n"
         "    If the first argument is -m then the program runs in "
         "multichannel mode\n"
         "    In default mode the first channel of the sfi image is saved to a "
         "file.\n"
         "    In multichannel mode every channel of the image is saved to its "
         "own pgm image.\n"
         "    The pgm image will have a channel number appended to its file "
         "name \"*_XXX.pgm\".\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s [-m] sfifiles\0A\0A\00"
@.str.1 = [371 x i8] c" This program converts sfi images to pgm format.\0A\0A If the first argument is -m then the program runs in multichannel mode\0A In default mode the first channel of the sfi image is saved to a file.\0A In multichannel mode every channel of the image is saved to its own pgm image.\0A The pgm image will have a channel number appended to its file name \22*_XXX.pgm\22.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([371 x i8], [371 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s [-m] sfifiles\0A\0A\00"
@str = [370 x i8] c" This program converts sfi images to pgm format.\0A\0A If the first argument is -m then the program runs in multichannel mode\0A In default mode the first channel of the sfi image is saved to a file.\0A In multichannel mode every channel of the image is saved to its own pgm image.\0A The pgm image will have a channel number appended to its file name \22*_XXX.pgm\22.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([370 x i8], [370 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
void uhci_controller_init(void) {}


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

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

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

LLVM IR (-O2):
define void @uhci_controller_init() {
ret void
}
int ft_sqrt(int nb) {
  int i;
  if (nb == 0)
    return (0);
  if (nb == 1)
    return (1);
  i = 1;
  while (i * i < nb)
    i++;
  if ((nb % i) == 0)
    return (i);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ft_sqrt+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    117a <ft_sqrt+0x7a>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <ft_sqrt+0x33>
movl   $0x1,-0x4(%rbp)
jmp    117a <ft_sqrt+0x7a>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <ft_sqrt+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <ft_sqrt+0x3a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1173 <ft_sqrt+0x73>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <ft_sqrt+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
mov    %edi,%eax
test   %edi,%edi
je     1136 <ft_sqrt+0x36>
cmp    $0x1,%eax
jne    1111 <ft_sqrt+0x11>
mov    $0x1,%eax
ret
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ecx
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %eax,%edx
jl     1120 <ft_sqrt+0x20>
cltd
idiv   %ecx
xor    %eax,%eax
test   %edx,%edx
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
switch i32 %0, label %3 [
i32 0, label %12
i32 1, label %2
]
2: ; preds = %1
br label %12
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = mul nsw i32 %4, %4
%6 = icmp slt i32 %5, %0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = srem i32 %0, %4
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 %4, i32 0
br label %12
12: ; preds = %8, %1, %2
%13 = phi i32 [ 1, %2 ], [ %0, %1 ], [ %11, %8 ]
ret i32 %13
}
int test_imm_FAint8_mem(signed char *val) {
  return ((*val) & (0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xfa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_FAint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -6
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_B7uint8_reg(unsigned char val) {
  return ((val) & (-0xB7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B7uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff49,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B7uint8_reg>:
test   $0x49,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B7uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 73
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int hidden_function(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @hidden_function() {
ret i32 0
}

LLVM IR (-O2):
define i32 @hidden_function() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage() { puts("[-] Provide Hostname"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"[-] Provide Hostname\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"[-] Provide Hostname\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_short(short const k1, short const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_short>:
xor    %eax,%eax
cmp    %si,%di
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_short(i16 signext %0, i16 signext %1) {
%3 = icmp eq i16 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bbm_write(void *, int, int);
int /*<<< orphan*/ ms_must_wait(int);
int fc8080_reset(void *handle) {
  bbm_write(handle, 0x0001, 0xfe);
  ms_must_wait(1);
  bbm_write(handle, 0x0001, 0xff);
  return 0;
}


x86 assembly (clang, -O0):
<fc8080_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0xfe,%edx
call   1040 <bbm_write@plt>
mov    $0x1,%edi
call   1030 <ms_must_wait@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0xff,%edx
call   1040 <bbm_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8080_reset>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
mov    $0xfe,%edx
call   1040 <bbm_write@plt>
mov    $0x1,%edi
call   1030 <ms_must_wait@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0xff,%edx
call   1040 <bbm_write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fc8080_reset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @bbm_write(i8* %3, i32 1, i32 254)
%5 = call i32 @ms_must_wait(i32 1)
%6 = load i8*, i8** %2
%7 = call i32 @bbm_write(i8* %6, i32 1, i32 255)
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8080_reset(i8* %0) {
%2 = tail call i32 @bbm_write(i8* %0, i32 1, i32 254)
%3 = tail call i32 @ms_must_wait(i32 1)
%4 = tail call i32 @bbm_write(i8* %0, i32 1, i32 255)
ret i32 0
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IXOTH;
scalar_t__ stat(char *, struct stat *);
int is_ixoth(char *filename) {
  struct stat sb;
  return (stat(filename, &sb) == 0 && sb.st_mode & S_IXOTH);
}


x86 assembly (clang, -O0):
<is_ixoth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1150 <is_ixoth+0x40>
mov    -0x10(%rbp),%eax
mov    0x2ea3(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ixoth>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
sete   %al
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%ecx
and    (%rsp),%ecx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IXOTH = global i32 0
define i32 @is_ixoth(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load i32, i32* @S_IXOTH
%11 = and i32 %9, %10
%12 = icmp ne i32 %11, 0
br label %13
13: ; preds = %7, %1
%14 = phi i1 [ false, %1 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IXOTH = global i32 0
define i32 @is_ixoth(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IXOTH
%9 = and i32 %8, %7
%10 = icmp ne i32 %9, 0
%11 = select i1 %5, i1 %10, i1 false
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
double pow(double, double);
double convert_it(double x) { return pow(x, 1.0 / 6.0); }


x86 assembly (clang, -O0):
<convert_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_it>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @convert_it(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FC5555555555555)
ret double %4
}

LLVM IR (-O2):
define double @convert_it(double %0) {
%2 = tail call double @pow(double %0, double 0x3FC5555555555555)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_unfree_pawns(int, int);
void b_unfree_pawns_test(void **state) {
  assert_int_equal(0x0000001000000000ul,
                   b_unfree_pawns(0x0000000010000000ul, 0x0000001800000000ul));
}


x86 assembly (clang, -O0):
<b_unfree_pawns_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10000000,%edi
xor    %esi,%esi
call   1040 <b_unfree_pawns@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_unfree_pawns_test>:
push   %rax
mov    $0x10000000,%edi
xor    %esi,%esi
call   1040 <b_unfree_pawns@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_unfree_pawns_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_unfree_pawns(i32 268435456, i32 0)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_unfree_pawns_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_unfree_pawns(i32 268435456, i32 0)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rt_kprintf(char *);
int main(int argc, char *argv[]) {
  rt_kprintf("Hello, world\n");
  extern int core_mark(void);
  core_mark();
  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)
lea    0xec3(%rip),%rdi
call   1040 <rt_kprintf@plt>
call   1030 <core_mark@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @rt_kprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @core_mark()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @rt_kprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @core_mark()
ret i32 0
}
__attribute__((always_)) void mem_barrier(void) {
  __asm__ __volatile__("" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @mem_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freeMem(void *);
void freez(void *vpt) {
  void **ppt = (void **)vpt;
  void *pt = *ppt;
  *ppt = NULL;
  freeMem(pt);
}


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

x86 assembly (clang, -O2):
<freez>:
mov    (%rdi),%rax
movq   $0x0,(%rdi)
mov    %rax,%rdi
jmp    1030 <freeMem@plt>

LLVM IR (-O0):
define void @freez(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i8**
store i8** %6, i8*** %3
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
store i8* %8, i8** %4
%9 = load i8**, i8*** %3
store i8* null, i8** %9
%10 = load i8*, i8** %4
%11 = call i32 @freeMem(i8* %10)
ret void
}

LLVM IR (-O2):
define void @freez(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
store i8* null, i8** %2
%4 = tail call i32 @freeMem(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x4a() {
  Assert_real((ispunct(74) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              375, ("ispunct should be 0 for J"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for J\00"
define void @t_ispunct_0x4a() {
%1 = tail call i64 @ispunct(i32 74)
%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 375, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}