xunge/DecIR huggingface dataset:
double compute(double n) {
  double sum = 0;
  while (n >= 1) {
    sum += n * n;
    n--;
  }
  return sum;
}


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     115b <compute+0x5b>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1111 <compute+0x11>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
xorpd  %xmm1,%xmm1
ucomisd 0xef4(%rip),%xmm0
jb     1146 <compute+0x46>
xorpd  %xmm1,%xmm1
movsd  0xeee(%rip),%xmm2
movsd  0xede(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm4,%xmm1
addsd  %xmm2,%xmm0
ucomisd %xmm3,%xmm0
jae    1130 <compute+0x30>
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @compute(double %0) {
%2 = fcmp ult double %0, 1.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi double [ %6, %3 ], [ 0.000000e+00, %1 ]
%5 = phi double [ %7, %3 ], [ %0, %1 ]
%6 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %4)
%7 = fadd double %5, -1.000000e+00
%8 = fcmp ult double %7, 1.000000e+00
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi double [ 0.000000e+00, %1 ], [ %6, %3 ]
ret double %10
}
/* Variables and functions */
scalar_t__ llvm_fcmp_uno(double, double);
int llvm_fcmp_uge(double X, double Y) { return X >= Y || llvm_fcmp_uno(X, Y); }


x86 assembly (clang, -O0):
<llvm_fcmp_uge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x11(%rbp)
jae    1150 <llvm_fcmp_uge+0x40>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <llvm_fcmp_uno@plt>
cmp    $0x0,%rax
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):
<llvm_fcmp_uge>:
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
jae    1130 <llvm_fcmp_uge+0x20>
push   %rax
call   1030 <llvm_fcmp_uno@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @llvm_fcmp_uge(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* %4
%7 = fcmp oge double %5, %6
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i64 @llvm_fcmp_uno(double %9, double %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %2
%14 = phi i1 [ true, %2 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @llvm_fcmp_uge(double %0, double %1) {
%3 = fcmp ult double %0, %1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i64 @llvm_fcmp_uno(double %0, double %1)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 1, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int ILLutil_strncasecmp(const char *s1, const char *s2, size_t n) {
  return strncasecmp(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<ILLutil_strncasecmp>:
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @ILLutil_strncasecmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
int test_imm_18uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x18 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_18uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x18,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_18uint64_midword_reg>:
test   $0x180000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_18uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 24
%6 = icmp ne i64 %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_18uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1572864
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *find_escaped(char *, char *, char *, int);
char *mod_end(char *s, int mark) { return find_escaped(s, ">>", "@>>", mark); }


x86 assembly (clang, -O0):
<mod_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xed4(%rip),%rsi
lea    0xecc(%rip),%rdx
call   1030 <find_escaped@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_end>:
mov    %esi,%ecx
lea    0xee8(%rip),%rsi
lea    0xee0(%rip),%rdx
jmp    1030 <find_escaped@plt>

LLVM IR (-O0):
@.str = [3 x i8] c">>\00"
@.str.1 = [4 x i8] c"@>>\00"
define i8* @mod_end(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @find_escaped(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [3 x i8] c">>\00"
@.str.1 = [4 x i8] c"@>>\00"
define i8* @mod_end(i8* %0, i32 %1) {
%3 = tail call i8* @find_escaped(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
void IRQ_set_mask(unsigned char IRQline) {
  uint16_t port;
  uint8_t value;
  if (IRQline < 8) {
    port = (0x20 + 1);
  } else {
    port = (0xA0 + 1);
    IRQline -= 8;
  }
  value = inb(port) | (1 << IRQline);
  outb(port, value);
}


x86 assembly (clang, -O0):
<IRQ_set_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jge    1147 <IRQ_set_mask+0x27>
movl   $0x21,-0x8(%rbp)
jmp    1158 <IRQ_set_mask+0x38>
movl   $0xa1,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
sub    $0x8,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <inb@plt>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IRQ_set_mask>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    %edi,%eax
sub    $0x8,%al
setae  %bl
movzbl %al,%ebp
cmovb  %edi,%ebp
shl    $0x7,%ebx
or     $0x21,%ebx
mov    %ebx,%edi
call   1040 <inb@plt>
bts    %ebp,%eax
mov    %ebx,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @IRQ_set_mask(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 33, i32* %3
br label %14
9: ; preds = %1
store i32 161, i32* %3
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = sub nsw i32 %11, 8
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %3
%16 = call i32 @inb(i32 %15)
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = shl i32 1, %18
%20 = or i32 %16, %19
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = call i32 @outb(i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @IRQ_set_mask(i8 zeroext %0) {
%2 = icmp ult i8 %0, 8
%3 = add i8 %0, -8
%4 = select i1 %2, i32 33, i32 161
%5 = select i1 %2, i8 %0, i8 %3
%6 = tail call i32 @inb(i32 %4)
%7 = zext i8 %5 to i32
%8 = shl nuw i32 1, %7
%9 = or i32 %6, %8
%10 = tail call i32 @outb(i32 %4, i32 %9)
ret void
}
void oldDec(x) int x;
{ x = 5; }


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

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

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

LLVM IR (-O2):
define void @oldDec(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void accept() {
  printf("Accepted\n");
  exit(0);
}


x86 assembly (clang, -O0):
<accept>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<accept>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Accepted\0A\00"
define void @accept() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [9 x i8] c"Accepted\00"
define void @accept() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned long gfx_pci_config_read(int);
unsigned char I2CAL_input_data(void) {
  unsigned short reg;
  unsigned long value;
  value = gfx_pci_config_read(
      (0x80000000 | (0x00 << 16) | (0x12 << 11) | (0 << 8) | 0x90));
  reg = (unsigned short)value;
  if (reg & 0x0800)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I2CAL_input_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80009090,%edi
call   1030 <gfx_pci_config_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
je     1149 <I2CAL_input_data+0x39>
movb   $0x1,-0x1(%rbp)
jmp    114d <I2CAL_input_data+0x3d>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CAL_input_data>:
push   %rax
mov    $0x80009090,%edi
call   1030 <gfx_pci_config_read@plt>
shr    $0xb,%rax
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @I2CAL_input_data() {
%1 = alloca i8
%2 = alloca i16
%3 = alloca i64
%4 = call i64 @gfx_pci_config_read(i32 -2147446640)
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i16
store i16 %6, i16* %2
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 2048
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
store i8 1, i8* %1
br label %13
12: ; preds = %0
store i8 0, i8* %1
br label %13
13: ; preds = %12, %11
%14 = load i8, i8* %1
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @I2CAL_input_data() {
%1 = tail call i64 @gfx_pci_config_read(i32 -2147446640)
%2 = lshr i64 %1, 11
%3 = trunc i64 %2 to i8
%4 = and i8 %3, 1
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int sqlite3_close(int /*<<< orphan*/ *);
int db_sqlite3_close(void *sq3_hndl) {
  int rc = -1;
  sqlite3 *db = NULL;
  if (sq3_hndl) {
    db = (sqlite3 *)sq3_hndl;
    if (db) {
      rc = sqlite3_close(db);
    }
  }
  return (rc);
}


x86 assembly (clang, -O0):
<db_sqlite3_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115a <db_sqlite3_close+0x4a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1155 <db_sqlite3_close+0x45>
mov    -0x18(%rbp),%rdi
call   1030 <sqlite3_close@plt>
mov    %eax,-0xc(%rbp)
jmp    115a <db_sqlite3_close+0x4a>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_sqlite3_close>:
test   %rdi,%rdi
je     111a <db_sqlite3_close+0xa>
jmp    1030 <sqlite3_close@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @db_sqlite3_close(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
store i32 -1, i32* %3
store i32* null, i32** %4
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %4
%10 = load i32*, i32** %4
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32*, i32** %4
%14 = call i32 @sqlite3_close(i32* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %7
br label %16
16: ; preds = %15, %1
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @db_sqlite3_close(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @sqlite3_close(i32* %4)
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_is_fido_security_token_desc__fido();
int /*<<< orphan*/ test_is_fido_security_token_desc__invalid();
int /*<<< orphan*/ test_is_fido_security_token_desc__non_fido();
int main(int argc, char *argv[]) {
  test_is_fido_security_token_desc__fido();
  test_is_fido_security_token_desc__non_fido();
  test_is_fido_security_token_desc__invalid();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_is_fido_security_token_desc__fido@plt>
mov    $0x0,%al
call   1050 <test_is_fido_security_token_desc__non_fido@plt>
mov    $0x0,%al
call   1030 <test_is_fido_security_token_desc__invalid@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_is_fido_security_token_desc__fido@plt>
xor    %eax,%eax
call   1050 <test_is_fido_security_token_desc__non_fido@plt>
xor    %eax,%eax
call   1030 <test_is_fido_security_token_desc__invalid@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @test_is_fido_security_token_desc__fido()
%7 = call i32 (...) @test_is_fido_security_token_desc__non_fido()
%8 = call i32 (...) @test_is_fido_security_token_desc__invalid()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_is_fido_security_token_desc__fido()
%4 = tail call i32 (...) @test_is_fido_security_token_desc__non_fido()
%5 = tail call i32 (...) @test_is_fido_security_token_desc__invalid()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
void led_blink() {
  (*(volatile unsigned long *)0xE0200280) = 0x00001111;
  while (1) {
    (*(volatile unsigned long *)0xE0200284) = 0;
    delay(0x100000);
    (*(volatile unsigned long *)0xE0200284) = 0xf;
    delay(0x100000);
  }
}


x86 assembly (clang, -O0):
<led_blink>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0200280,%eax
movq   $0x1111,(%rax)
mov    $0xe0200284,%eax
movq   $0x0,(%rax)
mov    $0x100000,%edi
call   1030 <delay@plt>
mov    $0xe0200284,%eax
movq   $0xf,(%rax)
mov    $0x100000,%edi
call   1030 <delay@plt>
jmp    1120 <led_blink+0x10>

x86 assembly (clang, -O2):
<led_blink>:
push   %rbx
mov    $0xe0200284,%ebx
movq   $0x1111,-0x4(%rbx)
xchg   %ax,%ax
movq   $0x0,(%rbx)
mov    $0x100000,%edi
call   1030 <delay@plt>
movq   $0xf,(%rbx)
mov    $0x100000,%edi
call   1030 <delay@plt>
jmp    1120 <led_blink+0x10>

LLVM IR (-O0):
define void @led_blink() {
store volatile i64 4369, i64* inttoptr (i64 3760194176 to i64*)
br label %1
1: ; preds = %0, %1
store volatile i64 0, i64* inttoptr (i64 3760194180 to i64*)
%2 = call i32 @delay(i32 1048576)
store volatile i64 15, i64* inttoptr (i64 3760194180 to i64*)
%3 = call i32 @delay(i32 1048576)
br label %1
}

LLVM IR (-O2):
define void @led_blink() {
store volatile i64 4369, i64* inttoptr (i64 3760194176 to i64*)
br label %1
1: ; preds = %0, %1
store volatile i64 0, i64* inttoptr (i64 3760194180 to i64*)
%2 = tail call i32 @delay(i32 1048576)
store volatile i64 15, i64* inttoptr (i64 3760194180 to i64*)
%3 = tail call i32 @delay(i32 1048576)
br label %1
}
unsigned unpack_bits_per_sample(unsigned packed_field) {
  switch (packed_field) {
  case 0:
    return 16;
  case 1:
    return 20;
  case 2:
    return 24;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<unpack_bits_per_sample>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     113c <unpack_bits_per_sample+0x3c>
jmp    111a <unpack_bits_per_sample+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1148 <unpack_bits_per_sample+0x48>
jmp    112b <unpack_bits_per_sample+0x2b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1154 <unpack_bits_per_sample+0x54>
jmp    1160 <unpack_bits_per_sample+0x60>
movl   $0x10,-0x4(%rbp)
jmp    1167 <unpack_bits_per_sample+0x67>
movl   $0x14,-0x4(%rbp)
jmp    1167 <unpack_bits_per_sample+0x67>
movl   $0x18,-0x4(%rbp)
jmp    1167 <unpack_bits_per_sample+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_bits_per_sample>:
xor    %ecx,%ecx
cmp    $0x3,%edi
lea    0x10(,%rdi,4),%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @unpack_bits_per_sample(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i32 16, i32* %2
br label %9
6: ; preds = %1
store i32 20, i32* %2
br label %9
7: ; preds = %1
store i32 24, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @unpack_bits_per_sample(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = shl i32 %0, 2
%4 = add i32 %3, 16
%5 = select i1 %2, i32 %4, i32 0
ret i32 %5
}
extern float __copysignf(float x, float y) { return __builtin_copysignf(x, y); }


x86 assembly (clang, -O0):
<__copysignf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__copysignf>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__copysignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.copysign.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__copysignf(float %0, float %1) {
%3 = tail call float @llvm.copysign.f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ releasePreviewFrame(void *, int);
void CameraReturnOneframe(void *v4l2ctx, int id) {
  releasePreviewFrame(v4l2ctx, id);
  return;
}


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

x86 assembly (clang, -O2):
<CameraReturnOneframe>:
jmp    1030 <releasePreviewFrame@plt>

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

LLVM IR (-O2):
define void @CameraReturnOneframe(i8* %0, i32 %1) {
%3 = tail call i32 @releasePreviewFrame(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int log2(size_t v) {
  int log = 0;
  unsigned int value = 1;
  while (value < v) {
    value <<= 1;
    log++;
  }
  return log;
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%rax
jae    113a <log2+0x3a>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <log2+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     111a <log2+0x1a>
xor    %eax,%eax
mov    $0x1,%ecx
nop
add    %ecx,%ecx
add    $0x1,%eax
cmp    %rdi,%rcx
jb     1110 <log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = shl i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = zext i32 %6 to i64
%9 = icmp ult i64 %8, %0
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ exit(int);
double e(void (*f)(char *)) {
  char tmp[10];
  double x;
  f(tmp);
  x = atof(tmp);
  if (x < 0.0) {
    exit(1);
  } else {
    return x;
  }
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    -0x12(%rbp),%rdi
call   *%rax
lea    -0x12(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    115c <e+0x3c>
mov    $0x1,%edi
call   1040 <exit@plt>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rax
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   *%rax
mov    %rbx,%rdi
call   1030 <atof@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     114a <e+0x2a>
add    $0x10,%rsp
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define double @e(void (i8*)* %0) {
%2 = alloca void (i8*)*
%3 = alloca [10 x i8]
%4 = alloca double
store void (i8*)* %0, void (i8*)** %2
%5 = load void (i8*)*, void (i8*)** %2
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = call double @atof(i8* %7)
store double %8, double* %4
%9 = load double, double* %4
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load double, double* %4
ret double %14
}

LLVM IR (-O2):
define double @e(void (i8*)* nocapture %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call double @atof(i8* %3)
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void populateTheArray(int *array, int arraySize) {
  for (int i = 0; i < arraySize; i++) {
    scanf("%d", &array[i]);
  }
}


x86 assembly (clang, -O0):
<populateTheArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <populateTheArray+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <populateTheArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<populateTheArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <populateTheArray+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <populateTheArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @populateTheArray(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
__attribute__((unused)) void *UTIL_realloc(void *ptr, size_t size) {
  void *newptr = realloc(ptr, size);
  if (newptr)
    return newptr;
  free(ptr);
  return NULL;
}


x86 assembly (clang, -O0):
<UTIL_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <UTIL_realloc+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <UTIL_realloc+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTIL_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <UTIL_realloc+0x1c>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @UTIL_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %6
store i8* %13, i8** %3
br label %17
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = call i32 @free(i8* %15)
store i8* null, i8** %3
br label %17
17: ; preds = %14, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @UTIL_realloc(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 @free(i8* %0)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ jesti(int);
int /*<<< orphan*/ sleep(int);
void *Filozof(void *n) {
  while (1) {
    sleep(3);
    jesti(*((int *)n));
  }
}


x86 assembly (clang, -O0):
<Filozof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <jesti@plt>
jmp    112c <Filozof+0xc>

x86 assembly (clang, -O2):
<Filozof>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    (%rbx),%edi
call   1030 <jesti@plt>
jmp    1130 <Filozof+0x10>

LLVM IR (-O0):
define i8* @Filozof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 3)
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @jesti(i32 %7)
br label %3
}

LLVM IR (-O2):
define noalias i8* @Filozof(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @sleep(i32 3)
%5 = load i32, i32* %2
%6 = tail call i32 @jesti(i32 %5)
br label %3
}
/* Variables and functions */
int f177(int *);
int f178(int *p) { return f177(p); }


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

x86 assembly (clang, -O2):
<f178>:
jmp    1030 <f177@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct handler *);
void cmd_handler_deinit(void *priv) {
  struct handler *h = (struct handler *)priv;
  free(h);
}


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

x86 assembly (clang, -O2):
<cmd_handler_deinit>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.handler = type { i32 }
define void @cmd_handler_deinit(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.handler*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.handler*
store %struct.handler* %5, %struct.handler** %3
%6 = load %struct.handler*, %struct.handler** %3
%7 = call i32 @free(%struct.handler* %6)
ret void
}

LLVM IR (-O2):
%struct.handler = type { i32 }
define void @cmd_handler_deinit(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.handler*
%3 = tail call i32 @free(%struct.handler* %2)
ret void
}
void and () {
  asm volatile("popq %%rax\n\t"
               "andq %%rax, 0x8(%%rsp)\n\t" ::
                   :);
}


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

x86 assembly (clang, -O2):
<and>:
pop    %rax
and    %rax,0x8(%rsp)
ret

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

LLVM IR (-O2):
define void @and() {
tail call void asm sideeffect "popq %rax\0A\09andq %rax, 0x8(%rsp)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ write(int, char *, int);
int fputc(int c, FILE *file) {
  int fd;
  char ch = (char)c;
  fd = fileno(file);
  write(fd, &ch, 1);
  return c;
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x15(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %bl,0xf(%rsp)
mov    %rsi,%rdi
call   1040 <fileno@plt>
lea    0xf(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fputc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32, i32* %3
%8 = trunc i32 %7 to i8
store i8 %8, i8* %6
%9 = load i32*, i32** %4
%10 = call i32 @fileno(i32* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i32 @write(i32 %11, i8* %6, i32 1)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @fputc(i32 returned %0, i32* nocapture %1) {
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = tail call i32 @fileno(i32* %1)
%6 = call i32 @write(i32 %5, i8* %3, i32 1)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ remove_die(int *, int);
void drop_n_dice(int *dice, int count) {
  int i;
  for (i = 0; i < count; i++) {
    remove_die(dice, dice[0]);
  }
}


x86 assembly (clang, -O0):
<drop_n_dice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114f <drop_n_dice+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
call   1030 <remove_die@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <drop_n_dice+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_n_dice>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <drop_n_dice+0x20>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    (%r14),%esi
mov    %r14,%rdi
call   1030 <remove_die@plt>
add    $0xffffffff,%ebx
jne    1120 <drop_n_dice+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @drop_n_dice(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = load i32, i32* %0
%7 = tail call i32 @remove_die(i32* %0, i32 %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Bonjour le monde\n");
  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    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"Bonjour le monde\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 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Bonjour le monde\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void pthread_attr_setscope() {}


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

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

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

LLVM IR (-O2):
define void @pthread_attr_setscope() {
ret void
}
int do_498() { return 498; }


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

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

LLVM IR (-O0):
define i32 @do_498() {
ret i32 498
}

LLVM IR (-O2):
define i32 @do_498() {
ret i32 498
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x83() {
  Assert_real((isgraph(131) == 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_isgraph.c",
              660, ("isgraph should be 0 for 0x83"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x83\00"
define void @t_isgraph_0x83() {
%1 = call i64 @isgraph(i32 131)
%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 660, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x83\00"
define void @t_isgraph_0x83() {
%1 = tail call i64 @isgraph(i32 131)
%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 660, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
void sprint_byte_with_x(char *s, unsigned int v) {
  sprintf(s, "\\x%02x", (v & 0377));
}


x86 assembly (clang, -O0):
<sprint_byte_with_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
and    $0xff,%edx
lea    0xecd(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_byte_with_x>:
movzbl %sil,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\\x%02x\00"
define void @sprint_byte_with_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\\x%02x\00"
define void @sprint_byte_with_x(i8* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rte_delay_us(unsigned int);
void rte_delay_ms(unsigned ms) { rte_delay_us(ms * 1000); }


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

x86 assembly (clang, -O2):
<rte_delay_ms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <rte_delay_us@plt>

LLVM IR (-O0):
define void @rte_delay_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @rte_delay_us(i32 %4)
ret void
}

LLVM IR (-O2):
define void @rte_delay_ms(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @rte_delay_us(i32 %2)
ret void
}
void ioctl_pause(void) {}


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

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

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

LLVM IR (-O2):
define void @ioctl_pause() {
ret void
}
void push() {
  asm volatile("movq $0x0123456789abcdef, %%rax\n\t"
               "pushq %%rax\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
movabs $0x123456789abcdef,%rax
45 23 01
push   %rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
movabs $0x123456789abcdef,%rax
45 23 01
push   %rax
ret

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

LLVM IR (-O2):
define void @push() {
tail call void asm sideeffect "movq $$0x0123456789abcdef, %rax\0A\09pushq %rax\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
void tp2(int *a) { printf("in TP2 ptr=%p, value=%d\n", a, *a); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"in TP2 ptr=%p, value=%d\0A\00"
define void @tp2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"in TP2 ptr=%p, value=%d\0A\00"
define void @tp2(i32* %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %0, i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
char *strcpy_wchar_to_char(char *dst, const wchar_t *src) {
  char *ret = dst;
  while (*src)
    *dst++ = *src++ & 0xff;
  *dst = 0;
  return ret;
}


x86 assembly (clang, -O0):
<strcpy_wchar_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1152 <strcpy_wchar_to_char+0x52>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy_wchar_to_char+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_wchar_to_char>:
mov    %rdi,%rax
mov    (%rsi),%rcx
mov    %rdi,%rdx
test   %rcx,%rcx
je     1132 <strcpy_wchar_to_char+0x32>
add    $0x8,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %cl,(%rdx)
add    $0x1,%rdx
mov    (%rsi),%rcx
add    $0x8,%rsi
test   %rcx,%rcx
jne    1120 <strcpy_wchar_to_char+0x20>
movb   $0x0,(%rdx)
ret

LLVM IR (-O0):
define i8* @strcpy_wchar_to_char(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
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %2
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i64*, i64** %4
%13 = getelementptr inbounds i64, i64* %12, i32 1
store i64* %13, i64** %4
%14 = load i64, i64* %12
%15 = and i64 %14, 255
%16 = trunc i64 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
store i8 %16, i8* %17
br label %7
19: ; preds = %7
%20 = load i8*, i8** %3
store i8 0, i8* %20
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @strcpy_wchar_to_char(i8* returned writeonly %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ %0, %2 ]
%8 = phi i64* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = trunc i64 %6 to i8
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %10, i8* %7
%12 = load i64, i64* %9
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i8* [ %0, %2 ], [ %11, %5 ]
store i8 0, i8* %15
ret i8* %0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int hash_isexist_file(const char *filepath) {
  struct stat st;
  int result = stat(filepath, &st);
  return result == 0;
}


x86 assembly (clang, -O0):
<hash_isexist_file>:
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    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_isexist_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @hash_isexist_file(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @hash_isexist_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}