xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fat(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Digite um numero para calcular o fatorial : ");
  scanf("%d", &num);
  fat(num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <fat@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fat@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Digite um numero para calcular o fatorial : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fat(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"Digite um numero para calcular o fatorial : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fat(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *, int, char *);
void *malloc(size_t);
void *h2o_mem_alloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/devnexen/h2o/refs/heads/"
               "master/lib/common/h2o/memory.h",
               406, "no memory");
  return p;
}


x86 assembly (clang, -O0):
<h2o_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <h2o_mem_alloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x196,%esi
lea    0xf3a(%rip),%rdx
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <h2o_mem_alloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf55(%rip),%rdx
mov    $0x196,%esi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/devnexen/h2o/refs/heads/master/lib/common/h2o/memory.h\00"
@.str.1 = [10 x i8] c"no memory\00"
define i8* @h2o_mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @h2o__fatal(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 406, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/devnexen/h2o/refs/heads/master/lib/common/h2o/memory.h\00"
@.str.1 = [10 x i8] c"no memory\00"
define noalias i8* @h2o_mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 406, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
__attribute__((always_)) void mpol_get(struct mempolicy *pol) {}


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

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

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

LLVM IR (-O2):
%struct.mempolicy = type opaque
define void @mpol_get(%struct.mempolicy* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, float *, int);
int floatToInt(float i) {
  int result;
  memcpy(&result, &i, 4);
  return result;
}


x86 assembly (clang, -O0):
<floatToInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatToInt>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @floatToInt(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i32* %3, float* %2, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
int test_imm_C1int8_reg(signed char val) {
  return ((val) & (0xC1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C1int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xc1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_C1int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 193
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_C1int8_reg(i8 signext %0) {
%2 = and i8 %0, -63
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int min(int a, int b, int c) {
  int m;
  if (a <= b) {
    if (a <= c)
      m = a;
    else
      m = c;
  } else
    m = (b <= c) ? b : c;
  return m;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     113b <min+0x3b>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1130 <min+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <min+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115e <min+0x5e>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1152 <min+0x52>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <min+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @min(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* %4
store i32 %16, i32* %7
br label %19
17: ; preds = %11
%18 = load i32, i32* %6
store i32 %18, i32* %7
br label %19
19: ; preds = %17, %15
br label %30
20: ; preds = %3
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp sle i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %5
br label %28
26: ; preds = %20
%27 = load i32, i32* %6
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
store i32 %29, i32* %7
br label %30
30: ; preds = %28, %19
%31 = load i32, i32* %7
ret i32 %31
}

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

/* Variables and functions */
struct BufferedInputStream *bufferedInputStream_sb(int /*<<< orphan*/,
                                                   unsigned long long);
int /*<<< orphan*/ stdin;
struct BufferedInputStream *
bufferedInputStream_b(unsigned long long bufferSize) {
  return bufferedInputStream_sb(stdin, bufferSize);
}


x86 assembly (clang, -O0):
<bufferedInputStream_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <bufferedInputStream_sb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufferedInputStream_b>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <bufferedInputStream_sb@plt>

LLVM IR (-O0):
%struct.BufferedInputStream = type { i32 }
@stdin = global i32 0
define %struct.BufferedInputStream* @bufferedInputStream_b(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @stdin
%4 = load i64, i64* %2
%5 = call %struct.BufferedInputStream* @bufferedInputStream_sb(i32 %3, i64 %4)
ret %struct.BufferedInputStream* %5
}

LLVM IR (-O2):
%struct.BufferedInputStream = type { i32 }
@stdin = global i32 0
define %struct.BufferedInputStream* @bufferedInputStream_b(i64 %0) {
%2 = load i32, i32* @stdin
%3 = tail call %struct.BufferedInputStream* @bufferedInputStream_sb(i32 %2, i64 %0)
ret %struct.BufferedInputStream* %3
}
int test_imm_EFuint16_mem(unsigned short *val) {
  return ((*val) & (-0xEF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EFuint16_mem>:
movzwl (%rdi),%eax
test   $0xff11,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EFuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -239
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_EFuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -239
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct city {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ save_city(struct city *);
void menu_save_city(struct city *the_city) { save_city(the_city); }


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

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

LLVM IR (-O0):
%struct.city = type { i32 }
define void @menu_save_city(%struct.city* %0) {
%2 = alloca %struct.city*
store %struct.city* %0, %struct.city** %2
%3 = load %struct.city*, %struct.city** %2
%4 = call i32 @save_city(%struct.city* %3)
ret void
}

LLVM IR (-O2):
%struct.city = type { i32 }
define void @menu_save_city(%struct.city* %0) {
%2 = tail call i32 @save_city(%struct.city* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calcRoot(int *, float *);
int /*<<< orphan*/ getValue(int *);
int /*<<< orphan*/ printf(char *, float, float);
int main() {
  int coeff[3];
  float roots[2];
  getValue(coeff);
  calcRoot(coeff, roots);
  printf("Roots are: %.2f %.2f \n", *(roots), *(roots + 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1050 <getValue@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <calcRoot@plt>
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0x14(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <getValue@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <calcRoot@plt>
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Roots are: %.2f %.2f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca [2 x float]
store i32 0, i32* %1
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = call i32 @getValue(i32* %4)
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%8 = call i32 @calcRoot(i32* %6, float* %7)
%9 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%10 = load float, float* %9
%11 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %10, float %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Roots are: %.2f %.2f \0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [2 x float]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [2 x float]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = call i32 @getValue(i32* %5)
%7 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%8 = call i32 @calcRoot(i32* %5, float* %7)
%9 = load float, float* %7
%10 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
%11 = load float, float* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %9, float %11)
ret i32 0
}
/* Variables and functions */
float M_PI_2;
float sin(float);
float SineEaseOut(float p) { return sin(p * M_PI_2); }


x86 assembly (clang, -O0):
<SineEaseOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mulss  (%rax),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SineEaseOut>:
mov    0x2ed1(%rip),%rax
mulss  (%rax),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
@M_PI_2 = global float 0.000000e+00
define float @SineEaseOut(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* @M_PI_2
%5 = fmul float %3, %4
%6 = call float @sin(float %5)
ret float %6
}

LLVM IR (-O2):
@M_PI_2 = global float 0.000000e+00
define float @SineEaseOut(float %0) {
%2 = load float, float* @M_PI_2
%3 = fmul float %2, %0
%4 = tail call float @sin(float %3)
ret float %4
}
int ask_testdisk_log_creation() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ask_testdisk_log_creation() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gfx_init();
int /*<<< orphan*/ gfx_setcursortype(int);
void _setcursortype(int type) {
  gfx_init();
  gfx_setcursortype(type);
}


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

x86 assembly (clang, -O2):
<_setcursortype>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <gfx_init@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <gfx_setcursortype@plt>

LLVM IR (-O0):
define void @_setcursortype(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gfx_init()
%4 = load i32, i32* %2
%5 = call i32 @gfx_setcursortype(i32 %4)
ret void
}

LLVM IR (-O2):
define void @_setcursortype(i32 %0) {
%2 = tail call i32 (...) @gfx_init()
%3 = tail call i32 @gfx_setcursortype(i32 %0)
ret void
}
void setpwent(void) {}


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

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

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

LLVM IR (-O2):
define void @setpwent() {
ret void
}
/* Variables and functions */
int sgsarrcomp_smi(void const *, void const *, void *);
int sgsarrcomp_smi_rev(const void *p1, const void *p2, void *userdata) {
  return sgsarrcomp_smi(p2, p1, userdata);
}


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

x86 assembly (clang, -O2):
<sgsarrcomp_smi_rev>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <sgsarrcomp_smi@plt>

LLVM IR (-O0):
define i32 @sgsarrcomp_smi_rev(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
%10 = call i32 @sgsarrcomp_smi(i8* %7, i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sgsarrcomp_smi_rev(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @sgsarrcomp_smi(i8* %1, i8* %0, i8* %2)
ret i32 %4
}
void gtk_tool_button_set_label_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_button_set_label_widget() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int pthread_self();
int /*<<< orphan*/ sleep(int);
void *run(void *arg) {
  printf("This is  thread id = %X\n", pthread_self());
  sleep(30);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1e,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1e,%edi
call   1060 <sleep@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"This is thread id = %X\0A\00"
define i8* @run(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @pthread_self()
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @sleep(i32 30)
%7 = call i32 @pthread_exit(i32* null)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [25 x i8] c"This is thread id = %X\0A\00"
define noalias i8* @run(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 30)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgldsb(int n) { lgen("%s\t%c%d,%%al", "movb", n); }


x86 assembly (clang, -O0):
<cgldsb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <lgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgldsb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09%c%d,%%al\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgldsb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09%c%d,%%al\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgldsb(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
int test_imm_F3int8_reg(signed char val) {
  return ((val) & (0xF3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F3int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xf3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_F3int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 243
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F3int8_reg(i8 signext %0) {
%2 = and i8 %0, -13
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((visibility("default"))) void FBGetFrameBufferInfo(void *pinfo) {}


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

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

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

LLVM IR (-O2):
define void @FBGetFrameBufferInfo(i8* nocapture %0) {
ret void
}
const int *const_ret_func() {
  static int count = 0;
  count++;
  return &count;
}


x86 assembly (clang, -O0):
<const_ret_func>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
lea    0x2f0a(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<const_ret_func>:
lea    0x2f1d(%rip),%rax
addl   $0x1,0x2f16(%rip)
ret

LLVM IR (-O0):
@const_ret_func.count = internal global i32 0
define i32* @const_ret_func() {
%1 = load i32, i32* @const_ret_func.count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @const_ret_func.count
ret i32* @const_ret_func.count
}

LLVM IR (-O2):
@const_ret_func.count = internal global i32 0
define i32* @const_ret_func() {
%1 = load i32, i32* @const_ret_func.count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @const_ret_func.count
ret i32* @const_ret_func.count
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void swap_uint32(uint32_t *x) {
  char n = ((char *)x)[0];
  ((char *)x)[0] = ((char *)x)[3];
  ((char *)x)[3] = n;
  n = ((char *)x)[1];
  ((char *)x)[1] = ((char *)x)[2];
  ((char *)x)[2] = n;
}


x86 assembly (clang, -O0):
<swap_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_uint32>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

LLVM IR (-O0):
define void @swap_uint32(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = bitcast i32* %4 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
store i8 %7, i8* %3
%8 = load i32*, i32** %2
%9 = bitcast i32* %8 to i8*
%10 = getelementptr inbounds i8, i8* %9, i64 3
%11 = load i8, i8* %10
%12 = load i32*, i32** %2
%13 = bitcast i32* %12 to i8*
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %11, i8* %14
%15 = load i8, i8* %3
%16 = load i32*, i32** %2
%17 = bitcast i32* %16 to i8*
%18 = getelementptr inbounds i8, i8* %17, i64 3
store i8 %15, i8* %18
%19 = load i32*, i32** %2
%20 = bitcast i32* %19 to i8*
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
store i8 %22, i8* %3
%23 = load i32*, i32** %2
%24 = bitcast i32* %23 to i8*
%25 = getelementptr inbounds i8, i8* %24, i64 2
%26 = load i8, i8* %25
%27 = load i32*, i32** %2
%28 = bitcast i32* %27 to i8*
%29 = getelementptr inbounds i8, i8* %28, i64 1
store i8 %26, i8* %29
%30 = load i8, i8* %3
%31 = load i32*, i32** %2
%32 = bitcast i32* %31 to i8*
%33 = getelementptr inbounds i8, i8* %32, i64 2
store i8 %30, i8* %33
ret void
}

LLVM IR (-O2):
define void @swap_uint32(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 3
%5 = load i8, i8* %4
store i8 %5, i8* %2
store i8 %3, i8* %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %2, i64 2
%9 = load i8, i8* %8
store i8 %9, i8* %6
store i8 %7, i8* %8
ret void
}
int square(int n) { return n * n; }


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

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

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

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void g_value_set_enum() {}


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

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

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

LLVM IR (-O2):
define void @g_value_set_enum() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
scalar_t__ errno;
void ActualFileClose(int handle) {
  if (handle < 0)
    return;
  errno = 0;
  close(handle);
  return;
}


x86 assembly (clang, -O0):
<ActualFileClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <ActualFileClose+0x1a>
jmp    1140 <ActualFileClose+0x30>
mov    0x2eaf(%rip),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActualFileClose>:
test   %edi,%edi
js     1127 <ActualFileClose+0x17>
mov    0x2ec5(%rip),%rax
movq   $0x0,(%rax)
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
@errno = global i64 0
define void @ActualFileClose(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
store i64 0, i64* @errno
%7 = load i32, i32* %2
%8 = call i32 @close(i32 %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@errno = global i64 0
define void @ActualFileClose(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
store i64 0, i64* @errno
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
struct filter_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ filter_cmdline_parser_release(struct filter_args_info *);
void filter_cmdline_parser_free(struct filter_args_info *args_info) {
  filter_cmdline_parser_release(args_info);
}


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

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

LLVM IR (-O0):
%struct.filter_args_info = type { i32 }
define void @filter_cmdline_parser_free(%struct.filter_args_info* %0) {
%2 = alloca %struct.filter_args_info*
store %struct.filter_args_info* %0, %struct.filter_args_info** %2
%3 = load %struct.filter_args_info*, %struct.filter_args_info** %2
%4 = call i32 @filter_cmdline_parser_release(%struct.filter_args_info* %3)
ret void
}

LLVM IR (-O2):
%struct.filter_args_info = type { i32 }
define void @filter_cmdline_parser_free(%struct.filter_args_info* %0) {
%2 = tail call i32 @filter_cmdline_parser_release(%struct.filter_args_info* %0)
ret void
}
const char *get_valid_suite_name(const char *suite_name) {
  return suite_name ? suite_name : "global_suite";
}


x86 assembly (clang, -O0):
<get_valid_suite_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <get_valid_suite_name+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <get_valid_suite_name+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <get_valid_suite_name+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_valid_suite_name>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"global_suite\00"
define i8* @get_valid_suite_name(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
void RTAvlrPVDoWithAll(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrPVDoWithAll() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_dioad_function_list();
void dioad_init() { register_dioad_function_list(); }


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

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

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

LLVM IR (-O2):
define void @dioad_init() {
%1 = tail call i32 (...) @register_dioad_function_list()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fb_Sleep(int);
void fb_SleepQB(int secs) { fb_Sleep(secs < 0 ? secs : secs * 1000); }


x86 assembly (clang, -O0):
<fb_SleepQB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1130 <fb_SleepQB+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113a <fb_SleepQB+0x2a>
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fb_Sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_SleepQB>:
imul   $0x3e8,%edi,%eax
test   %edi,%edi
cmovns %eax,%edi
jmp    1030 <fb_Sleep@plt>

LLVM IR (-O0):
define void @fb_SleepQB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, 1000
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
%12 = call i32 @fb_Sleep(i32 %11)
ret void
}

LLVM IR (-O2):
define void @fb_SleepQB(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = mul nsw i32 %0, 1000
%4 = select i1 %2, i32 %0, i32 %3
%5 = tail call i32 @fb_Sleep(i32 %4)
ret void
}
double sub(double x1, double x2) { return x1 - x2; }


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

x86 assembly (clang, -O2):
<sub>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sub(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 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @sub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpacklo_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_unpacklo_pi16(s1, s2);
}


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

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

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpacklo_pi16(i32 %0, i32 %1)
ret i32 %3
}
int _isatty(int fd) {
  if (fd == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <_isatty+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <_isatty+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isatty>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void ft_free_tab(char **tab) {
  int i;
  i = 0;
  if (!tab)
    return;
  while (tab[i])
    free(tab[i++]);
  free(tab);
}


x86 assembly (clang, -O0):
<ft_free_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <ft_free_tab+0x23>
jmp    1174 <ft_free_tab+0x64>
jmp    1138 <ft_free_tab+0x28>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     116b <ft_free_tab+0x5b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1138 <ft_free_tab+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_free_tab>:
test   %rdi,%rdi
je     1150 <ft_free_tab+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <ft_free_tab+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <ft_free_tab+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @ft_free_tab(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
%9 = add nuw nsw i64 %7, 1
tail call void @free(i8* %8)
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %1, %13
ret void
}
/* Variables and functions */
int rand();
int revealDoor(int chosenDoor, int *doors) {
  int revealedDoor;
  do {
    revealedDoor = rand() % 3;
  } while (revealedDoor == chosenDoor || doors[revealedDoor] == 1);
  return revealedDoor;
}


x86 assembly (clang, -O0):
<revealDoor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x15(%rbp)
je     1154 <revealDoor+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    111f <revealDoor+0xf>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revealDoor>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cmp    %ebp,%eax
je     1120 <revealDoor+0x10>
movslq %eax,%rcx
cmpl   $0x1,(%rbx,%rcx,4)
je     1120 <revealDoor+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @revealDoor(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 = %20, %2
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 3
store i32 %8, i32* %5
br label %9
9: ; preds = %6
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = icmp eq i32 %10, %11
br i1 %12, label %20, label %13
13: ; preds = %9
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 1
br label %20
20: ; preds = %13, %9
%21 = phi i1 [ true, %9 ], [ %19, %13 ]
br i1 %21, label %6, label %22
22: ; preds = %20
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @revealDoor(i32 %0, i32* nocapture %1) {
br label %3
3: ; preds = %12, %2
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 3
%6 = icmp eq i32 %5, %0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %7, %3
br label %3
13: ; preds = %7
ret i32 %5
}
/* Variables and functions */
int strToRegNum(char *);
int strToRRegNum(char *token) {
  int returnReg = strToRegNum(token);
  return returnReg;
}


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

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

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

LLVM IR (-O2):
define i32 @strToRRegNum(i8* %0) {
%2 = tail call i32 @strToRegNum(i8* %0)
ret i32 %2
}
void outl(short port, unsigned int val) {
  __asm__ volatile("outl %0,%1" : : "a"(val), "d"(port));
  return;
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x2(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%eax
mov    %edi,%edx
out    %eax,(%dx)
ret

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

LLVM IR (-O2):
define void @outl(i16 signext %0, i32 %1) {
tail call void asm sideeffect "outl $0,$1", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i16 %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_number_of_points_in_cell(int i, int r, int *length) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(88, &i, length, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_number_of_points_in_cell>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x58,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @celcon_number_of_points_in_cell(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 88, i32* %4, i32* %2, double* undef, i32 0)
ret i32 %5
}
int ZEND_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { ZEND_VM_NEXT_OPCODE(); }


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

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

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

LLVM IR (-O2):
define i32 @ZEND_NOP_SPEC_HANDLER(i32 %0) {
%2 = tail call i32 (...) @ZEND_VM_NEXT_OPCODE()
ret i32 undef
}
int test_imm_32int64_lowword_mem(long long *val) {
  return ((*val) & (0x32 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_32int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 50
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_32int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 50
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help_sleep(int argc, char **argv) {
  printf("\n\033[1msleep [<seconds>] [text]\033[0m\n"
         "  Print <text> and pause execution of script for <seconds>.\n"
         "  If <seconds>=0 or missing, pause until a key is pressed. \n"
         "  See \033[1mload [filename]\033[0m\n");
  return 1;
}


x86 assembly (clang, -O0):
<help_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [185 x i8] c"\0A\1B[1msleep [<seconds>] [text]\1B[0m\0A Print <text> and pause execution of script for <seconds>.\0A If <seconds>=0 or missing, pause until a key is pressed. \0A See \1B[1mload [filename]\1B[0m\0A\00"
define i32 @help_sleep(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [184 x i8] c"\0A\1B[1msleep [<seconds>] [text]\1B[0m\0A Print <text> and pause execution of script for <seconds>.\0A If <seconds>=0 or missing, pause until a key is pressed. \0A See \1B[1mload [filename]\1B[0m\00"
define i32 @help_sleep(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([184 x i8], [184 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ memccpy(char *, char const *, char, int);
void _strlcpy(char *to, const char *from, int l) {
  memccpy(to, from, '\0', l);
  to[l - 1] = '\0';
}


x86 assembly (clang, -O0):
<_strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %edx,%edx
call   1030 <memccpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlcpy>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
xor    %edx,%edx
mov    %ebp,%ecx
call   1030 <memccpy@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @_strlcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @memccpy(i8* %7, i8* %8, i8 signext 0, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @_strlcpy(i8* %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @memccpy(i8* %0, i8* %1, i8 signext 0, i32 %2)
%5 = add nsw i32 %2, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret void
}