xunge/DecIR huggingface dataset:
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int get_num() {
  char buf[16];
  printf("Enter secret number : ");
  fgets(buf, 16, stdin);
  return atoi(buf);
}


x86 assembly (clang, -O0):
<get_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    $0x10,%esi
call   1040 <fgets@plt>
lea    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atoi@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter secret number : \00"
@stdin = global i32 0
define i32 @get_num() {
%1 = alloca [16 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 16, i32 %4)
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%7 = call i32 @atoi(i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter secret number : \00"
@stdin = global i32 0
define i32 @get_num() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(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 16, i32 %4)
%6 = call i32 @atoi(i8* %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Cdgebs2d(int, char *, char *, int, int, double *, int);
void wcc_Cdgebs2d(int ConTxt, char *scope, char *top, int m, int n, char *A,
                  int lda) {
  Cdgebs2d(ConTxt, scope, top, m, n, (double *)A, lda);
}


x86 assembly (clang, -O0):
<wcc_Cdgebs2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <Cdgebs2d@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @wcc_Cdgebs2d(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
store i32 %0, i32* %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i8*, i8** %13
%21 = bitcast i8* %20 to double*
%22 = load i32, i32* %14
%23 = call i32 @Cdgebs2d(i32 %15, i8* %16, i8* %17, i32 %18, i32 %19, double* %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @wcc_Cdgebs2d(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = bitcast i8* %5 to double*
%9 = tail call i32 @Cdgebs2d(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4, double* %8, i32 %6)
ret void
}
void setup_wheels() {}


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

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

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

LLVM IR (-O2):
define void @setup_wheels() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int divide(int a, int b) {
  if (b == 0) {
    printf("Division domain invaded. Corn dumped.\n");
    exit(1);
  }
  return a / b;
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114e <divide+0x2e>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
test   %esi,%esi
je     112a <divide+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
push   %rax
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Division domain invaded. Corn dumped.\0A\00"
define i32 @divide(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sdiv i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
@str = [38 x i8] c"Division domain invaded. Corn dumped.\00"
define i32 @divide(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = sdiv i32 %0, %1
ret i32 %8
}
/* Variables and functions */
int initial_set();
int /*<<< orphan*/ make_fields();
int /*<<< orphan*/ make_lattice();
int /*<<< orphan*/ make_nn_gathers();
int /*<<< orphan*/ setup_layout();
int setup() {
  int prompt;
  prompt = initial_set();
  setup_layout();
  make_lattice();
  make_nn_gathers();
  make_fields();
  return prompt;
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <initial_set@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup_layout@plt>
mov    $0x0,%al
call   1070 <make_lattice@plt>
mov    $0x0,%al
call   1030 <make_nn_gathers@plt>
mov    $0x0,%al
call   1050 <make_fields@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rbx
xor    %eax,%eax
call   1060 <initial_set@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <setup_layout@plt>
xor    %eax,%eax
call   1070 <make_lattice@plt>
xor    %eax,%eax
call   1030 <make_nn_gathers@plt>
xor    %eax,%eax
call   1050 <make_fields@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @setup() {
%1 = alloca i32
%2 = call i32 (...) @initial_set()
store i32 %2, i32* %1
%3 = call i32 (...) @setup_layout()
%4 = call i32 (...) @make_lattice()
%5 = call i32 (...) @make_nn_gathers()
%6 = call i32 (...) @make_fields()
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @setup() {
%1 = tail call i32 (...) @initial_set()
%2 = tail call i32 (...) @setup_layout()
%3 = tail call i32 (...) @make_lattice()
%4 = tail call i32 (...) @make_nn_gathers()
%5 = tail call i32 (...) @make_fields()
ret i32 %1
}
/* Variables and functions */
long hash(char *);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[200] = {0};
  scanf("%s", word);
  long sum = hash(word);
  printf("%ld", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1050 <memset@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rsi
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0xc0(%rsp)
lea    0xe6b(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xe54(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [200 x i8]* %2 to i8*
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%8 = call i64 @hash(i8* %7)
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
void store64_r1(uint8_t *x, uint64_t u) {
  unsigned int i;
  for (i = 0; i < 8; ++i) {
    x[i] = u;
    u >>= 8;
  }
}


x86 assembly (clang, -O0):
<store64_r1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jae    1140 <store64_r1+0x40>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <store64_r1+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<store64_r1>:
mov    %esi,(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x8(%rdi)
movd   %esi,%xmm0
sar    $0x18,%esi
mov    %esi,0xc(%rdi)
pshufd $0x0,%xmm0,%xmm0
psrad  $0x1f,%xmm0
movdqu %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @store64_r1(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = ashr i32 %1, 16
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
%7 = ashr i32 %1, 24
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %8
%9 = ashr i32 %1, 31
%10 = getelementptr inbounds i32, i32* %0, i64 4
%11 = insertelement <4 x i32> poison, i32 %9, i64 0
%12 = shufflevector <4 x i32> %11, <4 x i32> poison, <4 x i32> zeroinitializer
%13 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> %12, <4 x i32>* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ GPIOBaseValid(unsigned long);
void GPIODMATriggerEnable(unsigned long ulPort, unsigned char ucPins) {
  DEBUG_ASSERT(GPIOBaseValid(ulPort));
  (*((volatile unsigned long *)(ulPort + 0x00000534))) |= ucPins;
}


x86 assembly (clang, -O0):
<GPIODMATriggerEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <GPIOBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
movzbl -0x9(%rbp),%eax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x534(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x534(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIODMATriggerEnable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <GPIOBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    %ebp,%eax
or     %rax,0x534(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @GPIODMATriggerEnable(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = call i32 @GPIOBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i8, i8* %4
%9 = zext i8 %8 to i64
%10 = load i64, i64* %3
%11 = add i64 %10, 1332
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @GPIODMATriggerEnable(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIOBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = zext i8 %1 to i64
%6 = add i64 %0, 1332
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_polygons_data(int, int, char *, char *, char *);
void fgmvwrite_polygons_data_(int *nverts, int *matnum, char *x, char *y,
                              char *z) {
  gmvwrite_polygons_data(*nverts, *matnum, x, y, z);
}


x86 assembly (clang, -O0):
<fgmvwrite_polygons_data_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <gmvwrite_polygons_data@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_polygons_data_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <gmvwrite_polygons_data@plt>

LLVM IR (-O0):
define void @fgmvwrite_polygons_data_(i32* %0, i32* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = call i32 @gmvwrite_polygons_data(i32 %12, i32 %14, i8* %15, i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_polygons_data_(i32* nocapture %0, i32* nocapture %1, i8* %2, i8* %3, i8* %4) {
%6 = load i32, i32* %0
%7 = load i32, i32* %1
%8 = tail call i32 @gmvwrite_polygons_data(i32 %6, i32 %7, i8* %2, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double pow(double x, double y) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @pow(double %0, double %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Lex_token_rec(struct Cyc_Lexing_lexbuf *,
                                     int /*<<< orphan*/);
int Cyc_Lex_token(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_Lex_token_rec(lexbuf, 0); });
}


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

x86 assembly (clang, -O2):
<Cyc_Lex_token>:
xor    %esi,%esi
jmp    1030 <Cyc_Lex_token_rec@plt>

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

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_token(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_Lex_token_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
char const *remote_l3();
const char *__attribute__((section(".test.c"))) call_remote_l3(void) {
  return remote_l3() + 1;
}


x86 assembly (clang, -O0):
<call_remote_l3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <remote_l3@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_remote_l3>:
push   %rax
xor    %eax,%eax
call   1030 <remote_l3@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_remote_l3() section ".test.c" {
%1 = call i8* (...) @remote_l3()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_remote_l3() section ".test.c" {
%1 = tail call i8* (...) @remote_l3()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ android_atomic_add(int, int /*<<< orphan*/ volatile *);
extern int32_t android_atomic_inc(volatile int32_t *addr) {
  return android_atomic_add(1, addr);
}


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

x86 assembly (clang, -O2):
<android_atomic_inc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <android_atomic_add@plt>

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

LLVM IR (-O2):
define i32 @android_atomic_inc(i32* %0) {
%2 = tail call i32 @android_atomic_add(i32 1, i32* %0)
ret i32 %2
}
int isUpper(char c) { return (c >= 'A' && c <= 'Z'); }


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

x86 assembly (clang, -O2):
<isUpper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isUpper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void put_device(int i) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @put_device(i32 %0) {
ret void
}
int llz_kaiser_cof_num(double ftrans, double atten) {
  int cof_num;
  if (atten <= 21.)
    cof_num = (int)((0.9222 * 2.) / ftrans);
  else
    cof_num = (int)(((atten - 7.95) * 2.) / (14.36 * ftrans));
  return cof_num;
}


x86 assembly (clang, -O0):
<llz_kaiser_cof_num>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     113a <llz_kaiser_cof_num+0x3a>
movsd  0xef7(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
jmp    116f <llz_kaiser_cof_num+0x6f>
movsd  -0x10(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llz_kaiser_cof_num>:
movsd  0xef8(%rip),%xmm2
ucomisd %xmm1,%xmm2
jae    1124 <llz_kaiser_cof_num+0x24>
addsd  0xefa(%rip),%xmm1
addsd  %xmm1,%xmm1
mulsd  0xef6(%rip),%xmm0
jmp    112c <llz_kaiser_cof_num+0x2c>
movsd  0xedc(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @llz_kaiser_cof_num(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fcmp ole double %6, 2.100000e+01
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %3
%10 = fdiv double 1.844400e+00, %9
%11 = fptosi double %10 to i32
store i32 %11, i32* %5
br label %20
12: ; preds = %2
%13 = load double, double* %4
%14 = fsub double %13, 7.950000e+00
%15 = fmul double %14, 2.000000e+00
%16 = load double, double* %3
%17 = fmul double 1.436000e+01, %16
%18 = fdiv double %15, %17
%19 = fptosi double %18 to i32
store i32 %19, i32* %5
br label %20
20: ; preds = %12, %8
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @llz_kaiser_cof_num(double %0, double %1) {
%3 = fcmp ugt double %1, 2.100000e+01
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = fdiv double 1.844400e+00, %0
br label %11
6: ; preds = %2
%7 = fadd double %1, -7.950000e+00
%8 = fmul double %7, 2.000000e+00
%9 = fmul double %0, 1.436000e+01
%10 = fdiv double %8, %9
br label %11
11: ; preds = %6, %4
%12 = phi double [ %5, %4 ], [ %10, %6 ]
%13 = fptosi double %12 to i32
ret i32 %13
}
void foo533(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo533(i32 %0) {
ret void
}
void __attribute__((noreturn)) abort(void) {
  for (;;)
    __builtin_trap();
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <abort+0x9>
ud2
jmp    1109 <abort+0x9>

x86 assembly (clang, -O2):
<abort>:
ud2

LLVM IR (-O0):
define void @abort() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @abort() {
tail call void @llvm.trap()
unreachable
}
void free_4dim_contig(void ****a) {
  free(a[0][0][0]);
  free(a[0][0]);
  free(a[0]);
  free(a);
  return;
}


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

x86 assembly (clang, -O2):
<free_4dim_contig>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_4dim_contig(i8**** %0) {
%2 = alloca i8****
store i8**** %0, i8***** %2
%3 = load i8****, i8***** %2
%4 = getelementptr inbounds i8***, i8**** %3, i64 0
%5 = load i8***, i8**** %4
%6 = getelementptr inbounds i8**, i8*** %5, i64 0
%7 = load i8**, i8*** %6
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = load i8****, i8***** %2
%11 = getelementptr inbounds i8***, i8**** %10, i64 0
%12 = load i8***, i8**** %11
%13 = getelementptr inbounds i8**, i8*** %12, i64 0
%14 = load i8**, i8*** %13
%15 = bitcast i8** %14 to i8*
%16 = load i8****, i8***** %2
%17 = getelementptr inbounds i8***, i8**** %16, i64 0
%18 = load i8***, i8**** %17
%19 = bitcast i8*** %18 to i8*
%20 = load i8****, i8***** %2
%21 = bitcast i8**** %20 to i8*
ret void
}

LLVM IR (-O2):
define void @free_4dim_contig(i8**** nocapture %0) {
%2 = load i8***, i8**** %0
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
%5 = bitcast i8**** %0 to i8***
%6 = load i8**, i8*** %5
%7 = load i8*, i8** %6
tail call void @free(i8* %7)
%8 = bitcast i8**** %0 to i8**
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = bitcast i8**** %0 to i8*
tail call void @free(i8* %10)
ret void
}
int main() {
  int a = 1;
  int b = 2;
  int c = 3;
  int d = 4;
  int e = 5;
  int f = 6;
  int g = 7;
  int h = 8;
  int j = 9;
  int i = 10;
  int k = 11;
  int l = 12;
  int m = 13;
  int n = 14;
  int o = 15;
  int p = 16;
  int q = 17;
  int r = 18;
  int s = 19;
  int t = 20;
  int u = 21;
  int v = 22;
  int w = 23;
  int x = 24;
  int y = 25;
  int z = 26;
  return z;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
movl   $0x6,-0x1c(%rbp)
movl   $0x7,-0x20(%rbp)
movl   $0x8,-0x24(%rbp)
movl   $0x9,-0x28(%rbp)
movl   $0xa,-0x2c(%rbp)
movl   $0xb,-0x30(%rbp)
movl   $0xc,-0x34(%rbp)
movl   $0xd,-0x38(%rbp)
movl   $0xe,-0x3c(%rbp)
movl   $0xf,-0x40(%rbp)
movl   $0x10,-0x44(%rbp)
movl   $0x11,-0x48(%rbp)
movl   $0x12,-0x4c(%rbp)
movl   $0x13,-0x50(%rbp)
movl   $0x14,-0x54(%rbp)
movl   $0x15,-0x58(%rbp)
movl   $0x16,-0x5c(%rbp)
movl   $0x17,-0x60(%rbp)
movl   $0x18,-0x64(%rbp)
movl   $0x19,-0x68(%rbp)
movl   $0x1a,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
store i32 4, i32* %5
store i32 5, i32* %6
store i32 6, i32* %7
store i32 7, i32* %8
store i32 8, i32* %9
store i32 9, i32* %10
store i32 10, i32* %11
store i32 11, i32* %12
store i32 12, i32* %13
store i32 13, i32* %14
store i32 14, i32* %15
store i32 15, i32* %16
store i32 16, i32* %17
store i32 17, i32* %18
store i32 18, i32* %19
store i32 19, i32* %20
store i32 20, i32* %21
store i32 21, i32* %22
store i32 22, i32* %23
store i32 23, i32* %24
store i32 24, i32* %25
store i32 25, i32* %26
store i32 26, i32* %27
%28 = load i32, i32* %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @main() {
ret i32 26
}
int sched_yield() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sched_yield() {
ret i32 0
}
/* Variables and functions */
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ syserr(char *);
int main() {
  printf("Hello from %d\n", getpid());
  if (fork() == -1)
    syserr("Error in fork\n");
  printf("Goodbye from %d\n", getpid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0xffffffff,%eax
jne    1180 <main+0x40>
lea    0xe94(%rip),%rdi
call   1050 <syserr@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <fork@plt>
cmp    $0xffffffff,%eax
jne    116e <main+0x2e>
lea    0xea6(%rip),%rdi
call   1050 <syserr@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello from %d\0A\00"
@.str.1 = [15 x i8] c"Error in fork\0A\00"
@.str.2 = [17 x i8] c"Goodbye from %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @fork()
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @syserr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = call i32 (...) @getpid()
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello from %d\0A\00"
@.str.1 = [15 x i8] c"Error in fork\0A\00"
@.str.2 = [17 x i8] c"Goodbye from %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @syserr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = tail call i32 (...) @getpid()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
unsigned int bdf_string_hash(const char *str) {
  unsigned int hash = 5381;
  char c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<bdf_string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
cmp    $0x0,%al
je     1142 <bdf_string_hash+0x42>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
movsbl -0xd(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <bdf_string_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdf_string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <bdf_string_hash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <bdf_string_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @bdf_string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i32 %7, 33
%10 = sext i8 %5 to i32
%11 = add i32 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void handler(int sig) {
  static int count = 0;
  if (count >= 3)
    exit(EXIT_SUCCESS);
  else {
    printf("Get %d SIGINT\n", count);
    count++;
  }
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,0x2f02(%rip)
jl     1146 <handler+0x26>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2ee8(%rip),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ed6(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ecd(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    0x2f0d(%rip),%esi
cmp    $0x3,%esi
jge    1141 <handler+0x21>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
addl   $0x1,0x2ef5(%rip)
pop    %rax
ret
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@handler.count = internal global i32 0
@EXIT_SUCCESS = global i32 0
@.str = [15 x i8] c"Get %d SIGINT\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @handler.count
%4 = icmp sge i32 %3, 3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = load i32, i32* @handler.count
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @handler.count
%12 = add nsw i32 %11, 1
store i32 %12, i32* @handler.count
br label %13
13: ; preds = %8
ret void
}

LLVM IR (-O2):
@handler.count = internal unnamed_addr global i32 0
@EXIT_SUCCESS = global i32 0
@.str = [15 x i8] c"Get %d SIGINT\0A\00"
define void @handler(i32 %0) {
%2 = load i32, i32* @handler.count
%3 = icmp sgt i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%9 = load i32, i32* @handler.count
%10 = add nsw i32 %9, 1
store i32 %10, i32* @handler.count
ret void
}
/* Type definitions */
struct sdeque {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ check_back_api(struct sdeque *);
int /*<<< orphan*/ check_front_api(struct sdeque *);
int /*<<< orphan*/ check_mixed_api(struct sdeque *);
int /*<<< orphan*/ sdeque_free(struct sdeque *);
struct sdeque *sdeque_new();
int main(int argc, char **argv) {
  struct sdeque *sdeque = sdeque_new();
  check_back_api(sdeque);
  check_front_api(sdeque);
  check_mixed_api(sdeque);
  sdeque_free(sdeque);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <sdeque_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <check_back_api@plt>
mov    -0x18(%rbp),%rdi
call   1070 <check_front_api@plt>
mov    -0x18(%rbp),%rdi
call   1040 <check_mixed_api@plt>
mov    -0x18(%rbp),%rdi
call   1050 <sdeque_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <sdeque_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <check_back_api@plt>
mov    %rbx,%rdi
call   1070 <check_front_api@plt>
mov    %rbx,%rdi
call   1040 <check_mixed_api@plt>
mov    %rbx,%rdi
call   1050 <sdeque_free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sdeque = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sdeque*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call %struct.sdeque* (...) @sdeque_new()
store %struct.sdeque* %7, %struct.sdeque** %6
%8 = load %struct.sdeque*, %struct.sdeque** %6
%9 = call i32 @check_back_api(%struct.sdeque* %8)
%10 = load %struct.sdeque*, %struct.sdeque** %6
%11 = call i32 @check_front_api(%struct.sdeque* %10)
%12 = load %struct.sdeque*, %struct.sdeque** %6
%13 = call i32 @check_mixed_api(%struct.sdeque* %12)
%14 = load %struct.sdeque*, %struct.sdeque** %6
%15 = call i32 @sdeque_free(%struct.sdeque* %14)
ret i32 0
}

LLVM IR (-O2):
%struct.sdeque = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.sdeque* (...) @sdeque_new()
%4 = tail call i32 @check_back_api(%struct.sdeque* %3)
%5 = tail call i32 @check_front_api(%struct.sdeque* %3)
%6 = tail call i32 @check_mixed_api(%struct.sdeque* %3)
%7 = tail call i32 @sdeque_free(%struct.sdeque* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fft();
int /*<<< orphan*/ imprimeVetor();
int /*<<< orphan*/ inicializaArray();
int /*<<< orphan*/ ordenaBitReverso();
int main(void) {
  int j = 1;
  for (j = 0; j < 100000; j++) {
    inicializaArray();
    ordenaBitReverso();
    fft();
  }
  imprimeVetor();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    118d <main+0x4d>
mov    $0x0,%al
call   1040 <inicializaArray@plt>
mov    $0x0,%al
call   1030 <ordenaBitReverso@plt>
mov    $0x0,%al
call   1060 <fft@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115d <main+0x1d>
mov    $0x0,%al
call   1050 <imprimeVetor@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x186a0,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <inicializaArray@plt>
xor    %eax,%eax
call   1030 <ordenaBitReverso@plt>
xor    %eax,%eax
call   1060 <fft@plt>
add    $0xffffffff,%ebx
jne    1150 <main+0x10>
xor    %eax,%eax
call   1050 <imprimeVetor@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100000
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = call i32 (...) @inicializaArray()
%8 = call i32 (...) @ordenaBitReverso()
%9 = call i32 (...) @fft()
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = call i32 (...) @imprimeVetor()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @inicializaArray()
%4 = tail call i32 (...) @ordenaBitReverso()
%5 = tail call i32 (...) @fft()
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 100000
br i1 %7, label %8, label %1
8: ; preds = %1
%9 = tail call i32 (...) @imprimeVetor()
ret i32 0
}
/* Variables and functions */
int d10(int);
int d11(int a) { return d10(d10(a)); }


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

x86 assembly (clang, -O2):
<d11>:
push   %rax
call   1030 <d10@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d10@plt>

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

LLVM IR (-O2):
define i32 @d11(i32 %0) {
%2 = tail call i32 @d10(i32 %0)
%3 = tail call i32 @d10(i32 %2)
ret i32 %3
}
void ff_hevc_put_hevc_qpel_v4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v4_10_sse4() {
ret void
}
void test_four(int x, int y) {
#pragma omp taskloop collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_four+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_four+0x43>
jmp    1135 <test_four+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_four+0x24>
jmp    1148 <test_four+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_four+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_four(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
unsigned int sleep2(int);
int main(void) {
  printf("Going to sleep for 5 seconds.\n");
  unsigned int sleep_left = sleep2(5);
  printf("Woke up after %u seconds.\n", 5 - sleep_left);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep2@plt>
mov    %eax,-0x8(%rbp)
mov    $0x5,%esi
sub    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%ebx
mov    $0x5,%edi
call   1050 <sleep2@plt>
sub    %eax,%ebx
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Going to sleep for 5 seconds.\0A\00"
@.str.1 = [27 x i8] c"Woke up after %u seconds.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep2(i32 5)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sub i32 5, %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Woke up after %u seconds.\0A\00"
@str = [30 x i8] c"Going to sleep for 5 seconds.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep2(i32 5)
%3 = sub i32 5, %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
unsigned short bytes2ushort(char *);
int /*<<< orphan*/ memcpy(char *, char *, unsigned short);
size_t getData(char *packet, char *data) {
  unsigned short int len = bytes2ushort(&packet[6]);
  memcpy(data, &packet[10], len);
  return len;
}


x86 assembly (clang, -O0):
<getData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
call   1030 <bytes2ushort@plt>
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0xa,%rsi
mov    -0x12(%rbp),%ax
movzwl %ax,%edx
call   1040 <memcpy@plt>
movzwl -0x12(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getData>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x6,%rdi
call   1030 <bytes2ushort@plt>
add    $0xa,%rbx
movzwl %ax,%r15d
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @getData(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i16
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 6
%8 = call zeroext i16 @bytes2ushort(i8* %7)
store i16 %8, i16* %5
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 10
%12 = load i16, i16* %5
%13 = call i32 @memcpy(i8* %9, i8* %11, i16 zeroext %12)
%14 = load i16, i16* %5
%15 = zext i16 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @getData(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 6
%4 = tail call zeroext i16 @bytes2ushort(i8* %3)
%5 = getelementptr inbounds i8, i8* %0, i64 10
%6 = tail call i32 @memcpy(i8* %1, i8* %5, i16 zeroext %4)
%7 = zext i16 %4 to i64
ret i64 %7
}
void free_sensor_directories(char **dirs, unsigned int n) {
  while (n > 0) {
    free(dirs[--n]);
  }
  free(dirs);
}


x86 assembly (clang, -O0):
<free_sensor_directories>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1146 <free_sensor_directories+0x36>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <free_sensor_directories+0xf>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_sensor_directories>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
je     1130 <free_sensor_directories+0x20>
mov    %esi,%ebx
nopl   (%rax)
mov    -0x8(%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <free_sensor_directories+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

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