xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void UARTFIFOIntLevelGet(uint32_t ui32Base, uint32_t *pui32TxLevel,
                         uint32_t *pui32RxLevel) {
  ;
  *pui32TxLevel = (*((volatile uint16_t *)(ui32Base + 0xA))) & 0x1F;
  *pui32RxLevel = (*((volatile uint16_t *)(ui32Base + 0xB))) & 0x1F;
}


x86 assembly (clang, -O0):
<UARTFIFOIntLevelGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
cltq
mov    (%rax),%ecx
and    $0x1f,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0xb,%eax
cltq
mov    (%rax),%ecx
and    $0x1f,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOIntLevelGet>:
movslq %edi,%rax
mov    0xa(%rax),%ecx
and    $0x1f,%ecx
mov    %ecx,(%rsi)
mov    0xb(%rax),%eax
and    $0x1f,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @UARTFIFOIntLevelGet(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 10
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 31
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 11
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = and i32 %18, 31
%20 = load i32*, i32** %6
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @UARTFIFOIntLevelGet(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = add nsw i32 %0, 10
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 31
store i32 %8, i32* %1
%9 = add nsw i32 %0, 11
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, 31
store i32 %13, i32* %2
ret void
}
/* Variables and functions */
int c(int);
int e(int);
int a(int i) { return e(i) + c(i); }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <e@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <c@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <e@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <c@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @e(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @c(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = tail call i32 @e(i32 %0)
%3 = tail call i32 @c(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
void payment_bitcoin_destroy(int pid_payment) { kill(pid_payment, SIGTERM); }


x86 assembly (clang, -O0):
<payment_bitcoin_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<payment_bitcoin_destroy>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @payment_bitcoin_destroy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = call i32 @kill(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @payment_bitcoin_destroy(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @kill(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int catalan(int);
int /*<<< orphan*/ printf(char *, int, int, int, int);
void test_catalan() {
  int n = 3;
  printf("%d BSTs are possible w/ %d nodes containing [%d..%d]\n", catalan(n),
         n, 1, n);
}


x86 assembly (clang, -O0):
<test_catalan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <catalan@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%r8d
lea    0xeb9(%rip),%rdi
mov    $0x1,%ecx
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_catalan>:
push   %rax
mov    $0x3,%edi
call   1030 <catalan@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
mov    $0x3,%r8d
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"%d BSTs are possible w/ %d nodes containing [%d..%d]\0A\00"
define void @test_catalan() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @catalan(i32 %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 1, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"%d BSTs are possible w/ %d nodes containing [%d..%d]\0A\00"
define void @test_catalan() {
%1 = tail call i32 @catalan(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %1, i32 3, i32 1, i32 3)
ret void
}
/* Variables and functions */
unsigned int test_tree(unsigned int);
int cmain(void) {
  unsigned int i;
  for (i = 1; i < 512; i++) {
    unsigned int rv;
    rv = test_tree(i);
    if (rv != 0)
      return (int)rv;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jae    115f <cmain+0x4f>
mov    -0x8(%rbp),%edi
call   1030 <test_tree@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <cmain+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <cmain+0x56>
jmp    1151 <cmain+0x41>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <cmain+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmain>:
push   %rbx
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <test_tree@plt>
test   %eax,%eax
jne    1138 <cmain+0x28>
lea    0x1(%rbx),%ecx
cmp    $0x1ff,%ebx
mov    %ecx,%ebx
jne    1120 <cmain+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cmain() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = tail call i32 @test_tree(i32 %2)
%4 = icmp ne i32 %3, 0
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 512
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_jmp_T0(int);
int /*<<< orphan*/ gen_op_set_T0_z32(int);
void gen_op_jmp_z32(int val, int label) {
  gen_op_set_T0_z32(val);
  gen_op_jmp_T0(label);
}


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

x86 assembly (clang, -O2):
<gen_op_jmp_z32>:
push   %rbx
mov    %esi,%ebx
call   1030 <gen_op_set_T0_z32@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <gen_op_jmp_T0@plt>

LLVM IR (-O0):
define void @gen_op_jmp_z32(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 = call i32 @gen_op_set_T0_z32(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @gen_op_jmp_T0(i32 %7)
ret void
}

LLVM IR (-O2):
define void @gen_op_jmp_z32(i32 %0, i32 %1) {
%3 = tail call i32 @gen_op_set_T0_z32(i32 %0)
%4 = tail call i32 @gen_op_jmp_T0(i32 %1)
ret void
}
double hypot(double x, double y) { return 4; }


x86 assembly (clang, -O0):
<hypot>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypot>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @hypot(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @hypot(double %0, double %1) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *error) {
  if (error)
    fprintf(stderr, "%s\n", error);
  exit(3);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <die+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
test   %rdi,%rdi
je     113e <die+0x1e>
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @exit(i32 3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ clearbuf();
int /*<<< orphan*/ refresh();
int pressanykey() {
  refresh();
  clearbuf();
}


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

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

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

LLVM IR (-O2):
define i32 @pressanykey() {
%1 = tail call i32 (...) @refresh()
%2 = tail call i32 (...) @clearbuf()
ret i32 undef
}
int test_so_func(int a, int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @test_so_func(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_so_func(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
char is_whitespace(char c) {
  return (c == '\n' || c == '\r' || c == '\t' || c == ' ');
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0xd,%dil
ja     1118 <is_whitespace+0x18>
mov    $0x1,%al
movzbl %dil,%ecx
mov    $0x2600,%edx
bt     %rcx,%rdx
jae    1118 <is_whitespace+0x18>
ret
cmp    $0x20,%dil
sete   %al
ret

LLVM IR (-O0):
define signext i8 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 13
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 13, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 32
%4 = zext i1 %3 to i8
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i8 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ syslog(int, char *, char const *);
void syslog_c(int priority, const char *msg) { syslog(priority, "%s", msg); }


x86 assembly (clang, -O0):
<syslog_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslog_c>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <syslog@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @syslog_c(i32 %0, i8* %1) {
%3 = tail call i32 @syslog(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
double __builtin_arm_vcvtr_d(double, int);
double test_vcvtrd1(double d) { return __builtin_arm_vcvtr_d(d, 1); }


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

x86 assembly (clang, -O2):
<test_vcvtrd1>:
mov    $0x1,%edi
jmp    1030 <__builtin_arm_vcvtr_d@plt>

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

LLVM IR (-O2):
define double @test_vcvtrd1(double %0) {
%2 = tail call double @__builtin_arm_vcvtr_d(double %0, i32 1)
ret double %2
}
int hexNibble(int c) {
  if (c <= '9')
    return c - '0';
  else if (c <= 'F')
    return c - 'A' + 10;
  else
    return c - 'a' + 10;
}


x86 assembly (clang, -O0):
<hexNibble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x39,-0x8(%rbp)
jg     111f <hexNibble+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <hexNibble+0x46>
cmpl   $0x46,-0x8(%rbp)
jg     113a <hexNibble+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <hexNibble+0x46>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexNibble>:
xor    %ecx,%ecx
cmp    $0x47,%edi
setb   %cl
shl    $0x5,%ecx
add    $0xffffffa9,%ecx
cmp    $0x3a,%edi
mov    $0xffffffd0,%eax
cmovge %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @hexNibble(i32 %0) {
%2 = icmp slt i32 %0, 58
%3 = icmp ult i32 %0, 71
%4 = select i1 %3, i32 -55, i32 -87
%5 = select i1 %2, i32 -48, i32 %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
char iterated_bitcount(unsigned int);
void compute_bits_in_16bitsLocal(char *bits_in_16bitsLocal) {
  unsigned int i;
  for (i = 0; i < (0x1u << 16); i++)
    bits_in_16bitsLocal[i] = iterated_bitcount(i);
}


x86 assembly (clang, -O0):
<compute_bits_in_16bitsLocal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10000,-0xc(%rbp)
jae    1152 <compute_bits_in_16bitsLocal+0x42>
mov    -0xc(%rbp),%edi
call   1030 <iterated_bitcount@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <compute_bits_in_16bitsLocal+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_bits_in_16bitsLocal>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <iterated_bitcount@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x10000,%rbx
jne    1120 <compute_bits_in_16bitsLocal+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @compute_bits_in_16bitsLocal(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 65536
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call signext i8 @iterated_bitcount(i32 %8)
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 %9, i8* %13
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @compute_bits_in_16bitsLocal(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = trunc i64 %3 to i32
%5 = tail call signext i8 @iterated_bitcount(i32 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %5, i8* %6
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 65536
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
int ROTL(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) {
  unsigned int g0;
  unsigned char local0;
  unsigned char local1;
  local0 = 1;
  if (argc <= 1) {
    local0 = 0;
  }
  local1 = (char)(local0);
  g0 = (local1);
  printf("Result is %d\n", ROTL(g0) & 0xff);
  g0 = (local1);
  return ROTL(g0) & 0xff;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x1,-0x1d(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     114c <main+0x2c>
movb   $0x0,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
mov    %al,-0x1e(%rbp)
movzbl -0x1e(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <ROTL@plt>
mov    %eax,%esi
and    $0xff,%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1e(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <ROTL@plt>
and    $0xff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x2,%edi
setge  %bl
mov    %ebx,%edi
call   1040 <ROTL@plt>
movzbl %al,%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <ROTL@plt>
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Result is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = icmp sgt i32 %0, 1
%5 = zext i1 %4 to i32
%6 = tail call i32 @ROTL(i32 %5)
%7 = and i32 %6, 255
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @ROTL(i32 %5)
%10 = and i32 %9, 255
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
void init(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
xorps  %xmm2,%xmm2
movsd  0xe8b(%rip),%xmm5
movsd  0xe8b(%rip),%xmm4
movaps %xmm2,%xmm0
movaps %xmm5,%xmm1
movaps %xmm5,%xmm3
call   1040 <glOrtho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
movsd  0xe91(%rip),%xmm4
movsd  0xe91(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm3
movaps %xmm1,%xmm5
pop    %rax
jmp    1040 <glOrtho@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = call i32 @glMatrixMode(i32 %2)
%4 = call i32 (...) @glLoadIdentity()
%5 = call i32 @glOrtho(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = tail call i32 @glMatrixMode(i32 %2)
%4 = tail call i32 (...) @glLoadIdentity()
%5 = tail call i32 @glOrtho(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void parentHandler(int sig) { printf("[parent] received: %d\n", sig); }


x86 assembly (clang, -O0):
<parentHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parentHandler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"[parent] received: %d\0A\00"
define void @parentHandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_header(char *);
void dnd_2hed(void) {
  print_header("Welcome to the Ularn Thrift Shoppe.  We stock many items "
               "explorers find useful ");
  print_header(
      "in their adventures.  Feel free to browse to your heart's content. ");
  print_header("Also be advised that if you break 'em, you pay for 'em.");
}


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

x86 assembly (clang, -O2):
<dnd_2hed>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <print_header@plt>
lea    0xf2c(%rip),%rdi
call   1030 <print_header@plt>
lea    0xf64(%rip),%rdi
pop    %rax
jmp    1030 <print_header@plt>

LLVM IR (-O0):
@.str = [80 x i8] c"Welcome to the Ularn Thrift Shoppe. We stock many items explorers find useful \00"
@.str.1 = [68 x i8] c"in their adventures. Feel free to browse to your heart's content. \00"
@.str.2 = [56 x i8] c"Also be advised that if you break 'em, you pay for 'em.\00"
define void @dnd_2hed() {
%1 = call i32 @print_header(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_header(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @print_header(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [80 x i8] c"Welcome to the Ularn Thrift Shoppe. We stock many items explorers find useful \00"
@.str.1 = [68 x i8] c"in their adventures. Feel free to browse to your heart's content. \00"
@.str.2 = [56 x i8] c"Also be advised that if you break 'em, you pay for 'em.\00"
define void @dnd_2hed() {
%1 = tail call i32 @print_header(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_header(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print_header(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void test_22_2(int *mem) { __atomic_add_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_22_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
lock xadd %eax,(%rdx)
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_22_2>:
lock addl $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_22_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw add i32* %5, i32 %6 acq_rel
%8 = add i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test_22_2(i32* nocapture %0) {
%2 = atomicrmw add i32* %0, i32 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sgb_reset();
void sgb_init() { sgb_reset(); }


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

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

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

LLVM IR (-O2):
define void @sgb_init() {
%1 = tail call i32 (...) @sgb_reset()
ret void
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ printf(char *);
void handler(int sig) {
  if (sig == SIGINT)
    printf("Try harder next time!\n");
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <handler+0x29>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <handler+0x17>
lea    0xede(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [23 x i8] c"Try harder next time!\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [22 x i8] c"Try harder next time!\00"
define void @handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int suzerain_inorder_wavenumber_absmin(const int N) {
  assert(0 < N);
  return (N - 1) / 2;
}


x86 assembly (clang, -O0):
<suzerain_inorder_wavenumber_absmin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suzerain_inorder_wavenumber_absmin>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %ebx,%eax
add    $0xffffffff,%eax
sar    %eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @suzerain_inorder_wavenumber_absmin(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = add nsw i32 %0, -1
%6 = sdiv i32 %5, 2
ret i32 %6
}
int Bematech_FI_ValorPagoUltimoCupom(Var, Retorno) {
  return Formata("\x1b|35|22|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_ValorPagoUltimoCupom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_ValorPagoUltimoCupom>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|22|\1B\00"
define i32 @Bematech_FI_ValorPagoUltimoCupom(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 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|22|\1B\00"
define i32 @Bematech_FI_ValorPagoUltimoCupom(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
int test_imm_69uint16_reg(unsigned short val) {
  return ((val) & (-0x69 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_69uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff97,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_69uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -105
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MIDI_SetSongPosition(int, int, int);
void MUSIC_SetSongPosition(int measure, int beat, int tick) {
  MIDI_SetSongPosition(measure, beat, tick);
}


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

x86 assembly (clang, -O2):
<MUSIC_SetSongPosition>:
jmp    1030 <MIDI_SetSongPosition@plt>

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

LLVM IR (-O2):
define void @MUSIC_SetSongPosition(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @MIDI_SetSongPosition(i32 %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
void send_poll(fd_set *fdsw) {}


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

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

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

LLVM IR (-O2):
define void @send_poll(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ stdout;
void latency_calculate(uint64_t count, uint64_t dur_ms, uint64_t total_ms) {
  double sec, lat;
  sec = (double)total_ms / (double)1000;
  lat = ((double)dur_ms * 1000000) / (double)count;
  printf("%8.1fs  %13.1f\n", sec, lat);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<latency_calculate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<latency_calculate>:
push   %rax
cvtsi2sd %rdx,%xmm0
divsd  0xed2(%rip),%xmm0
cvtsi2sd %rsi,%xmm1
mulsd  0xecd(%rip),%xmm1
cvtsi2sd %rdi,%xmm2
divsd  %xmm2,%xmm1
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%8.1fs %13.1f\0A\00"
@stdout = global i32 0
define void @latency_calculate(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca double
%8 = alloca double
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+03
store double %11, double* %7
%12 = load i64, i64* %5
%13 = sitofp i64 %12 to double
%14 = fmul double %13, 1.000000e+06
%15 = load i64, i64* %4
%16 = sitofp i64 %15 to double
%17 = fdiv double %14, %16
store double %17, double* %8
%18 = load double, double* %7
%19 = load double, double* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %18, double %19)
%21 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%8.1fs %13.1f\0A\00"
@stdout = global i32 0
define void @latency_calculate(i64 %0, i64 %1, i64 %2) {
%4 = sitofp i64 %2 to double
%5 = fdiv double %4, 1.000000e+03
%6 = sitofp i64 %1 to double
%7 = fmul double %6, 1.000000e+06
%8 = sitofp i64 %0 to double
%9 = fdiv double %7, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %5, double %9)
%11 = load i32, i32* @stdout
%12 = tail call i32 @fflush(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_disconnect();
void lib_create_disconnect() { create_disconnect(); }


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

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

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

LLVM IR (-O2):
define void @lib_create_disconnect() {
%1 = tail call i32 (...) @create_disconnect()
ret void
}
/* Variables and functions */
unsigned int RSHash(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strlen(unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char *str = argv[1];
  unsigned int hash = RSHash(str, strlen(str));
  if (hash == 0x4d248f4a)
    printf("You win!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1050 <RSHash@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x4d248f4a,-0x1c(%rbp)
jne    118a <main+0x5a>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <RSHash@plt>
cmp    $0x4d248f4a,%eax
jne    115a <main+0x2a>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"You win!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @RSHash(i8* %11, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 1294241610
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"You win!\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 @strlen(i8* %4)
%6 = tail call i32 @RSHash(i8* %4, i32 %5)
%7 = icmp eq i32 %6, 1294241610
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}
void periodic_1Hz_demo(void) { {}; }


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

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

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

LLVM IR (-O2):
define void @periodic_1Hz_demo() {
ret void
}
__attribute__((const)) int baz(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @baz(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
unsigned int s5p_sdhci_init(unsigned int, int, int, int);
int samsung_get_base_mmc();
unsigned int s5p_mmc_init(int index, int bus_width) {
  unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
  return s5p_sdhci_init(base, 52000000, 400000, index);
}


x86 assembly (clang, -O0):
<s5p_mmc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <samsung_get_base_mmc@plt>
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%ecx
mov    $0x3197500,%esi
mov    $0x61a80,%edx
call   1030 <s5p_sdhci_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s5p_mmc_init>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <samsung_get_base_mmc@plt>
mov    %ebx,%edi
shl    $0x10,%edi
add    %eax,%edi
mov    $0x3197500,%esi
mov    $0x61a80,%edx
mov    %ebx,%ecx
pop    %rbx
jmp    1030 <s5p_sdhci_init@plt>

LLVM IR (-O0):
define i32 @s5p_mmc_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @samsung_get_base_mmc()
%7 = load i32, i32* %3
%8 = mul nsw i32 65536, %7
%9 = add nsw i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = call i32 @s5p_sdhci_init(i32 %10, i32 52000000, i32 400000, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @s5p_mmc_init(i32 %0, i32 %1) {
%3 = tail call i32 (...) @samsung_get_base_mmc()
%4 = shl nsw i32 %0, 16
%5 = add nsw i32 %3, %4
%6 = tail call i32 @s5p_sdhci_init(i32 %5, i32 52000000, i32 400000, i32 %0)
ret i32 %6
}
unsigned short test1(unsigned short w) {
  if ((w & 0xff00) == 0) {
    if (w == 0)
      w = 2;
  }
  return w;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff00,%eax
cmp    $0x0,%eax
jne    1135 <test1+0x35>
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1130 <test1+0x30>
movw   $0x2,-0x2(%rbp)
jmp    1135 <test1+0x35>
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   %edi,%edi
mov    $0x2,%eax
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @test1(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
%3 = select i1 %2, i16 2, i16 %0
ret i16 %3
}
/* Variables and functions */
void *malloc(size_t);
void *hoof_hook_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<hoof_hook_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @hoof_hook_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int fun634() { return 634; }


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

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

LLVM IR (-O0):
define i32 @fun634() {
ret i32 634
}

LLVM IR (-O2):
define i32 @fun634() {
ret i32 634
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int O_SYNC;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ execute_program();
int open(char *, int, int);
int /*<<< orphan*/ write(int, void *, int);
void load_program(void *buf) {
  int payload_file;
  payload_file = open("/tmp/fuzzing_engine", O_RDWR | O_CREAT | O_SYNC, 0777);
  write(payload_file, buf, (16 << 20));
  close(payload_file);
  execute_program();
}


x86 assembly (clang, -O0):
<load_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
or     (%rax),%esi
mov    0x2e73(%rip),%rax
or     (%rax),%esi
lea    0xe92(%rip),%rdi
mov    $0x1ff,%edx
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    $0x1000000,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    $0x0,%al
call   1050 <execute_program@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_program>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e96(%rip),%rax
mov    0x2ea7(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rdi,%rbx
mov    0x2e79(%rip),%rax
or     (%rax),%esi
lea    0xe98(%rip),%rdi
mov    $0x1ff,%edx
call   1060 <open@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x1000000,%edx
call   1030 <write@plt>
mov    %ebp,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <execute_program@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"/tmp/fuzzing_engine\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_SYNC = global i32 0
define void @load_program(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = load i32, i32* @O_SYNC
%8 = or i32 %6, %7
%9 = call i32 @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8, i32 511)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i8*, i8** %2
%12 = call i32 @write(i32 %10, i8* %11, i32 16777216)
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
%15 = call i32 (...) @execute_program()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"/tmp/fuzzing_engine\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_SYNC = global i32 0
define void @load_program(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @O_SYNC
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6, i32 511)
%8 = tail call i32 @write(i32 %7, i8* %0, i32 16777216)
%9 = tail call i32 @close(i32 %7)
%10 = tail call i32 (...) @execute_program()
ret void
}