xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  double s = 0, t = 1;
  int n;
  for (n = 1; n <= 20; n++) {
    t = t * n;
    s = s + t;
  }
  printf("1!+2!+3!+⋯⋯+20!=%22.15e\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jg     1175 <main+0x65>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <main+0x2b>
movsd  -0x10(%rbp),%xmm0
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"1!+2!+3!+\E2\8B\AF\E2\8B\AF+20!=%22.15e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 1.000000e+00, double* %3
store i32 1, i32* %4
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 20
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load double, double* %3
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fmul double %9, %11
store double %12, double* %3
%13 = load double, double* %2
%14 = load double, double* %3
%15 = fadd double %13, %14
store double %15, double* %2
br label %16
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = load double, double* %2
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"1!+2!+3!+\E2\8B\AF\E2\8B\AF+20!=%22.15e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double 0x43C1C5D4E487FCFD)
ret i32 0
}
void free_registers() {}


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

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

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

LLVM IR (-O2):
define void @free_registers() {
ret void
}
int pci_restore_state(struct pci_dev *dev) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @pci_restore_state(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
%3 = alloca i32
store %struct.pci_dev* %0, %struct.pci_dev** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_restore_state(%struct.pci_dev* nocapture readnone %0) {
ret i32 undef
}
int f() {
  int j = 1;
  long i;
  for (i = -0x70000000L; i < 0x60000000L; i += 0x10000000L)
    j <<= 1;
  return j;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movq   $0xffffffff90000000,-0x10(%rbp)
90
cmpq   $0x60000000,-0x10(%rbp)
60
jge    113d <f+0x3d>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10000000,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <f+0x13>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i64
store i32 1, i32* %1
store i64 -1879048192, i64* %2
br label %3
3: ; preds = %9, %0
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 1610612736
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %1
%8 = shl i32 %7, 1
store i32 %8, i32* %1
br label %9
9: ; preds = %6
%10 = load i64, i64* %2
%11 = add nsw i64 %10, 268435456
store i64 %11, i64* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @f() {
ret i32 8192
}
binary_size(row, col, x, y) int row, col, *x, *y;
{
  *x = col;
  *y = row;
  if ((*x > 316) || (*y > 316)) {
    error(10);
  }
}


x86 assembly (clang, -O0):
<binary_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x13c,(%rax)
jg     1158 <binary_size+0x48>
mov    -0x20(%rbp),%rax
cmpl   $0x13c,(%rax)
jle    1164 <binary_size+0x54>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_size>:
push   %rax
mov    %esi,(%rdx)
mov    %edi,(%rcx)
cmp    $0x13c,%edi
jg     1127 <binary_size+0x17>
cmpl   $0x13d,(%rdx)
jge    1127 <binary_size+0x17>
pop    %rcx
ret
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <error@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @binary_size(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%10 = load i32, i32* %7
%11 = load i32*, i32** %8
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = load i32*, i32** %9
store i32 %12, i32* %13
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = icmp sgt i32 %15, 316
br i1 %16, label %21, label %17
17: ; preds = %4
%18 = load i32*, i32** %9
%19 = load i32, i32* %18
%20 = icmp sgt i32 %19, 316
br i1 %20, label %21, label %23
21: ; preds = %17, %4
%22 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 10)
br label %23
23: ; preds = %21, %17
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @binary_size(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture writeonly %3) {
store i32 %1, i32* %2
store i32 %0, i32* %3
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 316
%7 = icmp sgt i32 %0, 316
%8 = or i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 10)
br label %11
11: ; preds = %4, %9
ret i32 undef
}
unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c) {
  return a * b / c;
}


