xunge/DecIR huggingface dataset:
void recur(int i, char *p) {
  char a[1024];
  *p = '\0';
  if (i > 0) {
    recur(i - 1, a);
  }
}


x86 assembly (clang, -O0):
<recur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <recur+0x35>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
lea    -0x410(%rbp),%rsi
call   1030 <recur@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recur>:
sub    $0x408,%rsp
movb   $0x0,(%rsi)
test   %edi,%edi
jle    1129 <recur+0x19>
add    $0xffffffff,%edi
mov    %rsp,%rsi
call   1030 <recur@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
define void @recur(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8 0, i8* %6
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
br label %13
13: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @recur(i32 %0, i8* nocapture writeonly %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
store i8 0, i8* %1
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = add nsw i32 %0, -1
br label %8
8: ; preds = %6, %2
ret void
}
char eval_A(int i, int j) { return (char)(12 / (i * j)); }


x86 assembly (clang, -O0):
<eval_A>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    $0xc,%eax
cltd
idiv   %ecx
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_A>:
imul   %esi,%edi
mov    $0xc,%eax
xor    %edx,%edx
idiv   %edi
ret

LLVM IR (-O0):
define signext i8 @eval_A(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
%8 = sdiv i32 12, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @eval_A(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sdiv i32 12, %3
%5 = trunc i32 %4 to i8
ret i8 %5
}
void to_my_4(int value, char *m) {
  m[3] = value >> 24;
  m[2] = value >> 16;
  m[1] = value >> 8;
  m[0] = value;
}


x86 assembly (clang, -O0):
<to_my_4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_my_4>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @to_my_4(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 = ashr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 3
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8 %12, i8* %14
%15 = load i32, i32* %3
%16 = ashr i32 %15, 8
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
%20 = load i32, i32* %3
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @to_my_4(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %4, i8* %5
%6 = lshr i32 %0, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %7, i8* %8
%9 = lshr i32 %0, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %10, i8* %11
%12 = trunc i32 %0 to i8
store i8 %12, i8* %1
ret void
}
int isupper(int c) { return (unsigned)c - 'A' < 26; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
cmp    $0x1a,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 65
%5 = icmp ult i32 %4, 26
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bub_sort(int *, int);
int /*<<< orphan*/ print_arr(int *, int);
int main(void) {
  int arr[8] = {2, 78, 90, 23, 10, 26, 99, 1};
  print_arr(arr, 8);
  bub_sort(arr, 8);
  print_arr(arr, 8);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1030 <print_arr@plt>
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1040 <bub_sort@plt>
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1030 <print_arr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <print_arr@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <bub_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <print_arr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [8 x i32] [i32 2, i32 78, i32 90, i32 23, i32 10, i32 26, i32 99, i32 1]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_arr(i32* %3, i32 8)
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = call i32 @bub_sort(i32* %5, i32 8)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%8 = call i32 @print_arr(i32* %7, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [8 x i32] [i32 2, i32 78, i32 90, i32 23, i32 10, i32 26, i32 99, i32 1]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_arr(i32* %3, i32 8)
%5 = call i32 @bub_sort(i32* %3, i32 8)
%6 = call i32 @print_arr(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
char EOF;
int /*<<< orphan*/ dec_do_bin(char);
char getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  char z;
  z = getchar();
  printf("\n");
  while (z != EOF) {
    dec_do_bin(z);
    printf("\n");
    z = getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    0x2e88(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     118f <main+0x5f>
movsbl -0x5(%rbp),%edi
call   1050 <dec_do_bin@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
jmp    1155 <main+0x25>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e9a(%rip),%r14
cmp    (%r14),%bl
je     1180 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %bl,%edi
call   1050 <dec_do_bin@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call i32 @putchar(i32 10)
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %1, %3
br i1 %4, label %12, label %5
5: ; preds = %0, %5
%6 = phi i8 [ %9, %5 ], [ %1, %0 ]
%7 = tail call i32 @dec_do_bin(i8 signext %6)
%8 = tail call i32 @putchar(i32 10)
%9 = tail call signext i8 (...) @getchar()
%10 = load i8, i8* @EOF
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %5
12: ; preds = %5, %0
ret i32 0
}
int is_whitespace(char c) {
  return ((c == ' ') || (c == '\t') || (c == '\r') || (c == '\n'));
}


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    $0x20,%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),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%dil
ja     1120 <is_whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    1120 <is_whitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @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, 32
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, 9
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, 13
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, 10
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
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int test_six(int SIX_6666) { return SIX_6666; }


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

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

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

LLVM IR (-O2):
define i32 @test_six(i32 returned %0) {
ret i32 %0
}
void s3c_cfcon_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_cfcon_setname(i8* nocapture %0) {
ret void
}
int wip_pwm_validate_ch(int ch) {
  if ((ch < 0) || (ch >= 2)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<wip_pwm_validate_ch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111b <wip_pwm_validate_ch+0x1b>
cmpl   $0x2,-0x8(%rbp)
jl     1127 <wip_pwm_validate_ch+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    112e <wip_pwm_validate_ch+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wip_pwm_validate_ch>:
xor    %eax,%eax
cmp    $0x2,%edi
adc    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @wip_pwm_validate_ch(i32 %0) {
%2 = icmp ugt i32 %0, 1
%3 = sext i1 %2 to i32
ret i32 %3
}
long fun_long(void) { return 9; }


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

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

LLVM IR (-O0):
define i64 @fun_long() {
ret i64 9
}

LLVM IR (-O2):
define i64 @fun_long() {
ret i64 9
}
int test_imm_91uint16_reg(unsigned short val) {
  return ((val) & (0x91 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_91uint16_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, 145
%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_91uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 145
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void NV21ToRAW() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h48_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintHelp(void) {
  printf("Usage: checksum [-e filename] [-t filename]\n");
  printf("    -e filename       compute checksum on all files in filname\n");
  printf("    -t filename       test checksum on all files in filname\n");
}


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

x86 assembly (clang, -O2):
<PrintHelp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: checksum [-e filename] [-t filename]\0A\00"
@.str.1 = [64 x i8] c" -e filename compute checksum on all files in filname\0A\00"
@.str.2 = [61 x i8] c" -t filename test checksum on all files in filname\0A\00"
define void @PrintHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c"Usage: checksum [-e filename] [-t filename]\00"
@str.3 = [63 x i8] c" -e filename compute checksum on all files in filname\00"
@str.4 = [60 x i8] c" -t filename test checksum on all files in filname\00"
define void @PrintHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.4, i64 0, i64 0))
ret void
}
void mdp4_primary_rdptr(void) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_primary_rdptr() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_read_standard_random_coefficient_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(97, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_read_standard_random_coefficient_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x61,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_read_standard_random_coefficient_system>:
mov    $0x61,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_read_standard_random_coefficient_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 97, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_read_standard_random_coefficient_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 97, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
void print_array(int *arr, int n) {
  int i;
  for (i = 0; i < n; i++) {
    __print_int(arr[i]);
  }
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <print_array+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <__print_int@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <print_array+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <__print_int@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @__print_int(i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void foo657() {}


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

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

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

LLVM IR (-O2):
define void @foo657() {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t mil_int_max(int32_t a, int32_t b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<mil_int_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <mil_int_max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <mil_int_max+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mil_int_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @mil_int_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(void *, int, int, int /*<<< orphan*/ *);
int write_buffer(char *file_name, void *buf, int size) {
  FILE *f;
  if (!(f = fopen(file_name, "wb")))
    return 0;
  fwrite(buf, size, 1, f);
  fclose(f);
  return 1;
}


x86 assembly (clang, -O0):
<write_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    116d <write_buffer+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1192 <write_buffer+0x62>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_buffer>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
lea    0xebc(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1173 <write_buffer+0x43>
mov    %rax,%rbx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
jmp    1175 <write_buffer+0x45>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define i32 @write_buffer(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %5
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %8
%11 = icmp ne i32* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
store i32 0, i32* %4
br label %20
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = load i32*, i32** %8
%17 = call i32 @fwrite(i8* %14, i32 %15, i32 1, i32* %16)
%18 = load i32*, i32** %8
%19 = call i32 @fclose(i32* %18)
store i32 1, i32* %4
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @write_buffer(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @fwrite(i8* %1, i32 %2, i32 1, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ __poet_fail();
void *nondet(int, int);
int main(void) {
  int x = nondet(-10, -1);
  unsigned y = nondet(10, 20);
  if (x >= 15)
    __poet_fail();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xfffffff6,%edi
mov    $0xffffffff,%esi
call   1040 <nondet@plt>
mov    %eax,-0x8(%rbp)
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <nondet@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xf,-0x8(%rbp)
jl     1164 <main+0x44>
mov    $0x0,%al
call   1030 <__poet_fail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xfffffff6,%edi
mov    $0xffffffff,%esi
call   1040 <nondet@plt>
mov    %rax,%rbx
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <nondet@plt>
cmp    $0xf,%ebx
jl     114e <main+0x2e>
xor    %eax,%eax
call   1030 <__poet_fail@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i8* @nondet(i32 -10, i32 -1)
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %2
%6 = call i8* @nondet(i32 10, i32 20)
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 15
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @__poet_fail()
br label %12
12: ; preds = %10, %0
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @nondet(i32 -10, i32 -1)
%2 = ptrtoint i8* %1 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i8* @nondet(i32 10, i32 20)
%5 = icmp sgt i32 %3, 14
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 (...) @__poet_fail()
br label %8
8: ; preds = %6, %0
ret i32 0
}
digit(c) char c;
{ return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
shl    $0x18,%edi
add    $0xd0ffffff,%edi
xor    %eax,%eax
cmp    $0xaffffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @digit(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -788529153
%4 = icmp ult i32 %3, 184549375
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int dir_mutex_lock(int);
int /*<<< orphan*/ dir_mutex_unlock();
int readlink(char const *, char *, size_t);
ssize_t readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz) {
  int rc;
  rc = dir_mutex_lock(dirfd);
  if (rc < 0)
    return rc;
  rc = readlink(pathname, buf, bufsiz);
  dir_mutex_unlock();
  return rc;
}


x86 assembly (clang, -O0):
<readlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <dir_mutex_lock@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1167 <readlinkat+0x37>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <readlinkat+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <readlink@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1050 <dir_mutex_unlock@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlinkat>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
call   1040 <dir_mutex_lock@plt>
test   %eax,%eax
js     1160 <readlinkat+0x30>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <readlink@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dir_mutex_unlock@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @readlinkat(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%11 = load i32, i32* %6
%12 = call i32 @dir_mutex_lock(i32 %11)
store i32 %12, i32* %10
%13 = load i32, i32* %10
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %4
%16 = load i32, i32* %10
store i32 %16, i32* %5
br label %24
17: ; preds = %4
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = load i64, i64* %9
%21 = call i32 @readlink(i8* %18, i8* %19, i64 %20)
store i32 %21, i32* %10
%22 = call i32 (...) @dir_mutex_unlock()
%23 = load i32, i32* %10
store i32 %23, i32* %5
br label %24
24: ; preds = %17, %15
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @readlinkat(i32 %0, i8* nocapture %1, i8* nocapture %2, i64 %3) {
%5 = tail call i32 @dir_mutex_lock(i32 %0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @readlink(i8* %1, i8* %2, i64 %3)
%9 = tail call i32 (...) @dir_mutex_unlock()
br label %10
10: ; preds = %4, %7
%11 = phi i32 [ %8, %7 ], [ %5, %4 ]
ret i32 %11
}
/* Variables and functions */
double cerf_experimental_integration(int, double, double);
double cerf_experimental_imw(double x, double y) {
  return cerf_experimental_integration(1, x, y);
}


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

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

LLVM IR (-O0):
define double @cerf_experimental_imw(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 @cerf_experimental_integration(i32 1, double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @cerf_experimental_imw(double %0, double %1) {
%3 = tail call double @cerf_experimental_integration(i32 1, double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_115(void) {
  if ((*(uint32_t *)0x10000130ul == 0x8ul) &&
      (*(uint32_t *)0x10000134ul == 0x0ul)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_115>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1134 <errata_115+0x34>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_115+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <errata_115+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_115>:
cmpl   $0x8,0x10000130
08
jne    1114 <errata_115+0x14>
cmpl   $0x0,0x10000134
je     1117 <errata_115+0x17>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @errata_115() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 8
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %11
10: ; preds = %5, %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @errata_115() {
%1 = load i32, i32* inttoptr (i64 268435760 to i32*)
%2 = icmp eq i32 %1, 8
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 268435764 to i32*)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strdup_(char *s) {
  char *p;
  p = malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<strdup_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup_+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @strdup_(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @strdup_(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
scalar_t__ between(double, double, double);
int point_between(double ax, double ay, double px, double py, double bx,
                  double by) {
  return between(ax, px, bx) && between(ay, px, by);
}


x86 assembly (clang, -O0):
<point_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <between@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x31(%rbp)
je     117a <point_between+0x6a>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
call   1030 <between@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_between>:
sub    $0x18,%rsp
movsd  %xmm5,0x10(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm2,0x8(%rsp)
movaps %xmm2,%xmm1
movaps %xmm4,%xmm2
call   1030 <between@plt>
test   %rax,%rax
je     115b <point_between+0x4b>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1030 <between@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x18,%rsp
ret
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @point_between(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %9
%15 = load double, double* %11
%16 = call i64 @between(double %13, double %14, double %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %6
%19 = load double, double* %8
%20 = load double, double* %9
%21 = load double, double* %12
%22 = call i64 @between(double %19, double %20, double %21)
%23 = icmp ne i64 %22, 0
br label %24
24: ; preds = %18, %6
%25 = phi i1 [ false, %6 ], [ %23, %18 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @point_between(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i64 @between(double %0, double %2, double %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i64 @between(double %1, double %2, double %5)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6
%14 = phi i32 [ 0, %6 ], [ %12, %9 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ input_delete_nofollow_chars(int);
void del_char_right(char *dummy) { input_delete_nofollow_chars(1); }


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

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

LLVM IR (-O0):
define void @del_char_right(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @input_delete_nofollow_chars(i32 1)
ret void
}

LLVM IR (-O2):
define void @del_char_right(i8* nocapture readnone %0) {
%2 = tail call i32 @input_delete_nofollow_chars(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_shmat;
scalar_t__ syscall(int /*<<< orphan*/, int, void const *, int);
void *shmat(int shmid, const void *shmaddr, int shmflg) {
  return (void *)syscall(__NR_shmat, shmid, shmaddr, shmflg);
}


x86 assembly (clang, -O0):
<shmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmat>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_shmat = global i32 0
define i8* @shmat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_shmat
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i64 @syscall(i32 %7, i32 %8, i8* %9, i32 %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
@__NR_shmat = global i32 0
define i8* @shmat(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @__NR_shmat
%5 = tail call i64 @syscall(i32 %4, i32 %0, i8* %1, i32 %2)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ rpi_i2c_set_reg(int, int, int);
void adxl345_init() {
  rpi_i2c_set_reg(0x53, 0x2D, 0);
  rpi_i2c_set_reg(0x53, 0x2D, 32 | 8);
  rpi_i2c_set_reg(0x53, 0x2E, 0);
  rpi_i2c_set_reg(0x53, 0x37, 0 | 16);
  rpi_i2c_set_reg(0x53, 0x2C, 10);
  rpi_i2c_set_reg(0x53, 0x31, 0);
  rpi_i2c_set_reg(0x53, 0x31, 8 | 3);
}


x86 assembly (clang, -O0):
<adxl345_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53,%edi
mov    $0x2d,%esi
xor    %edx,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x2d,%esi
mov    $0x28,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x2e,%esi
xor    %edx,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x37,%esi
mov    $0x10,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x2c,%esi
mov    $0xa,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x31,%esi
xor    %edx,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x31,%esi
mov    $0xb,%edx
call   1030 <rpi_i2c_set_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adxl345_init>:
push   %rax
mov    $0x53,%edi
mov    $0x2d,%esi
xor    %edx,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x2d,%esi
mov    $0x28,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x2e,%esi
xor    %edx,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x37,%esi
mov    $0x10,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x2c,%esi
mov    $0xa,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x31,%esi
xor    %edx,%edx
call   1030 <rpi_i2c_set_reg@plt>
mov    $0x53,%edi
mov    $0x31,%esi
mov    $0xb,%edx
pop    %rax
jmp    1030 <rpi_i2c_set_reg@plt>

LLVM IR (-O0):
define void @adxl345_init() {
%1 = call i32 @rpi_i2c_set_reg(i32 83, i32 45, i32 0)
%2 = call i32 @rpi_i2c_set_reg(i32 83, i32 45, i32 40)
%3 = call i32 @rpi_i2c_set_reg(i32 83, i32 46, i32 0)
%4 = call i32 @rpi_i2c_set_reg(i32 83, i32 55, i32 16)
%5 = call i32 @rpi_i2c_set_reg(i32 83, i32 44, i32 10)
%6 = call i32 @rpi_i2c_set_reg(i32 83, i32 49, i32 0)
%7 = call i32 @rpi_i2c_set_reg(i32 83, i32 49, i32 11)
ret void
}

LLVM IR (-O2):
define void @adxl345_init() {
%1 = tail call i32 @rpi_i2c_set_reg(i32 83, i32 45, i32 0)
%2 = tail call i32 @rpi_i2c_set_reg(i32 83, i32 45, i32 40)
%3 = tail call i32 @rpi_i2c_set_reg(i32 83, i32 46, i32 0)
%4 = tail call i32 @rpi_i2c_set_reg(i32 83, i32 55, i32 16)
%5 = tail call i32 @rpi_i2c_set_reg(i32 83, i32 44, i32 10)
%6 = tail call i32 @rpi_i2c_set_reg(i32 83, i32 49, i32 0)
%7 = tail call i32 @rpi_i2c_set_reg(i32 83, i32 49, i32 11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void swap(uint16_t *a, uint16_t *b) {
  uint16_t t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void skyriseTrajectory() {}


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

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

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

LLVM IR (-O2):
define void @skyriseTrajectory() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() {
  printf("fdspatch 1.0.0\n"
         "Licensed under the GNU General Public License, version 2\n"
         "Please report any bugs to vrai.stacey@gmail.com\n");
}


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

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

LLVM IR (-O0):
@.str = [121 x i8] c"fdspatch 1.0.0\0ALicensed under the GNU General Public License, version 2\0APlease report any bugs to vrai.stacey@gmail.com\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [120 x i8] c"fdspatch 1.0.0\0ALicensed under the GNU General Public License, version 2\0APlease report any bugs to vrai.stacey@gmail.com\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([120 x i8], [120 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_87int16_reg(short val) {
  return ((val) & (0x87 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_87int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 135
%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_87int16_reg(i16 signext %0) {
%2 = and i16 %0, 135
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
void uDMAChannelSelectDefault(uint32_t ui32DefPeriphs) {
  (*((volatile uint32_t *)(0x400FF500))) &= ~ui32DefPeriphs;
}


x86 assembly (clang, -O0):
<uDMAChannelSelectDefault>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    $0x400ff500,%ecx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    $0x400ff500,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelSelectDefault>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
not    %eax
and    %eax,0x400ff500
ret

LLVM IR (-O0):
define void @uDMAChannelSelectDefault(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* inttoptr (i64 1074787584 to i32*)
%6 = and i32 %5, %4
store volatile i32 %6, i32* inttoptr (i64 1074787584 to i32*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelSelectDefault(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* inttoptr (i64 1074787584 to i32*)
%6 = and i32 %5, %4
store volatile i32 %6, i32* inttoptr (i64 1074787584 to i32*)
ret void
}
void f_stdarg2(const char *s, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @f_stdarg2(i8* nocapture %0, ...) {
ret void
}