xunge/DecIR huggingface dataset:
unsigned xrop3_138_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = S | stk3;
  stk1 = D & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_138_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_138_0_0>:
not    %sil
or     %dil,%sil
movzbl %sil,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_138_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_138_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = xor i8 %1, -1
%4 = or i8 %3, %0
%5 = zext i8 %4 to i32
ret i32 %5
}
int roman_to_integer(char c) {
  switch (c) {
  case 'I':
    return 1;
  case 'V':
    return 5;
  case 'X':
    return 10;
  case 'L':
    return 50;
  case 'C':
    return 100;
  case 'D':
    return 500;
  case 'M':
    return 1000;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<roman_to_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1188 <roman_to_integer+0x88>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    118f <roman_to_integer+0x8f>
movl   $0x5,-0x4(%rbp)
jmp    118f <roman_to_integer+0x8f>
movl   $0xa,-0x4(%rbp)
jmp    118f <roman_to_integer+0x8f>
movl   $0x32,-0x4(%rbp)
jmp    118f <roman_to_integer+0x8f>
movl   $0x64,-0x4(%rbp)
jmp    118f <roman_to_integer+0x8f>
movl   $0x1f4,-0x4(%rbp)
jmp    118f <roman_to_integer+0x8f>
movl   $0x3e8,-0x4(%rbp)
jmp    118f <roman_to_integer+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roman_to_integer>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     1129 <roman_to_integer+0x29>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
mov    $0x1f4,%eax
ret
xor    %eax,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret
mov    $0x3e8,%eax
ret

LLVM IR (-O0):
define i32 @roman_to_integer(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %13 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 68, label %11
i32 77, label %12
]
6: ; preds = %1
store i32 1, i32* %2
br label %14
7: ; preds = %1
store i32 5, i32* %2
br label %14
8: ; preds = %1
store i32 10, i32* %2
br label %14
9: ; preds = %1
store i32 50, i32* %2
br label %14
10: ; preds = %1
store i32 100, i32* %2
br label %14
11: ; preds = %1
store i32 500, i32* %2
br label %14
12: ; preds = %1
store i32 1000, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @roman_to_integer(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 73, label %10
i32 86, label %3
i32 88, label %4
i32 76, label %5
i32 67, label %6
i32 68, label %7
i32 77, label %8
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3
%11 = phi i32 [ 0, %9 ], [ 1000, %8 ], [ 500, %7 ], [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %11
}
void oipmi_exit() {}


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

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

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

LLVM IR (-O2):
define void @oipmi_exit() {
ret void
}
extern void simdpreparefpu(void) {}


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

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

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

LLVM IR (-O2):
define void @simdpreparefpu() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int lookup_host(char *);
int main(int argc, char *argv[]) {
  if (argc < 2)
    exit(1);
  return lookup_host(argv[1]);
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    114a <main+0x2a>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <lookup_host@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1130 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1030 <lookup_host@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @lookup_host(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @lookup_host(i8* %8)
ret i32 %9
}
int Athena_IsWindowShown(struct Athena_Window *that) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.Athena_Window = type opaque
define i32 @Athena_IsWindowShown(%struct.Athena_Window* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ClearONOFF();
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_AVR(void) {
  DeinitFields();
  ClearONOFF();
}


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

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

LLVM IR (-O0):
define void @SwitchFrom_AVR() {
%1 = call i32 (...) @DeinitFields()
%2 = call i32 (...) @ClearONOFF()
ret void
}

LLVM IR (-O2):
define void @SwitchFrom_AVR() {
%1 = tail call i32 (...) @DeinitFields()
%2 = tail call i32 (...) @ClearONOFF()
ret void
}
int twolog(s)
int s;
{
  int twopower = 0;
  while ((s >>= 1) != 0)
    twopower++;
  return (twopower);
}


x86 assembly (clang, -O0):
<twolog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <twolog+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <twolog+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<twolog>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <twolog+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <twolog+0x10>
ret

LLVM IR (-O0):
define i32 @twolog(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
store i32 %6, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @twolog(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
long compare_and_swap(long *p, long oldval, long newval) {
  if (*p == oldval) {
    *p = newval;
    return oldval;
  }
  return *p;
}


x86 assembly (clang, -O0):
<compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    1139 <compare_and_swap+0x39>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1144 <compare_and_swap+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap>:
mov    (%rdi),%rax
cmp    %rsi,%rax
jne    110e <compare_and_swap+0xe>
mov    %rdx,(%rdi)
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @compare_and_swap(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64*, i64** %5
%9 = load i64, i64* %8
%10 = load i64, i64* %6
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i64, i64* %7
%14 = load i64*, i64** %5
store i64 %13, i64* %14
%15 = load i64, i64* %6
store i64 %15, i64* %4
br label %19
16: ; preds = %3
%17 = load i64*, i64** %5
%18 = load i64, i64* %17
store i64 %18, i64* %4
br label %19
19: ; preds = %16, %12
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
define i64 @compare_and_swap(i64* nocapture %0, i64 %1, i64 %2) {
%4 = load i64, i64* %0
%5 = icmp eq i64 %4, %1
br i1 %5, label %6, label %7
6: ; preds = %3
store i64 %2, i64* %0
br label %7
7: ; preds = %3, %6
%8 = phi i64 [ %1, %6 ], [ %4, %3 ]
ret i64 %8
}
/* Variables and functions */
char *__ulltoa_internal__(unsigned long long, char *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/);
char *ulltoa(unsigned long long value, char *str, int base) {
  return __ulltoa_internal__(value, str, base, 0, 0);
}


x86 assembly (clang, -O0):
<ulltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <__ulltoa_internal__@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulltoa>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <__ulltoa_internal__@plt>

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

LLVM IR (-O2):
define i8* @ulltoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @__ulltoa_internal__(i64 %0, i8* %1, i32 %2, i32 0, i32 0)
ret i8* %4
}
/* Type definitions */
struct ibat_temp_acc_lut {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int interpolate_acc(struct ibat_temp_acc_lut *ibat_acc_lut, int batt_temp,
                    int ibat) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<interpolate_acc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ec9(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate_acc>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.ibat_temp_acc_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_acc(%struct.ibat_temp_acc_lut* %0, i32 %1, i32 %2) {
%4 = alloca %struct.ibat_temp_acc_lut*
%5 = alloca i32
%6 = alloca i32
store %struct.ibat_temp_acc_lut* %0, %struct.ibat_temp_acc_lut** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.ibat_temp_acc_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_acc(%struct.ibat_temp_acc_lut* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ hl_math_ffloor(double);
int hl_math_floor(double d) { return (int)hl_math_ffloor(d); }


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

x86 assembly (clang, -O2):
<hl_math_floor>:
jmp    1030 <hl_math_ffloor@plt>

LLVM IR (-O0):
define i32 @hl_math_floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @hl_math_ffloor(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @hl_math_floor(double %0) {
%2 = tail call i64 @hl_math_ffloor(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ extension(char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int extension_match_filter(char *filename, char *textcontent) {
  if (strcmp(extension(filename), textcontent) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<extension_match_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <extension@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    115a <extension_match_filter+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <extension_match_filter+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extension_match_filter>:
push   %rbx
mov    %rsi,%rbx
call   1030 <extension@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @extension_match_filter(i8* %0, i8* %1) {
%3 = tail call i32 @extension(i8* %0)
%4 = tail call i64 @strcmp(i32 %3, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t GPIODirModeGet(uint32_t ui32Port, uint8_t ui8Pin) {
  uint32_t ui32Dir, ui32AFSEL;
  ;
  ;
  ui8Pin = 1 << ui8Pin;
  ui32Dir = (*((volatile unsigned long *)(ui32Port + 0x00000400)));
  ui32AFSEL = (*((volatile unsigned long *)(ui32Port + 0x00000420)));
  return (((ui32Dir & ui8Pin) ? 1 : 0) | ((ui32AFSEL & ui8Pin) ? 2 : 0));
}


x86 assembly (clang, -O0):
<GPIODirModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x400,%eax
cltq
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x420,%eax
cltq
mov    (%rax),%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edx
and    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    -0x10(%rbp),%esi
and    -0x8(%rbp),%esi
xor    %ecx,%ecx
mov    $0x2,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIODirModeGet>:
mov    %esi,%ecx
movslq %edi,%rax
mov    0x400(%rax),%rdx
mov    0x420(%rax),%rax
shr    %cl,%edx
and    $0x1,%edx
xor    %esi,%esi
bt     %rcx,%rax
setb   %sil
lea    (%rdx,%rsi,2),%eax
ret

LLVM IR (-O0):
define i32 @GPIODirModeGet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 1, %7
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1024
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = trunc i64 %13 to i32
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1056
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = trunc i64 %19 to i32
store i32 %20, i32* %6
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = and i32 %21, %22
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 1, i32 0
%27 = load i32, i32* %6
%28 = load i32, i32* %4
%29 = and i32 %27, %28
%30 = icmp ne i32 %29, 0
%31 = zext i1 %30 to i64
%32 = select i1 %30, i32 2, i32 0
%33 = or i32 %26, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @GPIODirModeGet(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = add nsw i32 %0, 1024
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = add nsw i32 %0, 1056
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = lshr i32 %8, %1
%15 = and i32 %14, 1
%16 = and i32 %3, %13
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i32 0, i32 2
%19 = or i32 %18, %15
ret i32 %19
}
int count_(int p, int *arr) {
  int count = 0;
  int *_p = arr + p;
  while (*_p == *(arr + p)) {
    ++count;
    ++_p;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x4(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1156 <count_+0x56>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <count_+0x25>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%ecx
lea    (%rsi,%rax,4),%rdx
add    $0x4,%rdx
xor    %eax,%eax
mov    %rax,%rsi
add    $0x1,%rax
cmp    %ecx,(%rdx,%rsi,4)
je     1110 <count_+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
br label %6
6: ; preds = %2, %6
%7 = phi i32* [ %10, %6 ], [ %4, %2 ]
%8 = phi i32 [ %9, %6 ], [ 0, %2 ]
%9 = add nuw nsw i32 %8, 1
%10 = getelementptr inbounds i32, i32* %7, i64 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %5
br i1 %12, label %6, label %13
13: ; preds = %6
ret i32 %9
}
slen(str) char *str;
{
  int k;
  for (k = 0; *str++ != '\0'; k++)
    ;
  return (k);
}


x86 assembly (clang, -O0):
<slen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <slen+0x3d>
jmp    112f <slen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <slen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slen>:
cmpb   $0x0,(%rdi)
je     111c <slen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <slen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @slen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
char *opf_addrto_addr(char *buf) { return buf + 6; }


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

x86 assembly (clang, -O2):
<opf_addrto_addr>:
lea    0x6(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @opf_addrto_addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 6
ret i8* %4
}

LLVM IR (-O2):
define i8* @opf_addrto_addr(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
ret i8* %2
}
int ADD(int i, int j) {
  int ret;
  if (i <= 0)
    ret = j;
  else {
    int b = i - 1;
    int c = j + 1;
    ret = ADD(b, c);
  }
  return ret;
}


x86 assembly (clang, -O0):
<ADD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1133 <ADD+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <ADD+0x43>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <ADD@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADD>:
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ADD(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = select i1 %3, i32 %0, i32 0
%5 = add i32 %4, %1
ret i32 %5
}
void strchomp(char *s) {
  while (*s > 20) {
    s++;
  }
  *s = '\0';
}


x86 assembly (clang, -O0):
<strchomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x14,%eax
jle    1129 <strchomp+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strchomp+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchomp>:
cmpb   $0x14,(%rdi)
lea    0x1(%rdi),%rdi
jg     1100 <strchomp>
movb   $0x0,-0x1(%rdi)
ret

LLVM IR (-O0):
define void @strchomp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sgt i32 %6, 20
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
store i8 0, i8* %12
ret void
}

LLVM IR (-O2):
define void @strchomp(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp sgt i8 %4, 20
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
store i8 0, i8* %3
ret void
}
/* Variables and functions */
unsigned int x86_stepping(unsigned int sig) { return sig & 0xf; }


x86 assembly (clang, -O0):
<x86_stepping>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_stepping>:
mov    %edi,%eax
and    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @x86_stepping(i32 %0) {
%2 = and i32 %0, 15
ret i32 %2
}
int test_imm_8Eint8_mem(signed char *val) {
  return ((*val) & (-0x8E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Eint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff72,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -142
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ VL_ScreenRect(int, int, int, int, int);
void VH_HLine(int x1, int x2, int y, int colour) {
  VL_ScreenRect(x1, y, x2 - x1 + 1, 1, colour);
}


x86 assembly (clang, -O0):
<VH_HLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
sub    -0x4(%rbp),%edx
add    $0x1,%edx
mov    -0x10(%rbp),%r8d
mov    $0x1,%ecx
call   1030 <VL_ScreenRect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VH_HLine>:
mov    %ecx,%r8d
sub    %edi,%esi
lea    0x1(%rsi),%eax
mov    %edx,%esi
mov    %eax,%edx
mov    $0x1,%ecx
jmp    1030 <VL_ScreenRect@plt>

LLVM IR (-O0):
define void @VH_HLine(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %8
%16 = call i32 @VL_ScreenRect(i32 %9, i32 %10, i32 %14, i32 1, i32 %15)
ret void
}

LLVM IR (-O2):
define void @VH_HLine(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = tail call i32 @VL_ScreenRect(i32 %0, i32 %2, i32 %6, i32 1, i32 %3)
ret void
}
/* Variables and functions */
int pow(int, int);
int sin(int);
float ElasticEaseOut(float p) {
  return sin(-13 * 1.57079632679489661923 * (p + 1)) * pow(2, -10 * p) + 1;
}


x86 assembly (clang, -O0):
<ElasticEaseOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecf(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,-0x8(%rbp)
movss  0xea2(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ElasticEaseOut>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
movss  0xecd(%rip),%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xec2(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,%ebx
movss  0xc(%rsp),%xmm0
mulss  0xea5(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
imul   %ebx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @ElasticEaseOut(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 1.000000e+00
%5 = fpext float %4 to double
%6 = fmul double 0xC0346B9C347764A4, %5
%7 = fptosi double %6 to i32
%8 = call i32 @sin(i32 %7)
%9 = load float, float* %2
%10 = fmul float -1.000000e+01, %9
%11 = fptosi float %10 to i32
%12 = call i32 @pow(i32 2, i32 %11)
%13 = mul nsw i32 %8, %12
%14 = add nsw i32 %13, 1
%15 = sitofp i32 %14 to float
ret float %15
}

LLVM IR (-O2):
define float @ElasticEaseOut(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fpext float %2 to double
%4 = fmul double %3, 0xC0346B9C347764A4
%5 = fptosi double %4 to i32
%6 = tail call i32 @sin(i32 %5)
%7 = fmul float %0, -1.000000e+01
%8 = fptosi float %7 to i32
%9 = tail call i32 @pow(i32 2, i32 %8)
%10 = mul nsw i32 %9, %6
%11 = add nsw i32 %10, 1
%12 = sitofp i32 %11 to float
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
void *malloc(int);
void *malloc_wrapper(int size) {
  if (size > 8192)
    abort_crypto_lib("requested humongous malloc!!!!!!!!");
  void *result = malloc(size);
  if (result == 0)
    abort_crypto_lib("Malloc failed");
  return result;
}


x86 assembly (clang, -O0):
<malloc_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2000,-0x4(%rbp)
jle    1144 <malloc_wrapper+0x24>
lea    0xec1(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <malloc_wrapper+0x47>
lea    0xec1(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_wrapper>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2001,%edi
jl     1137 <malloc_wrapper+0x17>
lea    0xece(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
mov    %ebx,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1152 <malloc_wrapper+0x32>
lea    0xed6(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"requested humongous malloc!!!!!!!!\00"
@.str.1 = [14 x i8] c"Malloc failed\00"
define i8* @malloc_wrapper(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 8192
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [35 x i8] c"requested humongous malloc!!!!!!!!\00"
@.str.1 = [14 x i8] c"Malloc failed\00"
define noalias i8* @malloc_wrapper(i32 %0) {
%2 = icmp sgt i32 %0, 8192
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i8* @malloc(i32 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void f() {
  printf("now in f.\n");
  exit(0);
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"now in f.\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
int main() {
  __set_errno(0);
  foo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__set_errno(i32 0)
%2 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old. \n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x48,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"I am %d years old. \0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 72, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"I am %d years old. \0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}
void psoc_clocks(int nclocks) {
  int i;
  while (nclocks--) {
    *(volatile unsigned long *)((void *)0xfffff400 + 0x30) = (1 << (14));
    ;
    asm("nop");
    asm("nop");
    asm("nop");
    asm("nop");
    asm("nop");
    asm("nop");
    *(volatile unsigned long *)((void *)0xfffff400 + 0x34) = (1 << (14));
    ;
    asm("nop");
    asm("nop");
    asm("nop");
    asm("nop");
  }
}


x86 assembly (clang, -O0):
<psoc_clocks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1144 <psoc_clocks+0x44>
mov    $0xfffff400,%eax
movq   $0x4000,0x30(%rax)
nop
nop
nop
nop
nop
nop
mov    $0xfffff400,%eax
movq   $0x4000,0x34(%rax)
nop
nop
nop
nop
jmp    1107 <psoc_clocks+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<psoc_clocks>:
test   %edi,%edi
je     112e <psoc_clocks+0x2e>
mov    $0xfffff430,%eax
nopl   0x0(%rax)
movq   $0x4000,(%rax)
nop
nop
nop
nop
nop
nop
movq   $0x4000,0x4(%rax)
nop
nop
nop
nop
add    $0xffffffff,%edi
jne    1110 <psoc_clocks+0x10>
ret

LLVM IR (-O0):
define void @psoc_clocks(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %9
8: ; preds = %4
store volatile i64 16384, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294964224 to i8*), i64 48) to i64*)
store volatile i64 16384, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294964224 to i8*), i64 52) to i64*)
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @psoc_clocks(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
store volatile i64 16384, i64* inttoptr (i64 4294964272 to i64*)
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
store volatile i64 16384, i64* inttoptr (i64 4294964276 to i64*)
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
void a_and(volatile void *p, int v) {
  __asm__("lock ; and %1, %0" : "=m"(*(int *)p) : "r"(v) : "memory");
}


x86 assembly (clang, -O0):
<a_and>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
lock and %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_and>:
lock and %esi,(%rdi)
ret

LLVM IR (-O0):
define void @a_and(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @a_and(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
tail call void asm "lock ; and $1, $0", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %3, i32 %1)
ret void
}
void EVP_SignFinal(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_SignFinal() {
ret void
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
size_t get_file_size(char *fname) {
  struct stat st;
  if (stat(fname, &st) == 0)
    return st.st_size;
  return -1;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1140 <get_file_size+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <get_file_size+0x38>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %rax,%rax
or     (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @get_file_size(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i64, i64* %9
store i64 %10, i64* %2
br label %12
11: ; preds = %1
store i64 -1, i64* %2
br label %12
12: ; preds = %11, %8
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @get_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 %7, i64 -1
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  for (int i = 1;; i++) {
    printf("%d\n", i);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ bar2();
bar1() { bar2(); }


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

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

LLVM IR (-O0):
define i32 @bar1() {
%1 = alloca i32
%2 = call i32 (...) @bar2()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @bar1() {
%1 = tail call i32 (...) @bar2()
ret i32 undef
}
void *PyThread_get_key_value(int key) {
  void *result;
  return result;
}


x86 assembly (clang, -O0):
<PyThread_get_key_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @PyThread_get_key_value(i32 %0) {
ret i8* undef
}
void sputc(char *str, char ch, int *stringPointer) {
  *(str + *stringPointer) = ch;
  (*stringPointer)++;
}


x86 assembly (clang, -O0):
<sputc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sputc>:
movslq (%rdx),%rax
mov    %sil,(%rdi,%rax,1)
addl   $0x1,(%rdx)
ret

LLVM IR (-O0):
define void @sputc(i8* %0, i8 signext %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32* %2, i32** %6
%7 = load i8, i8* %5
%8 = load i8*, i8** %4
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 %7, i8* %12
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @sputc(i8* nocapture writeonly %0, i8 signext %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %1, i8* %6
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
ret void
}