xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t strLen(char const *);
int /*<<< orphan*/ vga_pushChar(char const);
void vga_pushString(const char *string) {
  size_t stringLength = strLen(string);
  for (size_t i = 0; i < stringLength; i++) {
    vga_pushChar(string[i]);
  }
}


x86 assembly (clang, -O0):
<vga_pushString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strLen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1171 <vga_pushString+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <vga_pushChar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <vga_pushString+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_pushString>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strLen@plt>
test   %rax,%rax
je     1153 <vga_pushString+0x33>
mov    %rax,%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <vga_pushChar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <vga_pushString+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @vga_pushString(i8* %0) {
%2 = tail call i64 @strLen(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @vga_pushChar(i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xf0() {
  Assert_real((isascii(240) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              1205, ("isascii should be 0 for 0xf0"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xf0\00"
define void @t_isascii_0xf0() {
%1 = call i64 @isascii(i32 240)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1205, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xf0\00"
define void @t_isascii_0xf0() {
%1 = tail call i64 @isascii(i32 240)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1205, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_E4int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xE4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E4int64_highword_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, 32
%6 = and i64 %5, 228
%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_E4int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 979252543488
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
int qh_strtol(const char *s, char **endp) {
  int result;
  result = (int)strtol(s, endp, 10);
  if (s < (*endp) && (*endp)[-1] == ' ')
    (*endp)--;
  return result;
}


x86 assembly (clang, -O0):
<qh_strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jae    1168 <qh_strtol+0x58>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
jne    1168 <qh_strtol+0x58>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qh_strtol>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    (%r14),%rcx
cmp    %rbx,%rcx
jbe    1139 <qh_strtol+0x29>
cmpb   $0x20,-0x1(%rcx)
jne    1139 <qh_strtol+0x29>
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @qh_strtol(i8* %0, i8** nocapture %1) {
%3 = tail call i64 @strtol(i8* %0, i8** %1, i32 10)
%4 = load i8*, i8** %1
%5 = icmp ugt i8* %4, %0
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %4, i64 -1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %10, label %11
10: ; preds = %6
store i8* %7, i8** %1
br label %11
11: ; preds = %10, %6, %2
%12 = trunc i64 %3 to i32
ret i32 %12
}
int test_imm_FFint16_reg(short val) {
  return ((val) & (-0xFF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FFint16_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, -255
%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_FFint16_reg(i16 signext %0) {
%2 = and i16 %0, -255
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int do_test(void) {
  int result = 0;
  return result;
}


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

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

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

LLVM IR (-O2):
define i32 @do_test() {
ret i32 0
}
int awesome_cmp(void *a, void *b) { return *(int *)a - *(int *)b; }


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

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

LLVM IR (-O0):
define i32 @awesome_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @awesome_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void test1_ptr_arith_ok2(int x) {
  int buf[100];
  int *p = buf;
  p = p + 99;
  p[-1] = 1;
}


x86 assembly (clang, -O0):
<test1_ptr_arith_ok2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rax
add    $0x18c,%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rax
movl   $0x1,-0x4(%rax)
add    $0x130,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1_ptr_arith_ok2(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i32]
%4 = alloca i32*
store i32 %0, i32* %2
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
store i32* %5, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 99
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 -1
store i32 1, i32* %9
ret void
}

LLVM IR (-O2):
define void @test1_ptr_arith_ok2(i32 %0) {
ret void
}
main() { return (int){1} + (int){3}; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
int main(void) {
  int a;
  a = 0 ?: 3;
  switch (a) {
  case 0 ... 10:
    printf("between 0 and ten \n");
    break;
  default:
    printf("Out of range \n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
ja     114a <main+0x3a>
jmp    1137 <main+0x27>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1158 <main+0x48>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"between 0 and ten \0A\00"
@.str.1 = [15 x i8] c"Out of range \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 0, label %4
i32 1, label %4
i32 2, label %4
i32 3, label %4
i32 4, label %4
i32 5, label %4
i32 6, label %4
i32 7, label %4
i32 8, label %4
i32 9, label %4
i32 10, label %4
]
4: ; preds = %0, %0, %0, %0, %0, %0, %0, %0, %0, %0, %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"between 0 and ten \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ clamp(scalar_t__, int /*<<< orphan*/, int);
scalar_t__ extract_grey(scalar_t__ *, int);
int /*<<< orphan*/ set_grey(scalar_t__ *, int, int /*<<< orphan*/);
void add_grey(uint8_t *grey, int i, int amount) {
  uint8_t val = extract_grey(grey, i);
  set_grey(grey, i, clamp(val + amount, 0, 255));
}


x86 assembly (clang, -O0):
<add_grey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <extract_grey@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x10(%rbp),%rax
add    %rax,%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1030 <clamp@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
call   1040 <set_grey@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_grey>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <extract_grey@plt>
movslq %r14d,%rdi
add    %rax,%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1030 <clamp@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <set_grey@plt>

LLVM IR (-O0):
define void @add_grey(i64* %0, i32 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i64* %0, i64** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i64*, i64** %4
%9 = load i32, i32* %5
%10 = call i64 @extract_grey(i64* %8, i32 %9)
store i64 %10, i64* %7
%11 = load i64*, i64** %4
%12 = load i32, i32* %5
%13 = load i64, i64* %7
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = add nsw i64 %13, %15
%17 = call i32 @clamp(i64 %16, i32 0, i32 255)
%18 = call i32 @set_grey(i64* %11, i32 %12, i32 %17)
ret void
}

LLVM IR (-O2):
define void @add_grey(i64* %0, i32 %1, i32 %2) {
%4 = tail call i64 @extract_grey(i64* %0, i32 %1)
%5 = sext i32 %2 to i64
%6 = add nsw i64 %4, %5
%7 = tail call i32 @clamp(i64 %6, i32 0, i32 255)
%8 = tail call i32 @set_grey(i64* %0, i32 %1, i32 %7)
ret void
}
/* Variables and functions */
double pow(double, double);
double H(double a) { return 1 + pow(a, 3.0); }


x86 assembly (clang, -O0):
<H>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @H(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 3.000000e+00)
%5 = fadd double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @H(double %0) {
%2 = tail call double @pow(double %0, double 3.000000e+00)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ nrerror(char *);
void free_lvector(long *v, long nl, long nh) {
  if (nh < 0)
    nrerror("free_lvector: nh must be >=0");
  free((char *)(v + nl - 1));
}


x86 assembly (clang, -O0):
<free_lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    114b <free_lvector+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <nrerror@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_lvector>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdx,%rdx
jns    113b <free_lvector+0x1b>
lea    0xeca(%rip),%rdi
call   1040 <nrerror@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"free_lvector: nh must be >=0\00"
define void @free_lvector(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @nrerror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
%12 = load i64*, i64** %4
%13 = load i64, i64* %5
%14 = getelementptr inbounds i64, i64* %12, i64 %13
%15 = getelementptr inbounds i64, i64* %14, i64 -1
%16 = bitcast i64* %15 to i8*
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"free_lvector: nh must be >=0\00"
define void @free_lvector(i64* nocapture %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @nrerror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = getelementptr inbounds i64, i64* %0, i64 %1
%9 = getelementptr inbounds i64, i64* %8, i64 -1
%10 = bitcast i64* %9 to i8*
%11 = tail call i32 @free(i8* %10)
ret void
}
/* Type definitions */
struct dualtimer_cmsdk_dev_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
dualtimer_cmsdk_disable_interrupt_timer1(struct dualtimer_cmsdk_dev_t const *);
int /*<<< orphan*/
dualtimer_cmsdk_disable_interrupt_timer2(struct dualtimer_cmsdk_dev_t const *);
void dualtimer_cmsdk_disable_interrupt_both_timers(
    const struct dualtimer_cmsdk_dev_t *dev) {
  dualtimer_cmsdk_disable_interrupt_timer1(dev);
  dualtimer_cmsdk_disable_interrupt_timer2(dev);
}


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

x86 assembly (clang, -O2):
<dualtimer_cmsdk_disable_interrupt_both_timers>:
push   %rbx
mov    %rdi,%rbx
call   1030 <dualtimer_cmsdk_disable_interrupt_timer1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <dualtimer_cmsdk_disable_interrupt_timer2@plt>

LLVM IR (-O0):
%struct.dualtimer_cmsdk_dev_t = type { i32 }
define void @dualtimer_cmsdk_disable_interrupt_both_timers(%struct.dualtimer_cmsdk_dev_t* %0) {
%2 = alloca %struct.dualtimer_cmsdk_dev_t*
store %struct.dualtimer_cmsdk_dev_t* %0, %struct.dualtimer_cmsdk_dev_t** %2
%3 = load %struct.dualtimer_cmsdk_dev_t*, %struct.dualtimer_cmsdk_dev_t** %2
%4 = call i32 @dualtimer_cmsdk_disable_interrupt_timer1(%struct.dualtimer_cmsdk_dev_t* %3)
%5 = load %struct.dualtimer_cmsdk_dev_t*, %struct.dualtimer_cmsdk_dev_t** %2
%6 = call i32 @dualtimer_cmsdk_disable_interrupt_timer2(%struct.dualtimer_cmsdk_dev_t* %5)
ret void
}

LLVM IR (-O2):
%struct.dualtimer_cmsdk_dev_t = type { i32 }
define void @dualtimer_cmsdk_disable_interrupt_both_timers(%struct.dualtimer_cmsdk_dev_t* %0) {
%2 = tail call i32 @dualtimer_cmsdk_disable_interrupt_timer1(%struct.dualtimer_cmsdk_dev_t* %0)
%3 = tail call i32 @dualtimer_cmsdk_disable_interrupt_timer2(%struct.dualtimer_cmsdk_dev_t* %0)
ret void
}
/* Variables and functions */
void **xrealloc(void **, size_t);
void *lpop(void *l, size_t *len) {
  void ***pl;
  void *v;
  pl = l;
  (*len)--;
  v = (*pl)[*len];
  *pl = xrealloc(*pl, *len * sizeof(void *));
  return v;
}


x86 assembly (clang, -O0):
<lpop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
shl    $0x3,%rsi
call   1030 <xrealloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lpop>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rsi),%rax
lea    -0x1(%rax),%rcx
mov    %rcx,(%rsi)
mov    (%rdi),%rdi
mov    -0x8(%rdi,%rax,8),%r14
lea    -0x8(,%rax,8),%rsi
ff
call   1030 <xrealloc@plt>
mov    %rax,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @lpop(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i8***
%6 = alloca i8*
store i8* %0, i8** %3
store i64* %1, i64** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8***
store i8*** %8, i8**** %5
%9 = load i64*, i64** %4
%10 = load i64, i64* %9
%11 = add i64 %10, -1
store i64 %11, i64* %9
%12 = load i8***, i8**** %5
%13 = load i8**, i8*** %12
%14 = load i64*, i64** %4
%15 = load i64, i64* %14
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
store i8* %17, i8** %6
%18 = load i8***, i8**** %5
%19 = load i8**, i8*** %18
%20 = load i64*, i64** %4
%21 = load i64, i64* %20
%22 = mul i64 %21, 8
%23 = call i8** @xrealloc(i8** %19, i64 %22)
%24 = load i8***, i8**** %5
store i8** %23, i8*** %24
%25 = load i8*, i8** %6
ret i8* %25
}

LLVM IR (-O2):
define i8* @lpop(i8* nocapture %0, i64* nocapture %1) {
%3 = bitcast i8* %0 to i8***
%4 = load i64, i64* %1
%5 = add i64 %4, -1
store i64 %5, i64* %1
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i64 %5
%8 = load i8*, i8** %7
%9 = shl i64 %5, 3
%10 = tail call i8** @xrealloc(i8** %6, i64 %9)
store i8** %10, i8*** %3
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Contexo says Hello!\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Contexo says Hello!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Contexo says Hello!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char cin();
char getchar(void) { return cin(); }


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

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

LLVM IR (-O0):
define signext i8 @getchar() {
%1 = call signext i8 (...) @cin()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @getchar() {
%1 = tail call signext i8 (...) @cin()
ret i8 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_square(uintptr_t, uintptr_t);
void fiat_secp256k1_square(uint64_t out1[4], const uint64_t arg1[4]) {
  internal_fiat_secp256k1_square((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_square>:
jmp    1030 <internal_fiat_secp256k1_square@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_square(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_secp256k1_square(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_square(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_secp256k1_square(i64 %3, i64 %4)
ret void
}
unsigned xrop3_175_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~T;
  stk1 = D | stk2;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_175_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_175_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = xor i32 %15, -1
store i32 %16, i32* %8
%17 = load i32, i32* %5
%18 = load i32, i32* %8
%19 = or i32 %17, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @xrop3_175_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = xor i32 %4, -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *dest, const char *src) {
  strcpy(dest + strlen(dest), src);
  return dest;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %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* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int main() {
  int i;
  free(&i);
  i = 10;
  char *p = (char *)malloc(1000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <free@plt>
movl   $0xa,-0x4(%rbp)
mov    $0x3e8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <free@plt>
mov    $0x3e8,%edi
call   1040 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 @free(i32* %1)
store i32 10, i32* %1
%4 = call i64 @malloc(i32 1000)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @free(i32* %1)
%4 = tail call i64 @malloc(i32 1000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void notify_server() { kill(0, SIGUSR1); }


x86 assembly (clang, -O0):
<notify_server>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <kill@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define void @notify_server() {
%1 = load i32, i32* @SIGUSR1
%2 = call i32 @kill(i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define void @notify_server() {
%1 = load i32, i32* @SIGUSR1
%2 = tail call i32 @kill(i32 0, i32 %1)
ret void
}
int DST(int mv) { return mv >> 8; }


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

x86 assembly (clang, -O2):
<DST>:
mov    %edi,%eax
sar    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @DST(i32 %0) {
%2 = ashr i32 %0, 8
ret i32 %2
}
double f(double x, double y, double z) { return 0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @f(double %0, double %1, double %2) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ test_simpson_integral();
int /*<<< orphan*/ test_trapezod_integral();
int main() {
  test_simpson_integral();
  test_trapezod_integral();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_simpson_integral()
%2 = tail call i32 (...) @test_trapezod_integral()
ret i32 0
}
int dd_lt(const double *a, const double *b) {
  return (a[0] < b[0] || (a[0] == b[0] && a[1] < b[1])) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
ja     116e <dd_lt+0x6e>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x12(%rbp)
jne    1168 <dd_lt+0x68>
jp     1168 <dd_lt+0x68>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_lt>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    $0x1,%eax
ucomisd %xmm0,%xmm1
ja     112a <dd_lt+0x2a>
ucomisd %xmm1,%xmm0
jne    112b <dd_lt+0x2b>
jp     112b <dd_lt+0x2b>
movsd  0x8(%rsi),%xmm0
xor    %eax,%eax
ucomisd 0x8(%rdi),%xmm0
seta   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dd_lt(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fcmp olt double %7, %10
br i1 %11, label %30, label %12
12: ; preds = %2
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = fcmp oeq double %15, %18
br i1 %19, label %20, label %28
20: ; preds = %12
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fcmp olt double %23, %26
br label %28
28: ; preds = %20, %12
%29 = phi i1 [ false, %12 ], [ %27, %20 ]
br label %30
30: ; preds = %28, %2
%31 = phi i1 [ true, %2 ], [ %29, %28 ]
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 1, i32 0
ret i32 %33
}

LLVM IR (-O2):
define i32 @dd_lt(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = fcmp oeq double %3, %4
br i1 %7, label %8, label %15
8: ; preds = %6
%9 = getelementptr inbounds double, double* %0, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 1
%12 = load double, double* %11
%13 = fcmp olt double %10, %12
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %6, %8, %2
%16 = phi i32 [ 1, %2 ], [ 0, %6 ], [ %14, %8 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void g() { printf("Gotcha!\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Gotcha!\00"
define void @g() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __name(char *);
int rt_set_name(char *thename) { return __name(thename); }


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

x86 assembly (clang, -O2):
<rt_set_name>:
jmp    1030 <__name@plt>

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

LLVM IR (-O2):
define i32 @rt_set_name(i8* %0) {
%2 = tail call i32 @__name(i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ isdigit(char);
char tolower(char);
char from_hex(char ch) {
  return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10;
}


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <from_hex+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <from_hex+0x45>
movsbl -0x1(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1132 <from_hex+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <tolower@plt>
add    $0xa9,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @from_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @from_hex(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %9
6: ; preds = %1
%7 = tail call signext i8 @tolower(i8 signext %0)
%8 = add i8 %7, -87
br label %9
9: ; preds = %6, %4
%10 = phi i8 [ %5, %4 ], [ %8, %6 ]
ret i8 %10
}
execv(file, argv) char *file;
char **argv;
{
  extern char **environ;
  return (execve(file, argv, environ));
}


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

x86 assembly (clang, -O2):
<execv>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rdx
xor    %eax,%eax
jmp    1030 <execve@plt>

LLVM IR (-O0):
@environ = external global i8**
define i32 @execv(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = load i8**, i8*** @environ
%8 = call i32 (i8*, i8**, i8**, ...) bitcast (i32 (...)* @execve to i32 (i8*, i8**, i8**, ...)*)(i8* %5, i8** %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
@environ = external global i8**
define i32 @execv(i8* %0, i8** %1) {
%3 = load i8**, i8*** @environ
%4 = tail call i32 (i8*, i8**, i8**, ...) bitcast (i32 (...)* @execve to i32 (i8*, i8**, i8**, ...)*)(i8* %0, i8** %1, i8** %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ begin(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ get_current_pressure(int);
int /*<<< orphan*/ get_current_temp(int);
int open(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int c;
  int FH;
  FH = open("/dev/i2c-1", O_RDWR);
  begin(FH);
  get_current_temp(FH);
  begin(FH);
  get_current_pressure(FH);
  close(FH);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
lea    0xe8a(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <begin@plt>
mov    -0x18(%rbp),%edi
call   1060 <get_current_temp@plt>
mov    -0x18(%rbp),%edi
call   1040 <begin@plt>
mov    -0x18(%rbp),%edi
call   1070 <get_current_pressure@plt>
mov    -0x18(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    0xe9f(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <begin@plt>
mov    %ebx,%edi
call   1060 <get_current_temp@plt>
mov    %ebx,%edi
call   1040 <begin@plt>
mov    %ebx,%edi
call   1070 <get_current_pressure@plt>
mov    %ebx,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/i2c-1\00"
@O_RDWR = global i32 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
%8 = load i32, i32* @O_RDWR
%9 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @begin(i32 %10)
%12 = load i32, i32* %7
%13 = call i32 @get_current_temp(i32 %12)
%14 = load i32, i32* %7
%15 = call i32 @begin(i32 %14)
%16 = load i32, i32* %7
%17 = call i32 @get_current_pressure(i32 %16)
%18 = load i32, i32* %7
%19 = call i32 @close(i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/i2c-1\00"
@O_RDWR = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @begin(i32 %4)
%6 = tail call i32 @get_current_temp(i32 %4)
%7 = tail call i32 @begin(i32 %4)
%8 = tail call i32 @get_current_pressure(i32 %4)
%9 = tail call i32 @close(i32 %4)
ret i32 0
}
/* Variables and functions */
int fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int fputchar(int c) {
  if (c < 0)
    return 0;
  return fputc(c, stdout);
}


x86 assembly (clang, -O0):
<fputchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <fputchar+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1145 <fputchar+0x35>
mov    -0x8(%rbp),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputchar>:
test   %edi,%edi
js     1122 <fputchar+0x12>
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @fputchar(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 %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = load i32, i32* @stdout
%10 = call i32 @fputc(i32 %8, i32 %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @fputchar(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputc(i32 %0, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
char *strerror$UNIX2003(int errornum) { return strerror(errornum); }


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

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

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

LLVM IR (-O2):
define i8* @"strerror$UNIX2003"(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void cleanupcb_close(void *_fd) {
  int fd = *(int *)_fd;
  close(fd);
}


x86 assembly (clang, -O0):
<cleanupcb_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanupcb_close>:
mov    (%rdi),%edi
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @cleanupcb_close(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
ret void
}

LLVM IR (-O2):
define void @cleanupcb_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @close(i32 %3)
ret void
}
/* Variables and functions */
int w5100_read_byte(int);
unsigned w5100_readMR() { return w5100_read_byte(0x0000); }


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

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

LLVM IR (-O0):
define i32 @w5100_readMR() {
%1 = call i32 @w5100_read_byte(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @w5100_readMR() {
%1 = tail call i32 @w5100_read_byte(i32 0)
ret i32 %1
}
void spl_debug_fini(void) { return; }


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

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

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

LLVM IR (-O2):
define void @spl_debug_fini() {
ret void
}
int test_imm_54int32_mem(int *val) {
  return ((*val) & (0x54 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_54int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 84
%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_54int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 84
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double wet_zenith_delay(void) { return 0.122382715318184; }


x86 assembly (clang, -O0):
<wet_zenith_delay>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @wet_zenith_delay() {
ret double 0x3FBF54793FE324AF
}

LLVM IR (-O2):
define double @wet_zenith_delay() {
ret double 0x3FBF54793FE324AF
}