xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memory_barrier();
uint32_t mmio_read(uint32_t reg) {
  memory_barrier();
  return *(volatile uint32_t *)(reg);
  memory_barrier();
}


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

x86 assembly (clang, -O2):
<mmio_read>:
push   %rax
mov    %rdi,(%rsp)
xor    %eax,%eax
call   1030 <memory_barrier@plt>
mov    (%rsp),%rax
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @mmio_read(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = call i32 (...) @memory_barrier()
%4 = load volatile i64, i64* %2
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @mmio_read(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = tail call i32 (...) @memory_barrier()
%4 = load volatile i64, i64* %2
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int clear_data(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(18, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<clear_data>:
mov    $0x12,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @clear_data() {
%1 = tail call i32 @_ada_use_c2phc(i32 18, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void putc(int c) {
  while ((*(volatile unsigned char *)0x16000018) & (1 << 5))
    barrier();
  (*(volatile unsigned char *)0x16000000) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x16000018,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     113d <putc+0x2d>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    111b <putc+0xb>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x16000000,%eax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbx
mov    %edi,%ebx
testb  $0x20,0x16000018
20
je     1131 <putc+0x21>
nopl   (%rax)
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x20,0x16000018
20
jne    1120 <putc+0x10>
mov    %bl,0x16000000
pop    %rbx
ret

LLVM IR (-O0):
define void @putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i8, i8* inttoptr (i64 369098776 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (...) @barrier()
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
store volatile i8 %12, i8* inttoptr (i64 369098752 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i32 %0) {
%2 = load volatile i8, i8* inttoptr (i64 369098776 to i8*)
%3 = and i8 %2, 32
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = tail call i32 (...) @barrier()
%7 = load volatile i8, i8* inttoptr (i64 369098776 to i8*)
%8 = and i8 %7, 32
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
%11 = trunc i32 %0 to i8
store volatile i8 %11, i8* inttoptr (i64 369098752 to i8*)
ret void
}
/* Type definitions */
struct lista {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ almacenaRegistros(struct lista *, int);
int calcularReg();
int /*<<< orphan*/ visualizarReg(struct lista *, int);
int main() {
  int nreg;
  struct lista *registros;
  nreg = calcularReg();
  almacenaRegistros(registros, nreg);
  visualizarReg(registros, nreg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <calcularReg@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <almacenaRegistros@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <visualizarReg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <calcularReg@plt>
mov    %eax,%ebx
mov    %eax,%esi
call   1050 <almacenaRegistros@plt>
mov    %ebx,%esi
call   1040 <visualizarReg@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.lista = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.lista*
store i32 0, i32* %1
%4 = call i32 (...) @calcularReg()
store i32 %4, i32* %2
%5 = load %struct.lista*, %struct.lista** %3
%6 = load i32, i32* %2
%7 = call i32 @almacenaRegistros(%struct.lista* %5, i32 %6)
%8 = load %struct.lista*, %struct.lista** %3
%9 = load i32, i32* %2
%10 = call i32 @visualizarReg(%struct.lista* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
%struct.lista = type { i32 }
define i32 @main() {
%1 = tail call i32 (...) @calcularReg()
%2 = tail call i32 @almacenaRegistros(%struct.lista* undef, i32 %1)
%3 = tail call i32 @visualizarReg(%struct.lista* undef, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void itoa(char *arr, int num) { sprintf(arr, "%d", num); }


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @itoa(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 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @itoa(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct Edge {
  int dummy;
};

/* Variables and functions */
struct Edge *edge_oNext(struct Edge *);
struct Edge *edge_rot(struct Edge *);
struct Edge *edge_oPrev(struct Edge *edge) {
  return edge_rot(edge_oNext(edge_rot(edge)));
}


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

x86 assembly (clang, -O2):
<edge_oPrev>:
push   %rax
call   1030 <edge_rot@plt>
mov    %rax,%rdi
call   1040 <edge_oNext@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <edge_rot@plt>

LLVM IR (-O0):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_oPrev(%struct.Edge* %0) {
%2 = alloca %struct.Edge*
store %struct.Edge* %0, %struct.Edge** %2
%3 = load %struct.Edge*, %struct.Edge** %2
%4 = call %struct.Edge* @edge_rot(%struct.Edge* %3)
%5 = call %struct.Edge* @edge_oNext(%struct.Edge* %4)
%6 = call %struct.Edge* @edge_rot(%struct.Edge* %5)
ret %struct.Edge* %6
}

LLVM IR (-O2):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_oPrev(%struct.Edge* %0) {
%2 = tail call %struct.Edge* @edge_rot(%struct.Edge* %0)
%3 = tail call %struct.Edge* @edge_oNext(%struct.Edge* %2)
%4 = tail call %struct.Edge* @edge_rot(%struct.Edge* %3)
ret %struct.Edge* %4
}
int min3(int x1, int x2, int x3) {
  int m;
  m = x1;
  if (x2 < m)
    m = x2;
  if (x3 < m) {
    return x3;
  } else {
    return m;
  }
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1125 <min3+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    113c <min3+0x3c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <min3+0x42>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct iter_node *);
void iter_free(void *iterdata) {
  struct iter_node *iter = (struct iter_node *)iterdata;
  free(iter);
}


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

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

LLVM IR (-O0):
%struct.iter_node = type { i32 }
define void @iter_free(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.iter_node*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.iter_node*
store %struct.iter_node* %5, %struct.iter_node** %3
%6 = load %struct.iter_node*, %struct.iter_node** %3
%7 = call i32 @free(%struct.iter_node* %6)
ret void
}

LLVM IR (-O2):
%struct.iter_node = type { i32 }
define void @iter_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.iter_node*
%3 = tail call i32 @free(%struct.iter_node* %2)
ret void
}
void foo120(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo120(i32 %0) {
ret void
}
void fd135(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
a:
  goto a;
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


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

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

LLVM IR (-O0):
define void @fd135(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; preds = %23
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %27, %24
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; preds = %42
br label %42
43: ; No predecessors!
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %46, %43
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd135(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void __ipipe_pin_range_globally(unsigned long start, unsigned long end) {}


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

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

LLVM IR (-O0):
define void @__ipipe_pin_range_globally(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @__ipipe_pin_range_globally(i64 %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
char *pack_u16(char *buf, uint16_t val) {
  *(uint16_t *)buf = val;
  return buf + sizeof(uint16_t);
}


x86 assembly (clang, -O0):
<pack_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_u16>:
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @pack_u16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 4
ret i8* %9
}

LLVM IR (-O2):
define i8* @pack_u16(i8* writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
%4 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void poke64(uint64_t *address, uint64_t value) { (*address) = value; }


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

x86 assembly (clang, -O2):
<poke64>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @poke64(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
ISR(TIMER1_COMPA_vect) {}


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

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

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

LLVM IR (-O2):
define i32 @ISR(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int addone();
int /*<<< orphan*/ settokens(char *);
int forwardline(char *line) {
  settokens(line);
  return addone();
}


x86 assembly (clang, -O0):
<forwardline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <settokens@plt>
mov    $0x0,%al
call   1030 <addone@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @forwardline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @settokens(i8* %3)
%5 = call i32 (...) @addone()
ret i32 %5
}

LLVM IR (-O2):
define i32 @forwardline(i8* %0) {
%2 = tail call i32 @settokens(i8* %0)
%3 = tail call i32 (...) @addone()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_month_name(int);
int main() {
  print_month_name(2);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <print_month_name@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_month_name(i32 2)
ret i32 0
}
/* Variables and functions */
int INT_MAX;
int INT_MIN;
int /*<<< orphan*/ minus(int);
int /*<<< orphan*/ printf(char *);
int main() {
  minus(0);
  minus(1);
  minus(INT_MAX);
  minus(INT_MIN + 1);
  printf("Now look what happens for INT_MIN!\n");
  minus(INT_MIN);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <minus@plt>
mov    $0x1,%edi
call   1030 <minus@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <minus@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
call   1030 <minus@plt>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1030 <minus@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <minus@plt>
mov    $0x1,%edi
call   1040 <minus@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1040 <minus@plt>
mov    0x2e99(%rip),%rbx
mov    (%rbx),%edi
add    $0x1,%edi
call   1040 <minus@plt>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
call   1040 <minus@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@.str = [36 x i8] c"Now look what happens for INT_MIN!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @minus(i32 0)
%3 = call i32 @minus(i32 1)
%4 = load i32, i32* @INT_MAX
%5 = call i32 @minus(i32 %4)
%6 = load i32, i32* @INT_MIN
%7 = add nsw i32 %6, 1
%8 = call i32 @minus(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @INT_MIN
%11 = call i32 @minus(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@str = [35 x i8] c"Now look what happens for INT_MIN!\00"
define i32 @main() {
%1 = tail call i32 @minus(i32 0)
%2 = tail call i32 @minus(i32 1)
%3 = load i32, i32* @INT_MAX
%4 = tail call i32 @minus(i32 %3)
%5 = load i32, i32* @INT_MIN
%6 = add nsw i32 %5, 1
%7 = tail call i32 @minus(i32 %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%9 = load i32, i32* @INT_MIN
%10 = tail call i32 @minus(i32 %9)
ret i32 0
}
double Test(void) {
  struct A;
  struct B {
    struct A *y;
  };
  struct A {
    double x;
    struct B *y;
  };
  struct B z;
  return z.y->x;
}


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

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

LLVM IR (-O0):
%struct.B = type { %struct.A* }
%struct.A = type { double, %struct.B* }
define double @Test() {
%1 = alloca %struct.B
%2 = getelementptr inbounds %struct.B, %struct.B* %1, i32 0, i32 0
%3 = load %struct.A*, %struct.A** %2
%4 = getelementptr inbounds %struct.A, %struct.A* %3, i32 0, i32 0
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @Test() {
ret double undef
}
void security_sb_post_pivotroot(struct nameidata *old_nd,
                                struct nameidata *new_nd) {}


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

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

LLVM IR (-O0):
%struct.nameidata = type opaque
define void @security_sb_post_pivotroot(%struct.nameidata* %0, %struct.nameidata* %1) {
%3 = alloca %struct.nameidata*
%4 = alloca %struct.nameidata*
store %struct.nameidata* %0, %struct.nameidata** %3
store %struct.nameidata* %1, %struct.nameidata** %4
ret void
}

LLVM IR (-O2):
%struct.nameidata = type opaque
define void @security_sb_post_pivotroot(%struct.nameidata* nocapture %0, %struct.nameidata* nocapture %1) {
ret void
}
/* Variables and functions */
int atoi(char const *);
char *getenv(char *);
int cnc_ctrl_ipc_init(void) {
  const char *cnc_out = getenv("CNCIPC"
                               "O");
  return cnc_out ? atoi(cnc_out) : -1;
}


x86 assembly (clang, -O0):
<cnc_ctrl_ipc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1154 <cnc_ctrl_ipc_init+0x34>
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0xc(%rbp)
jmp    1161 <cnc_ctrl_ipc_init+0x41>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1161 <cnc_ctrl_ipc_init+0x41>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnc_ctrl_ipc_init>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     113b <cnc_ctrl_ipc_init+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"CNCIPCO\00"
define i32 @cnc_ctrl_ipc_init() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @atoi(i8* %6)
br label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ -1, %8 ]
ret i32 %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"CNCIPCO\00"
define i32 @cnc_ctrl_ipc_init() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @atoi(i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
void gtk_handle_box_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_handle_box_get_type() {
ret void
}
/* Variables and functions */
short int get_short_le_s(const char *cp) {
  short int ret;
  unsigned char *source = (unsigned char *)cp;
  if (NULL == cp)
    return 0;
  ret = *source++;
  ret += ((*source++) << 8);
  return ret;
}


x86 assembly (clang, -O0):
<get_short_le_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1127 <get_short_le_s+0x27>
movw   $0x0,-0x2(%rbp)
jmp    1164 <get_short_le_s+0x64>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
mov    %ax,-0x12(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%ecx
shl    $0x8,%ecx
movswl -0x12(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x12(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_short_le_s>:
test   %rdi,%rdi
je     1109 <get_short_le_s+0x9>
movzwl (%rdi),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i16 @get_short_le_s(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %0
%6 = load i8, i8* %4
%7 = zext i8 %6 to i16
%8 = shl nuw i16 %7, 8
%9 = zext i8 %5 to i16
%10 = or i16 %8, %9
br label %11
11: ; preds = %1, %3
%12 = phi i16 [ %10, %3 ], [ 0, %1 ]
ret i16 %12
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int recv(int, char *, int, int /*<<< orphan*/);
char *get_lots(int sockfd, int length) {
  char *buffer = (char *)malloc(length + 1);
  if ((recv(sockfd, buffer, length, 0)) == -1) {
    printf("get_lots error\n");
    return 0;
  }
  return buffer;
}


x86 assembly (clang, -O0):
<get_lots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1180 <get_lots+0x50>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1188 <get_lots+0x58>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lots>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x1(%rbx),%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %ebp,%edi
mov    %rax,%rsi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1165 <get_lots+0x35>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"get_lots error\0A\00"
define i8* @get_lots(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = add nsw i32 %7, 1
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %6
%11 = load i32, i32* %4
%12 = load i8*, i8** %6
%13 = load i32, i32* %5
%14 = call i32 @recv(i32 %11, i8* %12, i32 %13, i32 0)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %20
18: ; preds = %2
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %18, %16
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@str = [15 x i8] c"get_lots error\00"
define i8* @get_lots(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @recv(i32 %0, i8* %5, i32 %1, i32 0)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %2, %8
%11 = phi i8* [ null, %8 ], [ %5, %2 ]
ret i8* %11
}
/* Variables and functions */
double mod2pi(double);
double mod2pi_ref(double ref, double vin) { return ref + mod2pi(vin - ref); }


x86 assembly (clang, -O0):
<mod2pi_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <mod2pi@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2pi_ref>:
push   %rax
movsd  %xmm0,(%rsp)
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <mod2pi@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mod2pi_ref(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = call double @mod2pi(double %8)
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
define double @mod2pi_ref(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double @mod2pi(double %3)
%5 = fadd double %4, %0
ret double %5
}
/* Variables and functions */
int empty();
int test(int, int);
int main(void) {
  int a = empty();
  return test(a, 5) + test(3, 0) + empty();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <empty@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1040 <test@plt>
mov    %eax,-0x10(%rbp)
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <test@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <empty@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <empty@plt>
mov    %eax,%edi
mov    $0x5,%esi
call   1040 <test@plt>
mov    %eax,%ebx
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <test@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <empty@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @empty()
%2 = tail call i32 @test(i32 %1, i32 5)
%3 = tail call i32 @test(i32 3, i32 0)
%4 = add nsw i32 %3, %2
%5 = tail call i32 (...) @empty()
%6 = add nsw i32 %4, %5
ret i32 %6
}
void asn1_ex_i2c(void) {}


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

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

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

LLVM IR (-O2):
define void @asn1_ex_i2c() {
ret void
}
char *b_get_argv(unsigned char nbr) {
  char *tchar;
  asm volatile("call 0x00100140" : : "a"(nbr));
  return tchar;
}


x86 assembly (clang, -O0):
<b_get_argv>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
call   100140 <completed.0+0xfc120>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_get_argv>:
mov    %edi,%eax
call   100140 <completed.0+0xfc120>
ret

LLVM IR (-O0):
define i8* @b_get_argv(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = load i8*, i8** %3
ret i8* %5
}

LLVM IR (-O2):
define i8* @b_get_argv(i8 zeroext %0) {
tail call void asm sideeffect "call 0x00100140", "{ax},~{dirflag},~{fpsr},~{flags}"(i8 %0)
ret i8* undef
}
void caller_2_2_2_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_2_1_1_1_1() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buff;

/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int copy(int in, int out) {
  char buff[1024];
  int reading;
  while ((reading = read(in, buff, sizeof(buff))) > 0)
    write(out, buff, reading);
  return out;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1040 <read@plt>
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
jle    116e <copy+0x4e>
mov    -0x8(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    -0x414(%rbp),%edx
call   1030 <write@plt>
jmp    1131 <copy+0x11>
mov    -0x8(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1170 <copy+0x50>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1150 <copy+0x30>
mov    %r14d,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @copy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1024 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %3
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%10 = call i32 @read(i32 %8, i8* %9, i32 1024)
store i32 %10, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32, i32* %4
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%15 = load i32, i32* %6
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
br label %7
17: ; preds = %7
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @copy(i32 %0, i32 returned %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 1024)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %5, %2 ]
%9 = call i32 @write(i32 %1, i8* %4, i32 %8)
%10 = call i32 @read(i32 %0, i8* %4, i32 1024)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int testBrkImplied();
void testBrk() { printf("testBrkImplied: %d\r\n", testBrkImplied()); }


x86 assembly (clang, -O0):
<testBrk>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <testBrkImplied@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBrk>:
push   %rax
xor    %eax,%eax
call   1040 <testBrkImplied@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"testBrkImplied: %d\0D\0A\00"
define void @testBrk() {
%1 = tail call i32 (...) @testBrkImplied()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int gca_cmp_int16(const void *aa, const void *bb) {
  const int16_t a = *(const int16_t *)aa;
  const int16_t b = *(const int16_t *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
cmp    -0x18(%rbp),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp_int16>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp_int16(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
%16 = zext i1 %15 to i32
%17 = load i64, i64* %6
%18 = load i64, i64* %5
%19 = icmp sgt i64 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_cmp_int16(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int jd_mque_create(int num) {}


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

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

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

LLVM IR (-O2):
define i32 @jd_mque_create(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ list_release(void *);
int /*<<< orphan*/ xfree(void *);
void free_channel_keylist_handler(void *key, void *value) {
  xfree(key);
  list_release(value);
}


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

x86 assembly (clang, -O2):
<free_channel_keylist_handler>:
push   %rbx
mov    %rsi,%rbx
call   1040 <xfree@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <list_release@plt>

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

LLVM IR (-O2):
define void @free_channel_keylist_handler(i8* %0, i8* %1) {
%3 = tail call i32 @xfree(i8* %0)
%4 = tail call i32 @list_release(i8* %1)
ret void
}
int adi_api_utils_gcd(int u, int v) {
  int t;
  while (v != 0) {
    t = u;
    u = v;
    v = t % v;
  }
  return u < 0 ? -u : u;
}


x86 assembly (clang, -O0):
<adi_api_utils_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <adi_api_utils_gcd+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
jmp    110a <adi_api_utils_gcd+0xa>
cmpl   $0x0,-0x4(%rbp)
jge    1146 <adi_api_utils_gcd+0x46>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114c <adi_api_utils_gcd+0x4c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adi_api_utils_gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <adi_api_utils_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <adi_api_utils_gcd+0x10>
jmp    111f <adi_api_utils_gcd+0x1f>
mov    %eax,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @adi_api_utils_gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
store i32 %11, i32* %3
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = srem i32 %12, %13
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 0, %19
br label %23
21: ; preds = %15
%22 = load i32, i32* %3
br label %23
23: ; preds = %21, %18
%24 = phi i32 [ %20, %18 ], [ %22, %21 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @adi_api_utils_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
%11 = tail call i32 @llvm.abs.i32(i32 %10, i1 true)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char input[4096];
  printf("Please enter a string.\n");
  fgets(input, 4096, stdin);
  printf("The string you entered is :\n%s", input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1010(%rbp),%rdi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    $0x1000,%esi
call   1040 <fgets@plt>
lea    -0x1010(%rbp),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1000,%rsp
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1050 <fgets@plt>
lea    0xe9c(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Please enter a string.\0A\00"
@stdin = global i32 0
@.str.1 = [31 x i8] c"The string you entered is :\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4096 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 4096, i32 %5)
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [31 x i8] c"The string you entered is :\0A%s\00"
@str = [23 x i8] c"Please enter a string.\00"
define i32 @main() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 4096, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
short C_ISINF(double);
int main() {
  short x = C_ISINF(0.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
call   1030 <C_ISINF@plt>
mov    %ax,-0x6(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
%3 = call signext i16 @C_ISINF(double 0.000000e+00)
store i16 %3, i16* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i16 @C_ISINF(double 0.000000e+00)
ret i32 0
}
char get_callsign_character_code(char ch) {
  if (ch >= 48 && ch <= 57) {
    return ch - 48;
  }
  if (ch == 32) {
    return 36;
  }
  if (ch >= 65 && ch <= 90) {
    return ch - 55;
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_callsign_character_code>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <get_callsign_character_code+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <get_callsign_character_code+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1176 <get_callsign_character_code+0x76>
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jne    1149 <get_callsign_character_code+0x49>
movb   $0x24,-0x1(%rbp)
jmp    1176 <get_callsign_character_code+0x76>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1172 <get_callsign_character_code+0x72>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1172 <get_callsign_character_code+0x72>
movsbl -0x2(%rbp),%eax
sub    $0x37,%eax
mov    %al,-0x1(%rbp)
jmp    1176 <get_callsign_character_code+0x76>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_callsign_character_code>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
jb     1124 <get_callsign_character_code+0x24>
mov    $0x24,%al
cmp    $0x20,%dil
je     1124 <get_callsign_character_code+0x24>
lea    -0x41(%rdi),%eax
add    $0xc9,%dil
cmp    $0x1a,%al
movzbl %dil,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @get_callsign_character_code(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %35
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 32
br i1 %19, label %20, label %21
20: ; preds = %16
store i8 36, i8* %2
br label %35
21: ; preds = %16
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %34
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 90
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i8, i8* %3
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %31, 55
%33 = trunc i32 %32 to i8
store i8 %33, i8* %2
br label %35
34: ; preds = %25, %21
store i8 -1, i8* %2
br label %35
35: ; preds = %34, %29, %20, %11
%36 = load i8, i8* %2
ret i8 %36
}

LLVM IR (-O2):
define signext i8 @get_callsign_character_code(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = icmp eq i8 %0, 32
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = add i8 %0, -65
%8 = icmp ult i8 %7, 26
%9 = add i8 %0, -55
%10 = select i1 %8, i8 %9, i8 -1
br label %11
11: ; preds = %1, %6, %4
%12 = phi i8 [ 36, %4 ], [ %10, %6 ], [ %2, %1 ]
ret i8 %12
}