xunge/DecIR huggingface dataset:
int string_exists(char *s) { return (s ? (1) : (0)); }


x86 assembly (clang, -O0):
<string_exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_exists>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @string_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @string_exists(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct private {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ error(struct private *, int);
int state_error(struct private *pz, int err) {
  error(pz, err);
  return 13;
}


x86 assembly (clang, -O0):
<state_error>:
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 <error@plt>
mov    $0xd,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.private = type { i32 }
define i32 @state_error(%struct.private* %0, i32 %1) {
%3 = tail call i32 @error(%struct.private* %0, i32 %1)
ret i32 13
}
double power(double x, unsigned n) {
  if (0 == n)
    return 1;
  else if (n % 2)
    return x * power(x, n - 1);
  else
    return power(x * x, n / 2);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jne    113d <power+0x2d>
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1196 <power+0x86>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     117c <power+0x6c>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
call   1030 <power@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1196 <power+0x86>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
shr    $0x1,%edi
call   1030 <power@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
push   %rax
movapd %xmm0,%xmm1
movsd  0xee3(%rip),%xmm0
test   %edi,%edi
je     1145 <power+0x35>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%dil
jne    1147 <power+0x37>
mulsd  %xmm1,%xmm1
mov    %edi,%eax
shr    %eax
cmp    $0x2,%edi
mov    %eax,%edi
jae    1130 <power+0x20>
pop    %rax
ret
add    $0xffffffff,%edi
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <power@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @power(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 0, %6
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* %3
br label %27
9: ; preds = %2
%10 = load i32, i32* %5
%11 = urem i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load double, double* %4
%15 = load double, double* %4
%16 = load i32, i32* %5
%17 = sub i32 %16, 1
%18 = call double @power(double %15, i32 %17)
%19 = fmul double %14, %18
store double %19, double* %3
br label %27
20: ; preds = %9
%21 = load double, double* %4
%22 = load double, double* %4
%23 = fmul double %21, %22
%24 = load i32, i32* %5
%25 = udiv i32 %24, 2
%26 = call double @power(double %23, i32 %25)
store double %26, double* %3
br label %27
27: ; preds = %20, %13, %8
%28 = load double, double* %3
ret double %28
}

LLVM IR (-O2):
define double @power(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %15
%5 = phi i32 [ %17, %15 ], [ %1, %2 ]
%6 = phi double [ %16, %15 ], [ %0, %2 ]
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %11
9: ; preds = %15, %2, %11
%10 = phi double [ %14, %11 ], [ 1.000000e+00, %2 ], [ 1.000000e+00, %15 ]
ret double %10
11: ; preds = %4
%12 = add i32 %5, -1
%13 = tail call double @power(double %6, i32 %12)
%14 = fmul double %6, %13
br label %9
15: ; preds = %4
%16 = fmul double %6, %6
%17 = lshr i32 %5, 1
%18 = icmp ult i32 %5, 2
br i1 %18, label %9, label %4
}
int bittest(int value) { return ((value & ~(-value)) == 0); }


x86 assembly (clang, -O0):
<bittest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bittest>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bittest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @bittest(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, double);
void main() {
  char *name = "Sharon";
  int age = 45;
  double wage = 34500.00;
  printf("%s is %d and earns %10.2f\n", name, age, wage);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee9(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x2d,-0xc(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xef8(%rip),%rdi
lea    0xeea(%rip),%rsi
movsd  0xeda(%rip),%xmm0
mov    $0x2d,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Sharon\00"
@.str.1 = [27 x i8] c"%s is %d and earns %10.2f\0A\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca double
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
store i32 45, i32* %2
store double 3.450000e+04, double* %3
%4 = load i8*, i8** %1
%5 = load i32, i32* %2
%6 = load double, double* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 %5, double %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Sharon\00"
@.str.1 = [27 x i8] c"%s is %d and earns %10.2f\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 45, double 3.450000e+04)
ret void
}
/* Type definitions */
struct menu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ search_conf();
void handle_f8(int *key, struct menu *current_item) {
  search_conf();
  return;
}


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

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

LLVM IR (-O0):
%struct.menu = type { i32 }
define void @handle_f8(i32* %0, %struct.menu* %1) {
%3 = alloca i32*
%4 = alloca %struct.menu*
store i32* %0, i32** %3
store %struct.menu* %1, %struct.menu** %4
%5 = call i32 (...) @search_conf()
ret void
}

LLVM IR (-O2):
%struct.menu = type { i32 }
define void @handle_f8(i32* nocapture readnone %0, %struct.menu* nocapture readnone %1) {
%3 = tail call i32 (...) @search_conf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawBox(double, double, double, double);
int /*<<< orphan*/ DrawTriangle(double, double, double, double);
void DrawOutline(double x, double y) {
  DrawBox(x, y, 3.0, 2.0);
  DrawTriangle(x, y + 2.0, 3.0, 0.7);
}


x86 assembly (clang, -O0):
<DrawOutline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xebc(%rip),%xmm2
movsd  0xec4(%rip),%xmm3
call   1040 <DrawBox@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xe95(%rip),%xmm2
movsd  0xe95(%rip),%xmm3
call   1030 <DrawTriangle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawOutline>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  0xec8(%rip),%xmm2
movsd  0xec8(%rip),%xmm3
call   1040 <DrawBox@plt>
movsd  0x8(%rsp),%xmm1
addsd  0xeb5(%rip),%xmm1
movsd  0xeb5(%rip),%xmm3
movsd  0x10(%rsp),%xmm0
movsd  0xe97(%rip),%xmm2
add    $0x18,%rsp
jmp    1030 <DrawTriangle@plt>

LLVM IR (-O0):
define void @DrawOutline(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 = call i32 @DrawBox(double %5, double %6, double 3.000000e+00, double 2.000000e+00)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fadd double %9, 2.000000e+00
%11 = call i32 @DrawTriangle(double %8, double %10, double 3.000000e+00, double 0x3FE6666666666666)
ret void
}

LLVM IR (-O2):
define void @DrawOutline(double %0, double %1) {
%3 = tail call i32 @DrawBox(double %0, double %1, double 3.000000e+00, double 2.000000e+00)
%4 = fadd double %1, 2.000000e+00
%5 = tail call i32 @DrawTriangle(double %0, double %4, double 3.000000e+00, double 0x3FE6666666666666)
ret void
}
/* Variables and functions */
double __ieee754_cosh(double);
double cosh(double x) { return __ieee754_cosh(x); }


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

x86 assembly (clang, -O2):
<cosh>:
jmp    1030 <__ieee754_cosh@plt>

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

LLVM IR (-O2):
define double @cosh(double %0) {
%2 = tail call double @__ieee754_cosh(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Shift(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
void LowGear() { Shift(0, 1, 0, 1); }


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

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

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

LLVM IR (-O2):
define void @LowGear() {
%1 = tail call i32 @Shift(i32 0, i32 1, i32 0, i32 1)
ret void
}
__attribute__((always_)) void selinux_secmark_refcount_dec(void) { return; }


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

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

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

LLVM IR (-O2):
define void @selinux_secmark_refcount_dec() {
ret void
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void send_dir(struct ship *ship, long a) { Write(22, ship, a, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x16,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_dir>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x16,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_dir(%struct.ship* %0, i64 %1) {
%3 = alloca %struct.ship*
%4 = alloca i64
store %struct.ship* %0, %struct.ship** %3
store i64 %1, i64* %4
%5 = load %struct.ship*, %struct.ship** %3
%6 = load i64, i64* %4
%7 = call i32 @Write(i32 22, %struct.ship* %5, i64 %6, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_dir(%struct.ship* %0, i64 %1) {
%3 = tail call i32 @Write(i32 22, %struct.ship* %0, i64 %1, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void monitor_mii(long ioaddr, int phy_id) {
  fprintf(stderr, "\nThis version of 'mii-diag' has not been linked with "
                  "the libmii.c library \n"
                  "  required for the media monitor option.\n");
}


x86 assembly (clang, -O0):
<monitor_mii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [117 x i8] c"\0AThis version of 'mii-diag' has not been linked with the libmii.c library \0A required for the media monitor option.\0A\00"
define void @monitor_mii(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [117 x i8] c"\0AThis version of 'mii-diag' has not been linked with the libmii.c library \0A required for the media monitor option.\0A\00"
define void @monitor_mii(i64 %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x5b() {
  Assert_real((isupper(91) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              460, ("isupper should be 0 for ["));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for [\00"
define void @t_isupper_0x5b() {
%1 = call i64 @isupper(i32 91)
%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 460, 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for [\00"
define void @t_isupper_0x5b() {
%1 = tail call i64 @isupper(i32 91)
%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 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ iscreen_quit();
void iscreen_atexit_hook(void) { iscreen_quit(); }


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

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

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

LLVM IR (-O2):
define void @iscreen_atexit_hook() {
%1 = tail call i32 (...) @iscreen_quit()
ret void
}
/* Variables and functions */
int arch_get_reg(int, int);
int emit_get_reg(int usage, int indx) { return arch_get_reg(usage, indx); }


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

x86 assembly (clang, -O2):
<emit_get_reg>:
jmp    1030 <arch_get_reg@plt>

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

LLVM IR (-O2):
define i32 @emit_get_reg(i32 %0, i32 %1) {
%3 = tail call i32 @arch_get_reg(i32 %0, i32 %1)
ret i32 %3
}
void _ITM_deregisterTMCloneTable(void *a) { printf("%s\n", __func__); }


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

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

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

LLVM IR (-O2):
@__func__._ITM_deregisterTMCloneTable = [28 x i8] c"_ITM_deregisterTMCloneTable\00"
define void @_ITM_deregisterTMCloneTable(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @__func__._ITM_deregisterTMCloneTable, i64 0, i64 0))
ret void
}
void genbgezal() {}


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

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

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

LLVM IR (-O2):
define void @genbgezal() {
ret void
}
/* Type definitions */
struct snd_ctl_card_info {
  int dummy;
};
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int main(void) {
  struct snd_ctl_card_info i;
  (void)i;
  return sizeof(i);
}


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

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

LLVM IR (-O0):
%struct.snd_ctl_card_info = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.snd_ctl_card_info
store i32 0, i32* %1
ret i32 4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
int test_imm_E4int64_lowword_reg(long long val) {
  return ((val) & (0xE4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E4int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 228
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int length(int *p) { return (*(p - 1) & ~0x7); }


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%eax
and    $0xfffffff8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    -0x4(%rdi),%eax
and    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -1
%5 = load i32, i32* %4
%6 = and i32 %5, -8
ret i32 %6
}

LLVM IR (-O2):
define i32 @length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = load i32, i32* %2
%4 = and i32 %3, -8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a = 0;
  int b = 0;
  if (a == 0 || b++) {
    printf("True\n");
  } else {
    printf("False\n");
  }
  printf("b = %d\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114b <main+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     115e <main+0x4e>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116c <main+0x5c>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe97(%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    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"True\0A\00"
@.str.1 = [7 x i8] c"False\0A\00"
@.str.2 = [8 x i8] c"b = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %12
10: ; preds = %6, %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [8 x i8] c"b = %d\0A\00"
@str = [5 x i8] c"True\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret i32 0
}
int jac_chain_nm4_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @jac_chain_nm4_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @jac_chain_nm4_n_in() {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ write_bytes(unsigned char *, int, int /*<<< orphan*/ *,
                               int *);
void write_byte(unsigned char c, FILE *file, int *count) {
  write_bytes(&c, sizeof(char), file, count);
}


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <write_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_byte>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <write_bytes@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @write_byte(i8 zeroext %0, i32* %1, i32* %2) {
%4 = alloca i8
store i8 %0, i8* %4
%5 = call i32 @write_bytes(i8* %4, i32 1, i32* %1, i32* %2)
ret void
}
int main(void) {
  float x;
  x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-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 float
store i32 0, i32* %1
%3 = load float, float* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int reverse(int n) {
  int sum = 0, rem = 0;
  while (n != 0) {
    rem = n % 10;
    sum = (sum * 10) + rem;
    n = n / 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114a <reverse+0x4a>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1115 <reverse+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
je     113f <reverse+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = mul nsw i32 %4, 10
%8 = add nsw i32 %7, %6
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ irc_out(char *, char const *, char const *);
int /*<<< orphan*/ puts(char *);
void irc_privmsg(const char *recipient, const char *message) {
  if (recipient[0] == '\0') {
    puts("irc_privmsg WARNING: No recipient specified.");
    return;
  }
  irc_out("PRIVMSG %s :%s", recipient, message);
  return;
}


x86 assembly (clang, -O0):
<irc_privmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1151 <irc_privmsg+0x31>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
jmp    1165 <irc_privmsg+0x45>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rdi
call   1040 <irc_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_privmsg>:
cmpb   $0x0,(%rdi)
je     1137 <irc_privmsg+0x17>
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xefb(%rip),%rdi
jmp    1040 <irc_out@plt>
lea    0xec2(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"irc_privmsg WARNING: No recipient specified.\00"
@.str.1 = [15 x i8] c"PRIVMSG %s :%s\00"
define void @irc_privmsg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %16
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @irc_out(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %14)
br label %16
16: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"irc_privmsg WARNING: No recipient specified.\00"
@.str.1 = [15 x i8] c"PRIVMSG %s :%s\00"
define void @irc_privmsg(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %2
%8 = tail call i32 @irc_out(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
ret void
}
int myfunc(int x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i32 @myfunc(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *duplicate_string(char *str) {
  assert(str);
  char *result;
  result = (char *)malloc(strlen(str) + 1);
  strcpy(result, str);
  return result;
}


x86 assembly (clang, -O0):
<duplicate_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<duplicate_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <assert@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @duplicate_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @assert(i8* %4)
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @duplicate_string(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 1
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
ret i8* %6
}
void rop3_218_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S & *D;
  stk3 = ~stk3;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_218_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_218_1_0>:
mov    (%rdi),%r8b
mov    %r8d,%eax
and    %sil,%al
mov    %eax,%ecx
not    %cl
and    %dl,%cl
xor    %r8b,%cl
not    %sil
and    %cl,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_218_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = and i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = xor i32 %18, -1
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = xor i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = trunc i32 %46 to i8
%48 = load i8*, i8** %4
store i8 %47, i8* %48
ret void
}

LLVM IR (-O2):
define void @rop3_218_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, -1
%7 = and i8 %6, %2
%8 = xor i8 %7, %4
%9 = xor i8 %1, -1
%10 = and i8 %8, %9
%11 = or i8 %10, %5
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, sum;
  for (i = 0; i < 10; i++) {
    if (i % 5 == 0 || i % 3 == 0)
      sum = i + (i + 1);
  }
  printf("%3d", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1179 <main+0x69>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1158 <main+0x48>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1166 <main+0x56>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <main+0x5b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%3d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %21, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %24
7: ; preds = %4
%8 = load i32, i32* %2
%9 = srem i32 %8, 5
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = srem i32 %12, 3
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %11, %7
%16 = load i32, i32* %2
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
%19 = add nsw i32 %16, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %15, %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %4
24: ; preds = %4
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [4 x i8] c"%3d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 19)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int shm_unlink(char *);
int main(int argc, char **argv) {
  int ret;
  ret = shm_unlink(argv[1]);
  printf("unlinking %s\nret is %d\n", argv[1], ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <shm_unlink@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x14(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <shm_unlink@plt>
mov    0x8(%rbx),%rsi
lea    0xec8(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"unlinking %s\0Aret is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @shm_unlink(i8* %8)
store i32 %9, i32* %5
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"unlinking %s\0Aret is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @shm_unlink(i8* %4)
%6 = load i8*, i8** %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ decompress(char *, char *);
int /*<<< orphan*/ getdict(char *);
int dmvh(char *src, char *tgt) {
  getdict(src);
  decompress(src, tgt);
  return 0;
}


x86 assembly (clang, -O0):
<dmvh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getdict@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <decompress@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmvh>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <getdict@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <decompress@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @dmvh(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @getdict(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @decompress(i8* %7, i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @dmvh(i8* %0, i8* %1) {
%3 = tail call i32 @getdict(i8* %0)
%4 = tail call i32 @decompress(i8* %0, i8* %1)
ret i32 0
}
void WT_READ_BARRIER(void) { return; }


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

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

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

LLVM IR (-O2):
define void @WT_READ_BARRIER() {
ret void
}
extern void fgets_one_name(char *arr_no_newline) {
  int i = 0;
  while (arr_no_newline[i] != '\0') {
    if (arr_no_newline[i] == ' ') {
      arr_no_newline[i] = '\0';
      break;
    }
    i++;
  }
}


x86 assembly (clang, -O0):
<fgets_one_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <fgets_one_name+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    114a <fgets_one_name+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1158 <fgets_one_name+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <fgets_one_name+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_one_name>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1129 <fgets_one_name+0x29>
cmp    $0x20,%cl
je     1123 <fgets_one_name+0x23>
add    $0x1,%rax
jmp    1110 <fgets_one_name+0x10>
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @fgets_one_name(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %10, %9 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 0, label %11
i8 32, label %6
]
6: ; preds = %2
%7 = and i64 %3, 4294967295
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %11
9: ; preds = %2
%10 = add nuw i64 %3, 1
br label %2
11: ; preds = %2, %6
ret void
}
int ti_ao_start(double const *options) {
  (void)options;
  return 33;
}


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

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

LLVM IR (-O0):
define i32 @ti_ao_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
ret i32 33
}

LLVM IR (-O2):
define i32 @ti_ao_start(double* nocapture readnone %0) {
ret i32 33
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t gmul2(uint8_t x) {
  if (x & 0x80) {
    return (x << 1) ^ 0x1B;
  } else {
    return (x << 1);
  }
}


x86 assembly (clang, -O0):
<gmul2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1129 <gmul2+0x29>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
xor    $0x1b,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <gmul2+0x32>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmul2>:
lea    (%rdi,%rdi,1),%ecx
mov    %ecx,%eax
xor    $0x1b,%eax
test   $0x80,%dil
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gmul2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = shl i32 %8, 1
%10 = xor i32 %9, 27
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = shl i32 %12, 1
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @gmul2(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = shl i32 %0, 1
%5 = xor i32 %4, 27
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void getLogPath(char *path) { strcpy(path, ""); }


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

x86 assembly (clang, -O2):
<getLogPath>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @getLogPath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @getLogPath(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t endian16_swap(uint16_t val) {
  uint16_t temp;
  temp = val & 0xFF;
  temp = (val >> 8) | (temp << 8);
  return temp;
}


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

x86 assembly (clang, -O2):
<endian16_swap>:
mov    %edi,%ecx
sar    $0x8,%ecx
shl    $0x8,%edi
movzwl %di,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @endian16_swap(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = and i32 %3, 65280
%5 = or i32 %4, %2
ret i32 %5
}