x86 assembly (clang, -O0):
<muldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<muldiv>:
mov    %rdx,%rcx
mov    %rdi,%rax
imul   %rsi,%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     111c <muldiv+0x1c>
xor    %edx,%edx
div    %rcx
ret
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
define i64 @muldiv(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* %4
%8 = load i64, i64* %5
%9 = mul i64 %7, %8
%10 = load i64, i64* %6
%11 = udiv i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @muldiv(i64 %0, i64 %1, i64 %2) {
%4 = mul i64 %1, %0
%5 = udiv i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
char *ft_strncat(char *, char const *, int /*<<< orphan*/);
char *ft_strcat(char *s1, const char *s2) {
  return (ft_strncat(s1, s2, ft_strlen(s2)));
}


x86 assembly (clang, -O0):
<ft_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <ft_strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <ft_strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ft_strncat@plt>

LLVM IR (-O0):
define i8* @ft_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** %4
%7 = load i8*, i8** %4
%8 = call i32 @ft_strlen(i8* %7)
%9 = call i8* @ft_strncat(i8* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @ft_strcat(i8* %0, i8* %1) {
%3 = tail call i32 @ft_strlen(i8* %1)
%4 = tail call i8* @ft_strncat(i8* %0, i8* %1, i32 %3)
ret i8* %4
}
unsigned long long endian_swap64(unsigned long long x) {
  return (x >> 56) | ((x << 40) & 0x00FF000000000000ULL) |
         ((x << 24) & 0x0000FF0000000000ULL) |
         ((x << 8) & 0x000000FF00000000ULL) | ((x >> 8) & 0x00000000FF000000) |
         ((x >> 24) & 0x0000000000FF0000) | ((x >> 40) & 0x000000000000FF00) |
         (x << 56);
}


x86 assembly (clang, -O0):
<endian_swap64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x38,%rax
mov    -0x8(%rbp),%rcx
shl    $0x28,%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x18,%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x8,%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x18,%rcx
and    $0xff0000,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x28,%rcx
and    $0xff00,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x38,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_swap64>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @endian_swap64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 56
%5 = load i64, i64* %2
%6 = shl i64 %5, 40
%7 = and i64 %6, 71776119061217280
%8 = or i64 %4, %7
%9 = load i64, i64* %2
%10 = shl i64 %9, 24
%11 = and i64 %10, 280375465082880
%12 = or i64 %8, %11
%13 = load i64, i64* %2
%14 = shl i64 %13, 8
%15 = and i64 %14, 1095216660480
%16 = or i64 %12, %15
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = and i64 %18, 4278190080
%20 = or i64 %16, %19
%21 = load i64, i64* %2
%22 = lshr i64 %21, 24
%23 = and i64 %22, 16711680
%24 = or i64 %20, %23
%25 = load i64, i64* %2
%26 = lshr i64 %25, 40
%27 = and i64 %26, 65280
%28 = or i64 %24, %27
%29 = load i64, i64* %2
%30 = shl i64 %29, 56
%31 = or i64 %28, %30
ret i64 %31
}

LLVM IR (-O2):
define i64 @endian_swap64(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
void nondet_destroy() {}


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

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

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

LLVM IR (-O2):
define void @nondet_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpcodeNotDone();
void prod(void) { OpcodeNotDone(); }


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

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

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

LLVM IR (-O2):
define void @prod() {
%1 = tail call i32 (...) @OpcodeNotDone()
ret void
}
int get_gadget_connect_flag(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @get_gadget_connect_flag() {
ret i32 0
}

LLVM IR (-O2):
define i32 @get_gadget_connect_flag() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, unsigned long long);
void *realloc(void *, size_t);
void *actually_realloc(void *data, size_t new_size) {
  void *result = realloc(data, new_size);
  if (!result) {
    printf("\n\n"
           "*** The testing infrastructure itself failed.\n"
           "*** Specifically, realloc(..., %llu) returned NULL.\n",
           (unsigned long long)new_size);
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<actually_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <actually_realloc+0x46>
mov    -0x10(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<actually_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <actually_realloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [101 x i8] c"\0A\0A*** The testing infrastructure itself failed.\0A*** Specifically, realloc(..., %llu) returned NULL.\0A\00"
define i8* @actually_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i64, i64* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [101 x i8] c"\0A\0A*** The testing infrastructure itself failed.\0A*** Specifically, realloc(..., %llu) returned NULL.\0A\00"
define noalias i8* @actually_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0), i64 %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
int adagain(int input) {
  static int one = 1;
  int two = 2;
  two += input;
  two += one;
  return two;
}


x86 assembly (clang, -O0):
<adagain>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2f03(%rip),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adagain>:
lea    0x3(%rdi),%eax
ret

LLVM IR (-O0):
@adagain.one = internal global i32 1
define i32 @adagain(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %5, %4
store i32 %6, i32* %3
%7 = load i32, i32* @adagain.one
%8 = load i32, i32* %3
%9 = add nsw i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @adagain(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ldexp(double, int);
int /*<<< orphan*/ ldexpf(float, int);
int /*<<< orphan*/ ldexpl(long double, int);
void uninitvar_ldexp(void) {
  float f;
  int e1;
  (void)ldexpf(f, e1);
  double d;
  int e2;
  (void)ldexp(d, e2);
  long double ld;
  int e3;
  (void)ldexpl(ld, e3);
}


x86 assembly (clang, -O0):
<uninitvar_ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1050 <ldexpf@plt>
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <ldexp@plt>
fldt   -0x30(%rbp)
mov    -0x34(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <ldexpl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_ldexp>:
sub    $0x18,%rsp
call   1050 <ldexpf@plt>
call   1030 <ldexp@plt>
call   1040 <ldexpl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_ldexp() {
%1 = alloca float
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
%5 = alloca x86_fp80
%6 = alloca i32
%7 = load float, float* %1
%8 = load i32, i32* %2
%9 = call i32 @ldexpf(float %7, i32 %8)
%10 = load double, double* %3
%11 = load i32, i32* %4
%12 = call i32 @ldexp(double %10, i32 %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load i32, i32* %6
%15 = call i32 @ldexpl(x86_fp80 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_ldexp() {
%1 = tail call i32 @ldexpf(float undef, i32 undef)
%2 = tail call i32 @ldexp(double undef, i32 undef)
%3 = tail call i32 @ldexpl(x86_fp80 undef, i32 undef)
ret void
}
void foo552() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_markup_parse_context_parse() {
ret void
}
/* Variables and functions */
char *xstrcut(char const *, size_t);
char *xstrslice(const char *str, size_t pos, size_t end) {
  return xstrcut(str + pos, end - pos);
}


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

x86 assembly (clang, -O2):
<xstrslice>:
add    %rsi,%rdi
sub    %rsi,%rdx
mov    %rdx,%rsi
jmp    1030 <xstrcut@plt>

LLVM IR (-O0):
define i8* @xstrslice(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = sub i64 %10, %11
%13 = call i8* @xstrcut(i8* %9, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @xstrslice(i8* %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = sub i64 %2, %1
%6 = tail call i8* @xstrcut(i8* %4, i64 %5)
ret i8* %6
}
void gdk_event_get_root_coords() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_get_root_coords() {
ret void
}
/* Variables and functions */
scalar_t__ __builtin_llceil(double);
int /*<<< orphan*/ link_failure_builtin_llceil();
void test_builtin_llceil(double d) {
  if (__builtin_llceil(d) != __builtin_llceil(d))
    link_failure_builtin_llceil();
}


x86 assembly (clang, -O0):
<test_builtin_llceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_llceil@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_llceil@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_llceil+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_llceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_llceil>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <__builtin_llceil@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <__builtin_llceil@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_llceil+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_llceil@plt>

LLVM IR (-O0):
define void @test_builtin_llceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__builtin_llceil(double %3)
%5 = load double, double* %2
%6 = call i64 @__builtin_llceil(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_llceil()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_llceil(double %0) {
%2 = tail call i64 @__builtin_llceil(double %0)
%3 = tail call i64 @__builtin_llceil(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_llceil()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef char *uint;

/* Variables and functions */
uint syscall(uint eax, uint ebx, uint ecx, uint edx) {
  asm volatile("int $0x80"
               : "=a"(eax)
               : "a"(eax), "b"(ebx), "c"(ecx), "d"(edx)
               : "memory");
  return eax;
}


x86 assembly (clang, -O0):
<syscall>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
int    $0x80
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %r8,%rdx
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i8* @syscall(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* asm sideeffect "int $$0x80", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %9, i8* %10, i8* %11, i8* %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @syscall(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i8* asm sideeffect "int $$0x80", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i8* %2, i8* %3)
ret i8* %5
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double tic() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return (double)now.tv_sec + (double)now.tv_usec / 1.0e6;
}


x86 assembly (clang, -O0):
<tic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tic>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @tic() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @tic() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
int main(void) {
  char x;
  _Alignas(32) int *p = (int *)&x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffffe0,%rsp
sub    $0x20,%rsp
movl   $0x0,0xc(%rsp)
lea    0xb(%rsp),%rax
mov    %rax,(%rsp)
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_std_qh_line() {
  printf(
      "\n  =================================================================");
}


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

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

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

LLVM IR (-O2):
@.str = [69 x i8] c"\0A =================================================================\00"
define void @print_std_qh_line() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_59() {
  Assert_real((isqrt(59) == 7),
              "/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/stdlib/isqrt.c",
              300, ("Integer square root of 59 should be 7"));
}


x86 assembly (clang, -O0):
<t_sqrt_59>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
call   1030 <isqrt@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x12c,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_59>:
push   %rax
mov    $0x3b,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x12c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 59 should be 7\00"
define void @t_sqrt_59() {
%1 = call i32 @isqrt(i32 59)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 59 should be 7\00"
define void @t_sqrt_59() {
%1 = tail call i32 @isqrt(i32 59)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int majorVersion(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @majorVersion() {
ret i32 1
}
void my_strcpy(char *news, char *olds) {
  int i = 0;
  do {
    news[i] = olds[i];
    i++;
  } while (olds[i] != '\0');
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1113 <my_strcpy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    (%rsi),%al
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <my_strcpy+0x10>
ret

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

LLVM IR (-O2):
define void @my_strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
br label %4
4: ; preds = %4, %2
%5 = phi i8 [ %10, %4 ], [ %3, %2 ]
%6 = phi i64 [ %8, %4 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %5, i8* %7
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4
ret void
}
/* Variables and functions */
int munmap(void *, int);
int memunmap(void *ptr, int size) { return munmap(ptr, size); }


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

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

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

LLVM IR (-O2):
define i32 @memunmap(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
ret i32 %3
}
void *test_anti_range_75(unsigned char n) {
  extern void *alloc_anti_range_75(unsigned char)
      __attribute__((alloc_size(1)));
  if (1 <= n && n <= 1)
    n = 1 - 1;
  return alloc_anti_range_75(n);
}


x86 assembly (clang, -O0):
<test_anti_range_75>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_75+0x30>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jg     1140 <test_anti_range_75+0x30>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_75@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_75>:
xor    %eax,%eax
cmp    $0x1,%dil
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_75@plt>

LLVM IR (-O0):
define i8* @test_anti_range_75(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 1, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 0, i8* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i8, i8* %2
%13 = call i8* @alloc_anti_range_75(i8 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_75(i8 zeroext %0) {
%2 = icmp eq i8 %0, 1
%3 = select i1 %2, i8 0, i8 %0
%4 = tail call i8* @alloc_anti_range_75(i8 zeroext %3)
ret i8* %4
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fileinfo_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_copy(struct genlist const *);
struct fileinfo_list *fileinfo_list_copy(const struct fileinfo_list *tthis) {
  return (struct fileinfo_list *)genlist_copy((const struct genlist *)tthis);
}


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

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

LLVM IR (-O0):
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo_list* @fileinfo_list_copy(%struct.fileinfo_list* %0) {
%2 = alloca %struct.fileinfo_list*
store %struct.fileinfo_list* %0, %struct.fileinfo_list** %2
%3 = load %struct.fileinfo_list*, %struct.fileinfo_list** %2
%4 = bitcast %struct.fileinfo_list* %3 to %struct.genlist*
%5 = call i64 @genlist_copy(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.fileinfo_list*
ret %struct.fileinfo_list* %6
}

LLVM IR (-O2):
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo_list* @fileinfo_list_copy(%struct.fileinfo_list* %0) {
%2 = bitcast %struct.fileinfo_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_copy(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.fileinfo_list*
ret %struct.fileinfo_list* %4
}
int ismod(int a, int b) { return a % b; }


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

x86 assembly (clang, -O2):
<ismod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ismod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int sqrtf(float);
float __glsl_inversesqrt(float x) { return 1 / sqrtf(x); }


x86 assembly (clang, -O0):
<__glsl_inversesqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_inversesqrt>:
push   %rax
call   1030 <sqrtf@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @__glsl_inversesqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @sqrtf(float %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @__glsl_inversesqrt(float %0) {
%2 = tail call i32 @sqrtf(float %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ ot(char *);
immed() { ot("ldd\t#"); }


x86 assembly (clang, -O0):
<immed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ot@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ldd\09#\00"
define i32 @immed() {
%1 = alloca i32
%2 = call i32 @ot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"ldd\09#\00"
define i32 @immed() {
%1 = tail call i32 @ot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int main(int argc, char **argv) {
  puts("Hello world!");
  __asm__ __volatile__("int $3\n\t");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
int3
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
tail call void asm sideeffect "int $$3\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
void __attribute__((no, noclone)) foo(int *a, int n) {
  int *lasta = a + n;
  for (; a != lasta; a++) {
    *a *= 2;
    a[1] = a[-1] + a[-2];
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     115d <foo+0x5d>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
add    -0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    111e <foo+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %esi,%esi
je     1126 <foo+0x26>
movslq %esi,%rax
lea    (%rdi,%rax,4),%rax
mov    (%rdi),%ecx
nopl   (%rax)
add    %ecx,%ecx
mov    %ecx,(%rdi)
mov    -0x8(%rdi),%ecx
add    -0x4(%rdi),%ecx
mov    %ecx,0x4(%rdi)
add    $0x4,%rdi
cmp    %rax,%rdi
jne    1110 <foo+0x10>
ret

LLVM IR (-O0):
define void @foo(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* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
store i32* %9, i32** %5
br label %10
10: ; preds = %27, %2
%11 = load i32*, i32** %3
%12 = load i32*, i32** %5
%13 = icmp ne i32* %11, %12
br i1 %13, label %14, label %30
14: ; preds = %10
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 2
store i32 %17, i32* %15
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 -1
%20 = load i32, i32* %19
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 -2
%23 = load i32, i32* %22
%24 = add nsw i32 %20, %23
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 1
store i32 %24, i32* %26
br label %27
27: ; preds = %14
%28 = load i32*, i32** %3
%29 = getelementptr inbounds i32, i32* %28, i32 1
store i32* %29, i32** %3
br label %10
30: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @foo(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = icmp eq i32 %1, 0
br i1 %5, label %19, label %6
6: ; preds = %2
%7 = load i32, i32* %0
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %16, %8 ], [ %7, %6 ]
%10 = phi i32* [ %17, %8 ], [ %0, %6 ]
%11 = shl nsw i32 %9, 1
store i32 %11, i32* %10
%12 = getelementptr inbounds i32, i32* %10, i64 -1
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %10, i64 -2
%15 = load i32, i32* %14
%16 = add nsw i32 %15, %13
%17 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %16, i32* %17
%18 = icmp eq i32* %17, %4
br i1 %18, label %19, label %8
19: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int read(int, scalar_t__ *, int);
int serialGetchar(int fd) {
  uint8_t x;
  if (read(fd, &x, 1) != 1)
    return -1;
  return ((int)x) & 0xFF;
}


x86 assembly (clang, -O0):
<serialGetchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     1141 <serialGetchar+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <serialGetchar+0x3d>
mov    -0x10(%rbp),%rax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialGetchar>:
push   %rax
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movzbl (%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serialGetchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @read(i32 %5, i64* %4, i32 1)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i32
%12 = and i32 %11, 255
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @serialGetchar(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @read(i32 %0, i64* %2, i32 1)
%5 = icmp eq i32 %4, 1
%6 = load i64, i64* %2
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 255
%9 = select i1 %5, i32 %8, i32 -1
ret i32 %9
}
void tegra_twd_suspend(struct tegra_twd_context *context) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_twd_context = type opaque
define void @tegra_twd_suspend(%struct.tegra_twd_context* nocapture %0) {
ret void
}
int comparer(const void *a, const void *b) { return (int)a - (int)b; }


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

x86 assembly (clang, -O2):
<comparer>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @comparer(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 = ptrtoint i8* %5 to i32
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @comparer(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR3E_get(void) { return U_WMRCORENONE_get("U_WMR3E"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR3E\00"
define i32 @U_WMR3E_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int Limit(int val, int max, int min) {
  if (val > max) {
    val = max;
  } else if (val < min) {
    val = min;
  }
  return val;
}


x86 assembly (clang, -O0):
<Limit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <Limit+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <Limit+0x3b>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1136 <Limit+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <Limit+0x3b>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Limit>:
mov    %edx,%eax
cmp    %edx,%edi
cmovge %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @Limit(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp slt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Type definitions */
struct battery {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int default_current_mA(struct battery *b) { return -ENODEV; }


x86 assembly (clang, -O0):
<default_current_mA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.battery = type { i32 }
@ENODEV = global i32 0
define i32 @default_current_mA(%struct.battery* %0) {
%2 = alloca %struct.battery*
store %struct.battery* %0, %struct.battery** %2
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.battery = type { i32 }
@ENODEV = global i32 0
define i32 @default_current_mA(%struct.battery* nocapture readnone %0) {
%2 = load i32, i32* @ENODEV
%3 = sub nsw i32 0, %2
ret i32 %3
}