xunge/DecIR huggingface dataset:
/* Variables and functions */
int get16(unsigned char *);
int /*<<< orphan*/ lprintf(int, char *, ...);
int decode_hazmat(unsigned char *element, int element_len) {
  int un_id;
  if (element_len < 2) {
    lprintf(14, "HAZMAT: Unknown Material\r\n");
  } else {
    un_id = get16(element) & 0x3fff;
    lprintf(14, "HAZMAT: UN%04d\r\n", un_id);
  }
  return 0;
}


x86 assembly (clang, -O0):
<decode_hazmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1151 <decode_hazmat+0x31>
mov    $0xe,%edi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1040 <lprintf@plt>
jmp    1178 <decode_hazmat+0x58>
mov    -0x8(%rbp),%rdi
call   1030 <get16@plt>
and    $0x3fff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    $0xe,%edi
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1040 <lprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_hazmat>:
push   %rax
cmp    $0x1,%esi
jg     113b <decode_hazmat+0x1b>
lea    0xed3(%rip),%rsi
mov    $0xe,%edi
xor    %eax,%eax
call   1040 <lprintf@plt>
jmp    115a <decode_hazmat+0x3a>
call   1030 <get16@plt>
and    $0x3fff,%eax
lea    0xecf(%rip),%rsi
mov    $0xe,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <lprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"HAZMAT: Unknown Material\0D\0A\00"
@.str.1 = [17 x i8] c"HAZMAT: UN%04d\0D\0A\00"
define i32 @decode_hazmat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %16
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @get16(i8* %11)
%13 = and i32 %12, 16383
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"HAZMAT: Unknown Material\0D\0A\00"
@.str.1 = [17 x i8] c"HAZMAT: UN%04d\0D\0A\00"
define i32 @decode_hazmat(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = tail call i32 @get16(i8* %0)
%8 = and i32 %7, 16383
%9 = tail call i32 (i32, i8*, ...) @lprintf(i32 14, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int **copy_int(int **, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ declare_int(int, int);
int **duplicate_int(int **array, int len, int field) {
  return copy_int(array, declare_int(len, field), len, field);
}


x86 assembly (clang, -O0):
<duplicate_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <declare_int@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <copy_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<duplicate_int>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    %edx,%esi
call   1030 <declare_int@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <copy_int@plt>

LLVM IR (-O0):
define i32** @duplicate_int(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 @declare_int(i32 %8, i32 %9)
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32** @copy_int(i32** %7, i32 %10, i32 %11, i32 %12)
ret i32** %13
}

LLVM IR (-O2):
define i32** @duplicate_int(i32** %0, i32 %1, i32 %2) {
%4 = tail call i32 @declare_int(i32 %1, i32 %2)
%5 = tail call i32** @copy_int(i32** %0, i32 %4, i32 %1, i32 %2)
ret i32** %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __u_char;

/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void cbmarch_parallel_burst_write(int f, __u_char c) {
  ioctl(f, _IO(0xcb, 18), c);
}


x86 assembly (clang, -O0):
<cbmarch_parallel_burst_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xcb,%edi
mov    $0x12,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_parallel_burst_write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xcb,%edi
mov    $0x12,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define void @cbmarch_parallel_burst_write(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 @_IO(i32 203, i32 18)
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @cbmarch_parallel_burst_write(i32 %0, i32 %1) {
%3 = tail call i32 @_IO(i32 203, i32 18)
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret void
}
void __attribute__((noreturn)) exit(int status __attribute__((unused))) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <exit+0x7>

x86 assembly (clang, -O2):
<exit>:
jmp    1100 <exit>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
unsigned bool_to_unsigned(_Bool b) { return (unsigned)b; }


x86 assembly (clang, -O0):
<bool_to_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bool_to_unsigned(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @bool_to_unsigned(i1 zeroext %0) {
%2 = zext i1 %0 to i32
ret i32 %2
}
/* Variables and functions */
int __attribute__((__unused__)) isprint(char c) {
  if (c < 0x20)
    return 0;
  if (c > 0x7e)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jge    1123 <isprint+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1143 <isprint+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jle    113c <isprint+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1143 <isprint+0x43>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xe0,%dil
xor    %eax,%eax
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(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
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sgt i32 %10, 126
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %14
13: ; preds = %8
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @isprint(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_13uint8_mem(unsigned char *val) {
  return ((*val) & (-0x13 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_13uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -19
%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_13uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -19
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gtk_tree_view_column_get_fixed_width() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_fixed_width() {
ret void
}
int test_imm_E2uint8_mem(unsigned char *val) {
  return ((*val) & (0xE2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E2uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 226
%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_E2uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -30
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *fcvt(double arg, int ndigits, int *decpt, int *sign) {}


x86 assembly (clang, -O0):
<fcvt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @fcvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
store double %0, double* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @fcvt(double %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sddf() { printf("HELLO\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"HELLO\0A\00"
define void @sddf() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"HELLO\00"
define void @sddf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned uDivTest8(unsigned X, unsigned Y) { return (X / 2) / 4; }


x86 assembly (clang, -O0):
<uDivTest8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
shr    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDivTest8>:
mov    %edi,%eax
shr    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @uDivTest8(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 = udiv i32 %5, 2
%7 = udiv i32 %6, 4
ret i32 %7
}

LLVM IR (-O2):
define i32 @uDivTest8(i32 %0, i32 %1) {
%3 = lshr i32 %0, 3
ret i32 %3
}
int __libc_current_sigrtmin() { return -1; }


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

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

LLVM IR (-O0):
define i32 @__libc_current_sigrtmin() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @__libc_current_sigrtmin() {
ret i32 -1
}
dysize(int y) {
  if ((y % 4) == 0)
    return 366;
  return 365;
}


x86 assembly (clang, -O0):
<dysize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <dysize+0x27>
movl   $0x16e,-0x4(%rbp)
jmp    112e <dysize+0x2e>
movl   $0x16d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dysize>:
and    $0x3,%edi
cmp    $0x1,%edi
mov    $0x16d,%eax
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @dysize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 366, i32* %2
br label %9
8: ; preds = %1
store i32 365, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @dysize(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 366, i32 365
ret i32 %4
}
double ceil(x)
double x;
{
  extern double modf();
  double val;
  return modf(x, &val) > 0 ? val + 1.0 : val;
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1030 <modf@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114f <ceil+0x3f>
movsd  0xec0(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1159 <ceil+0x49>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
push   %rax
mov    %rsp,%rdi
call   1030 <modf@plt>
movsd  (%rsp),%xmm2
movsd  0xeda(%rip),%xmm3
addsd  %xmm2,%xmm3
xorpd  %xmm1,%xmm1
cmpltsd %xmm0,%xmm1
movapd %xmm1,%xmm0
andnpd %xmm2,%xmm0
andpd  %xmm3,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @modf(double %4, double* %3)
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* %3
%9 = fadd double %8, 1.000000e+00
br label %12
10: ; preds = %1
%11 = load double, double* %3
br label %12
12: ; preds = %10, %7
%13 = phi double [ %9, %7 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call double @modf(double %0, double* %2)
%5 = fcmp ogt double %4, 0.000000e+00
%6 = load double, double* %2
%7 = fadd double %6, 1.000000e+00
%8 = select i1 %5, double %7, double %6
ret double %8
}
int test_imm_19int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x19 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_19int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 25
%7 = icmp ne i64 %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_19int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1638400
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
void get_input() {
  char buff[128];
  gets(buff);
  printf("You said: %s\n", buff);
}


x86 assembly (clang, -O0):
<get_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x80(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input>:
push   %rbx
sub    $0x80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"You said: %s\0A\00"
define void @get_input() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"You said: %s\0A\00"
define void @get_input() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t I2CMasterDataGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000008))));
}


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

x86 assembly (clang, -O2):
<I2CMasterDataGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x8(%rax),%rax
ret

LLVM IR (-O0):
define i64 @I2CMasterDataGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @I2CMasterDataGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
float *calloc(int, int);
int main() {
  float *val = calloc(5, sizeof(float));
  val[4] = 123;
  return val[4];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  0xec2(%rip),%xmm0
movss  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
cvttss2si 0x10(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    $0x7b,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float*
store i32 0, i32* %1
%3 = call float* @calloc(i32 5, i32 4)
store float* %3, float** %2
%4 = load float*, float** %2
%5 = getelementptr inbounds float, float* %4, i64 4
store float 1.230000e+02, float* %5
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 4
%8 = load float, float* %7
%9 = fptosi float %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float* @calloc(i32 5, i32 4)
ret i32 123
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char get_random_whitespace_char();
void load_random_whitespace_token(size_t length, char buffer[length]) {
  assert(buffer != NULL);
  for (size_t i = 0; i < length; i++)
    buffer[i] = get_random_whitespace_char();
}


x86 assembly (clang, -O0):
<load_random_whitespace_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    117d <load_random_whitespace_token+0x5d>
mov    $0x0,%al
call   1040 <get_random_whitespace_char@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114a <load_random_whitespace_token+0x2a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_random_whitespace_token>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
test   %r15,%r15
je     1154 <load_random_whitespace_token+0x34>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <get_random_whitespace_char@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <load_random_whitespace_token+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @load_random_whitespace_token(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
store i64 0, i64* %5
br label %11
11: ; preds = %20, %2
%12 = load i64, i64* %5
%13 = load i64, i64* %3
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = call signext i8 (...) @get_random_whitespace_char()
%17 = load i8*, i8** %4
%18 = load i64, i64* %5
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 %16, i8* %19
br label %20
20: ; preds = %15
%21 = load i64, i64* %5
%22 = add i64 %21, 1
store i64 %22, i64* %5
br label %11
23: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @load_random_whitespace_token(i64 %0, i8* writeonly %1) {
%3 = icmp ne i8* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i64 %0, 0
br i1 %6, label %7, label %8
7: ; preds = %8, %2
ret void
8: ; preds = %2, %8
%9 = phi i64 [ %12, %8 ], [ 0, %2 ]
%10 = tail call signext i8 (...) @get_random_whitespace_char()
%11 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 %10, i8* %11
%12 = add nuw i64 %9, 1
%13 = icmp eq i64 %12, %0
br i1 %13, label %7, label %8
}
/* Variables and functions */
double atan2(double, double);
int /*<<< orphan*/ printf(char *, double, ...);
int main() {
  double x, y, ret, val;
  x = -7.0;
  y = 7.0;
  val = 180.0 / 3.14159265;
  ret = atan2(y, x) * val;
  printf("The arc tangent of x = %lf, y = %lf\n", x, y);
  printf("is %lf degrees\n", ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe98(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <atan2@plt>
lea    0xedb(%rip),%rdi
movsd  0xec3(%rip),%xmm0
movsd  0xeb3(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
movsd  0xead(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"The arc tangent of x = %lf, y = %lf\0A\00"
@.str.1 = [16 x i8] c"is %lf degrees\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store double -7.000000e+00, double* %2
store double 7.000000e+00, double* %3
store double 0x404CA5DC1AF05A77, double* %5
%6 = load double, double* %3
%7 = load double, double* %2
%8 = call double @atan2(double %6, double %7)
%9 = load double, double* %5
%10 = fmul double %8, %9
store double %10, double* %4
%11 = load double, double* %2
%12 = load double, double* %3
%13 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %11, double %12)
%14 = load double, double* %4
%15 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"The arc tangent of x = %lf, y = %lf\0A\00"
@.str.1 = [16 x i8] c"is %lf degrees\0A\00"
define i32 @main() {
%1 = tail call double @atan2(double 7.000000e+00, double -7.000000e+00)
%2 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double -7.000000e+00, double 7.000000e+00)
%3 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double 0x4060E0000052D155)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void _cleanup(void) { (void)fflush(NULL); }


x86 assembly (clang, -O0):
<_cleanup>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cleanup>:
xor    %edi,%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
define void @_cleanup() {
%1 = call i32 @fflush(i32* null)
ret void
}

LLVM IR (-O2):
define void @_cleanup() {
%1 = tail call i32 @fflush(i32* null)
ret void
}
void MaybeReadMemoryBarrier() {}


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

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

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

LLVM IR (-O2):
define void @MaybeReadMemoryBarrier() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void D13(void) { printf("Test24\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Test24\0A\00"
define void @D13() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Test24\00"
define void @D13() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getMaxElementValue(int *, int);
int lg(int /*<<< orphan*/, int);
int /*<<< orphan*/ radixSortBinRec(int *, int, int, int);
void radixSortBin(int *a, int n) {
  radixSortBinRec(a, -1, n, 1 << (lg(getMaxElementValue(a, n), 2) - 1));
}


x86 assembly (clang, -O0):
<radixSortBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <getMaxElementValue@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <lg@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0xffffffff,%esi
call   1030 <radixSortBinRec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radixSortBin>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <getMaxElementValue@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <lg@plt>
lea    -0x1(%rax),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <radixSortBinRec@plt>

LLVM IR (-O0):
define void @radixSortBin(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 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @getMaxElementValue(i32* %7, i32 %8)
%10 = call i32 @lg(i32 %9, i32 2)
%11 = sub nsw i32 %10, 1
%12 = shl i32 1, %11
%13 = call i32 @radixSortBinRec(i32* %5, i32 -1, i32 %6, i32 %12)
ret void
}

LLVM IR (-O2):
define void @radixSortBin(i32* %0, i32 %1) {
%3 = tail call i32 @getMaxElementValue(i32* %0, i32 %1)
%4 = tail call i32 @lg(i32 %3, i32 2)
%5 = add nsw i32 %4, -1
%6 = shl nuw i32 1, %5
%7 = tail call i32 @radixSortBinRec(i32* %0, i32 -1, i32 %1, i32 %6)
ret void
}
/* Variables and functions */
int ERR_isError(size_t);
unsigned HUFv06_isError(size_t code) { return ERR_isError(code); }


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

x86 assembly (clang, -O2):
<HUFv06_isError>:
jmp    1030 <ERR_isError@plt>

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

LLVM IR (-O2):
define i32 @HUFv06_isError(i64 %0) {
%2 = tail call i32 @ERR_isError(i64 %0)
ret i32 %2
}
void foo001(int p) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @foo001(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  short x;
};
struct TYPE_4__ {
  TYPE_1__ max_logical_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
void set_XFontSetExtents_max_logical_extent_x(void *_p, short _v) {
  ((XFontSetExtents *)_p)->max_logical_extent.x = (short)_v;
}


x86 assembly (clang, -O0):
<set_XFontSetExtents_max_logical_extent_x>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XFontSetExtents_max_logical_extent_x>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i16 }
define void @set_XFontSetExtents_max_logical_extent_x(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i16 %5, i16* %9
ret void
}

LLVM IR (-O2):
define void @set_XFontSetExtents_max_logical_extent_x(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
int strcmp() { return -1; }


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void exit_with_usage(void) {
  char usage[] = "curse [-s <seed>] [-m round|band]";
  fprintf(stderr, "%s\n", usage);
  exit(1);
}


x86 assembly (clang, -O0):
<exit_with_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x22,%edx
call   1040 <memcpy@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rdx
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_usage>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x5d,0x20(%rsp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
mov    %rsp,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@__const.exit_with_usage.usage = [34 x i8] c"curse [-s <seed>] [-m round|band]\00"
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @exit_with_usage() {
%1 = alloca [34 x i8]
%2 = bitcast [34 x i8]* %1 to i8*
%3 = load i32, i32* @stderr
%4 = getelementptr inbounds [34 x i8], [34 x i8]* %1, i64 0, i64 0
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@__const.exit_with_usage.usage = [34 x i8] c"curse [-s <seed>] [-m round|band]\00"
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @exit_with_usage() {
%1 = alloca [34 x i8]
%2 = getelementptr inbounds [34 x i8], [34 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int dsf_find(int *, int);
int dsf_make_link(int *, int, int);
int dsf_join(int *t, int a, int b) {
  a = dsf_find(t, a);
  b = dsf_find(t, b);
  if (a != b)
    b = dsf_make_link(t, a, b);
  return b;
}


x86 assembly (clang, -O0):
<dsf_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <dsf_find@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <dsf_find@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     116e <dsf_join+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <dsf_make_link@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsf_join>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbx
call   1040 <dsf_find@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <dsf_find@plt>
cmp    %eax,%ebp
jne    1147 <dsf_join+0x27>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <dsf_make_link@plt>

LLVM IR (-O0):
define i32 @dsf_join(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 = call i32 @dsf_find(i32* %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32*, i32** %4
%11 = load i32, i32* %6
%12 = call i32 @dsf_find(i32* %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %3
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i32 @dsf_make_link(i32* %17, i32 %18, i32 %19)
store i32 %20, i32* %6
br label %21
21: ; preds = %16, %3
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @dsf_join(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @dsf_find(i32* %0, i32 %1)
%5 = tail call i32 @dsf_find(i32* %0, i32 %2)
%6 = icmp eq i32 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @dsf_make_link(i32* %0, i32 %4, i32 %5)
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ %8, %7 ], [ %4, %3 ]
ret i32 %10
}
/* Variables and functions */
double randinter(double, double);
double GenerateUniformRandomNumber(double low, double high) {
  return randinter(low, high);
}


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

x86 assembly (clang, -O2):
<GenerateUniformRandomNumber>:
jmp    1030 <randinter@plt>

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

LLVM IR (-O2):
define double @GenerateUniformRandomNumber(double %0, double %1) {
%3 = tail call double @randinter(double %0, double %1)
ret double %3
}
/* Variables and functions */
scalar_t__ alloca(int);
void *test4a(char *);
void __attribute__((no)) __attribute__((noclone)) * test4(void) {
  char *save = (char *)alloca(4);
  return test4a(save);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <test4a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rax
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <test4a@plt>

LLVM IR (-O0):
define i8* @test4() {
%1 = alloca i8*
%2 = call i64 @alloca(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @test4a(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @test4() {
%1 = tail call i64 @alloca(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @test4a(i8* %2)
ret i8* %3
}
int main(int argc, char **argv) {
  static unsigned char gate = 0;
#pragma omp parallel shared(gate)
  {
#pragma omp master
    {
      int i, j;
      for (i = 0; i < 100; i++) {
        for (j = 0; j < 100; j++) {
        }
      }
      gate = 1;
#pragma omp flush
    }
    while (gate == 0)
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    115a <main+0x5a>
movl   $0x0,-0x18(%rbp)
cmpl   $0x64,-0x18(%rbp)
jge    1147 <main+0x47>
jmp    1139 <main+0x39>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <main+0x2a>
jmp    114c <main+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <main+0x19>
movb   $0x1,0x2ec0(%rip)
movzbl 0x2eb9(%rip),%eax
cmp    $0x0,%eax
jne    1176 <main+0x76>
jmp    1161 <main+0x61>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ internal_recv(int, char *, int);
int /*<<< orphan*/ internal_send(int, char *, int);
void syncup(int fd) {
  char s;
  internal_send(fd, &s, sizeof(char));
  internal_recv(fd, &s, sizeof(char));
}


x86 assembly (clang, -O0):
<syncup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1040 <internal_send@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <internal_recv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syncup>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x7(%rsp),%r14
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <internal_send@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <internal_recv@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @syncup(i32 %0) {
%2 = alloca i8
%3 = call i32 @internal_send(i32 %0, i8* %2, i32 1)
%4 = call i32 @internal_recv(i32 %0, i8* %2, i32 1)
ret void
}
I0AX1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (22 <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0AX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
movsd  0xece(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1148 <I0AX1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <I0AX1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0AX1>:
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0xeea(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @I0AX1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %15
%17 = load double, double* %16
%18 = fcmp ole double 2.200000e+01, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @I0AX1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %7
%9 = load double, double* %8
%10 = fcmp oge double %9, 2.200000e+01
%11 = zext i1 %10 to i32
ret i32 %11
}
int smp_call_function_single(int cpuid, void (*func)(void *info), void *info,
                             int retry, int wait) {
  func(info);
  return 0;
}


x86 assembly (clang, -O0):
<smp_call_function_single>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdi
call   *%rax
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_call_function_single>:
push   %rax
mov    %rdx,%rdi
call   *%rsi
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @smp_call_function_single(i32 %0, void (i8*)* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca void (i8*)*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store void (i8*)* %1, void (i8*)** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load void (i8*)*, void (i8*)** %7
%12 = load i8*, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @smp_call_function_single(i32 %0, void (i8*)* nocapture %1, i8* %2, i32 %3, i32 %4) {
tail call void %1(i8* %2)
ret i32 0
}
/* Type definitions */
struct theft_rng {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct theft_rng *);
void theft_rng_free(struct theft_rng *mt) { free(mt); }


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

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

LLVM IR (-O0):
%struct.theft_rng = type { i32 }
define void @theft_rng_free(%struct.theft_rng* %0) {
%2 = alloca %struct.theft_rng*
store %struct.theft_rng* %0, %struct.theft_rng** %2
%3 = load %struct.theft_rng*, %struct.theft_rng** %2
%4 = call i32 @free(%struct.theft_rng* %3)
ret void
}

LLVM IR (-O2):
%struct.theft_rng = type { i32 }
define void @theft_rng_free(%struct.theft_rng* nocapture %0) {
%2 = tail call i32 @free(%struct.theft_rng* %0)
ret void
}
/* Variables and functions */
unsigned short crc16_byte(unsigned short, int /*<<< orphan*/);
unsigned short crc16(unsigned char const *buffer, unsigned int len) {
  unsigned short crc = 0;
  while (len--)
    crc = crc16_byte(crc, *buffer++);
  return crc;
}


x86 assembly (clang, -O0):
<crc16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movw   $0x0,-0xe(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1160 <crc16+0x50>
mov    -0xe(%rbp),%ax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%esi
movzwl %ax,%edi
call   1030 <crc16_byte@plt>
mov    %ax,-0xe(%rbp)
jmp    1125 <crc16+0x15>
movzwl -0xe(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1148 <crc16+0x38>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r14,%rbx,1),%esi
movzwl %ax,%edi
call   1030 <crc16_byte@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <crc16+0x20>
jmp    114a <crc16+0x3a>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define zeroext i16 @crc16(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i16 [ %12, %4 ], [ 0, %2 ]
%6 = phi i32 [ %8, %4 ], [ %1, %2 ]
%7 = phi i8* [ %9, %4 ], [ %0, %2 ]
%8 = add i32 %6, -1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = zext i8 %10 to i32
%12 = tail call zeroext i16 @crc16_byte(i16 zeroext %5, i32 %11)
%13 = icmp eq i32 %8, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i16 [ 0, %2 ], [ %12, %4 ]
ret i16 %15
}
void uth_busywait(void) {}


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

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

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

LLVM IR (-O2):
define void @uth_busywait() {
ret void
}
void cc_arduino_Lifecycle_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @cc_arduino_Lifecycle_targetInit__I() {
ret void
}