xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ get_grid_address(long *, long const *, long const *);
int /*<<< orphan*/ reduce_grid_address(long *, long const *);
void grg_get_grid_address(long address[3], const long address_double[3],
                          const long D_diag[3], const long PS[3]) {
  get_grid_address(address, address_double, PS);
  reduce_grid_address(address, D_diag);
}


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

x86 assembly (clang, -O2):
<grg_get_grid_address>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rcx,%rdx
call   1030 <get_grid_address@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <reduce_grid_address@plt>

LLVM IR (-O0):
define void @grg_get_grid_address(i64* %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i64*, i64** %5
%10 = load i64*, i64** %6
%11 = load i64*, i64** %8
%12 = call i32 @get_grid_address(i64* %9, i64* %10, i64* %11)
%13 = load i64*, i64** %5
%14 = load i64*, i64** %7
%15 = call i32 @reduce_grid_address(i64* %13, i64* %14)
ret void
}

LLVM IR (-O2):
define void @grg_get_grid_address(i64* %0, i64* %1, i64* %2, i64* %3) {
%5 = tail call i32 @get_grid_address(i64* %0, i64* %1, i64* %3)
%6 = tail call i32 @reduce_grid_address(i64* %0, i64* %2)
ret void
}
void eval_sizeof_bad() {
  if (sizeof(long long) < 10000) {
    int a[0];
    a[1];
  }
}


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

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

LLVM IR (-O0):
define void @eval_sizeof_bad() {
%1 = alloca [0 x i32]
%2 = getelementptr inbounds [0 x i32], [0 x i32]* %1, i64 0, i64 1
%3 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
define void @eval_sizeof_bad() {
ret void
}
int main(void) {
  double *dp = malloc(sizeof(double));
  float *fp = malloc(sizeof(float));
  *dp += 3.0;
  *fp += 30.0;
  free(dp);
  free(fp);
  *dp += 3.0;
  *fp += 30.0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xeb1(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movsd  0xe6b(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe47(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca float*
store i32 0, i32* %1
%4 = call i8* @malloc(i64 8)
%5 = bitcast i8* %4 to double*
store double* %5, double** %2
%6 = call i8* @malloc(i64 4)
%7 = bitcast i8* %6 to float*
store float* %7, float** %3
%8 = load double*, double** %2
%9 = load double, double* %8
%10 = fadd double %9, 3.000000e+00
store double %10, double* %8
%11 = load float*, float** %3
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = fadd double %13, 3.000000e+01
%15 = fptrunc double %14 to float
store float %15, float* %11
%16 = load double*, double** %2
%17 = bitcast double* %16 to i8*
%18 = load float*, float** %3
%19 = bitcast float* %18 to i8*
%20 = load double*, double** %2
%21 = load double, double* %20
%22 = fadd double %21, 3.000000e+00
store double %22, double* %20
%23 = load float*, float** %3
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = fadd double %25, 3.000000e+01
%27 = fptrunc double %26 to float
store float %27, float* %23
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *read_file_opt_dup(char *);
int /*<<< orphan*/ unlink(char *);
void fm_remove_pidfile() {
  char *file = read_file_opt_dup("pid-file");
  if (file != NULL)
    unlink(file);
  do {
    if ((file) != NULL) {
      free(file);
      (file) = NULL;
    }
  } while (0);
}


x86 assembly (clang, -O0):
<fm_remove_pidfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <read_file_opt_dup@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115c <fm_remove_pidfile+0x2c>
mov    -0x8(%rbp),%rdi
call   1040 <unlink@plt>
jmp    1161 <fm_remove_pidfile+0x31>
cmpq   $0x0,-0x8(%rbp)
je     117d <fm_remove_pidfile+0x4d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1182 <fm_remove_pidfile+0x52>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fm_remove_pidfile>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <read_file_opt_dup@plt>
test   %rax,%rax
je     1156 <fm_remove_pidfile+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <unlink@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"pid-file\00"
define void @fm_remove_pidfile() {
%1 = alloca i8*
%2 = call i8* @read_file_opt_dup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @unlink(i8* %6)
br label %8
8: ; preds = %5, %0
br label %9
9: ; preds = %8
%10 = load i8*, i8** %1
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i8*, i8** %1
%14 = call i32 @free(i8* %13)
store i8* null, i8** %1
br label %15
15: ; preds = %12, %9
br label %16
16: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"pid-file\00"
define void @fm_remove_pidfile() {
%1 = tail call i8* @read_file_opt_dup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @unlink(i8* %1)
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %0, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Flush_Buffer(int);
unsigned int Get_Bits1();
int extra_bit_information(void) {
  int Byte_Count;
  unsigned int tmp;
  {
    Byte_Count = 0;
    while (1) {
      tmp = Get_Bits1();
      if (!tmp) {
        break;
      }
      Flush_Buffer(8);
      Byte_Count++;
    }
    return (Byte_Count);
  }
}


x86 assembly (clang, -O0):
<extra_bit_information>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Get_Bits1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1148 <extra_bit_information+0x28>
jmp    1160 <extra_bit_information+0x40>
mov    $0x8,%edi
call   1040 <Flush_Buffer@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <extra_bit_information+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extra_bit_information>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <Get_Bits1@plt>
test   %eax,%eax
je     1148 <extra_bit_information+0x28>
xor    %ebx,%ebx
mov    $0x8,%edi
call   1040 <Flush_Buffer@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <Get_Bits1@plt>
test   %eax,%eax
jne    1130 <extra_bit_information+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @extra_bit_information() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %8
%4 = call i32 (...) @Get_Bits1()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %3
br label %12
8: ; preds = %3
%9 = call i32 @Flush_Buffer(i32 8)
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %3
12: ; preds = %7
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @extra_bit_information() {
%1 = tail call i32 (...) @Get_Bits1()
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 0, %0 ]
%5 = tail call i32 @Flush_Buffer(i32 8)
%6 = add nuw nsw i32 %4, 1
%7 = tail call i32 (...) @Get_Bits1()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %0
%10 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %10
}
int test_imm_B6uint32_mem(unsigned int *val) {
  return ((*val) & (0xB6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B6uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 182
%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_B6uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 182
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int mali_platform_deinit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mali_platform_deinit() {
ret i32 0
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", fib(40));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1040 <fib@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fib(i32 40)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fib(i32 40)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct vmpc_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int vmpc_clean(struct vmpc_ctx *ctx) {
  free((void *)ctx);
  return (0x00000000);
}


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

x86 assembly (clang, -O2):
<vmpc_clean>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.vmpc_ctx = type { i32 }
define i32 @vmpc_clean(%struct.vmpc_ctx* nocapture %0) {
%2 = bitcast %struct.vmpc_ctx* %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XUnmapEvent;

/* Variables and functions */
int get_XUnmapEvent_type(void *_p) { return (int)((XUnmapEvent *)_p)->type; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XUnmapEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XUnmapEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lpsc_control(unsigned int, int, int);
void clk_disable(unsigned int mod) { lpsc_control(mod, 0x2, -1); }


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

x86 assembly (clang, -O2):
<clk_disable>:
mov    $0x2,%esi
mov    $0xffffffff,%edx
jmp    1030 <lpsc_control@plt>

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

LLVM IR (-O2):
define void @clk_disable(i32 %0) {
%2 = tail call i32 @lpsc_control(i32 %0, i32 2, i32 -1)
ret void
}
void led(int id, char r, char g, char b) {}


x86 assembly (clang, -O0):
<led>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %edi,-0x4(%rbp)
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @led(i32 %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i32 %0, i32* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
ret void
}

LLVM IR (-O2):
define void @led(i32 %0, i8 signext %1, i8 signext %2, i8 signext %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_version() {
  printf("%s %s\n", "ifcounters", "0.1");
  printf("Copyright (c) 2018 by Babak Farrokhi <babak@farrokhi.net>\n");
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee5(%rip),%rsi
lea    0xee9(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xedc(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [11 x i8] c"ifcounters\00"
@.str.2 = [4 x i8] c"0.1\00"
@.str.3 = [59 x i8] c"Copyright (c) 2018 by Babak Farrokhi <babak@farrokhi.net>\0A\00"
define void @show_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [11 x i8] c"ifcounters\00"
@.str.2 = [4 x i8] c"0.1\00"
@str = [58 x i8] c"Copyright (c) 2018 by Babak Farrokhi <babak@farrokhi.net>\00"
define void @show_version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Direct(int);
int /*<<< orphan*/ STZ8(int /*<<< orphan*/);
void Op64M1(void) { STZ8(Direct(2)); }


x86 assembly (clang, -O0):
<Op64M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <Direct@plt>
mov    %eax,%edi
call   1030 <STZ8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op64M1>:
push   %rax
mov    $0x2,%edi
call   1040 <Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <STZ8@plt>

LLVM IR (-O0):
define void @Op64M1() {
%1 = call i32 @Direct(i32 2)
%2 = call i32 @STZ8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op64M1() {
%1 = tail call i32 @Direct(i32 2)
%2 = tail call i32 @STZ8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int /*<<< orphan*/);
void ft_putstr(char const *s) {
  if (!(s))
    return;
  while (*s)
    ft_putchar(*s++);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ft_putstr+0x1c>
jmp    115a <ft_putstr+0x4a>
jmp    1131 <ft_putstr+0x21>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <ft_putstr+0x4a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <ft_putchar@plt>
jmp    1131 <ft_putstr+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
test   %rdi,%rdi
je     1143 <ft_putstr+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <ft_putstr+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_putstr(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 %6, label %5
5: ; preds = %1
br label %17
6: ; preds = %1
br label %7
7: ; preds = %11, %6
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = call i32 @ft_putchar(i32 %15)
br label %7
17: ; preds = %5, %7
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = sext i8 %7 to i32
%11 = tail call i32 @ft_putchar(i32 %10)
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int rand();
void initialize(int *a, int n) {
  int i;
  for (i = 0; i < n; i++) {
    a[i] = rand() % 1000;
  }
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <initialize+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <initialize+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1162 <initialize+0x52>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <initialize+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @initialize(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 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 1000
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @initialize(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 1000
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void s2e_codext_init(unsigned base, unsigned size, unsigned eip,
                     unsigned sysc) {
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0xFA, 0x01, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n"
                       :
                       : "a"(base), "b"(size), "c"(eip), "d"(sysc));
}


x86 assembly (clang, -O0):
<s2e_codext_init>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
(bad)
add    %bh,%dl
add    %eax,(%rax)
add    %al,(%rax)
add    %al,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_codext_init>:
push   %rbx
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%ebx
mov    %edi,%eax
mov    %r8d,%edx
(bad)
add    %bh,%dl
add    %eax,(%rax)
add    %al,(%rax)
add    %al,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @s2e_codext_init(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
define void @s2e_codext_init(i32 %0, i32 %1, i32 %2, i32 %3) {
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0xFA, 0x01, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
unsigned char f_uchar(void) { return 128; }


x86 assembly (clang, -O0):
<f_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_uchar>:
mov    $0x80,%al
ret

LLVM IR (-O0):
define zeroext i8 @f_uchar() {
ret i8 -128
}

LLVM IR (-O2):
define zeroext i8 @f_uchar() {
ret i8 -128
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  write(2, "and that piece of art is useful\" - Dora Korpar, 2015-10-19\n", 59);
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
lea    0xed5(%rip),%rsi
mov    $0x3b,%edx
call   1030 <write@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x2,%edi
mov    $0x3b,%edx
call   1030 <write@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"and that piece of art is useful\22 - Dora Korpar, 2015-10-19\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 2, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 59)
ret i32 1
}

LLVM IR (-O2):
@.str = [60 x i8] c"and that piece of art is useful\22 - Dora Korpar, 2015-10-19\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 59)
ret i32 1
}
/* Variables and functions */
scalar_t__ is_leap_year(int);
int days_in_month(int month, int year) {
  static int month_days[] = {
      31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
  };
  if (month == 1)
    return is_leap_year(year) ? 29 : 28;
  return month_days[month];
}


x86 assembly (clang, -O0):
<days_in_month>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114c <days_in_month+0x3c>
mov    -0xc(%rbp),%edi
call   1030 <is_leap_year@plt>
mov    %rax,%rdx
mov    $0x1c,%eax
mov    $0x1d,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <days_in_month+0x4d>
movslq -0x8(%rbp),%rcx
lea    0x2ed9(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<days_in_month>:
push   %rax
cmp    $0x1,%edi
jne    112b <days_in_month+0x1b>
mov    %esi,%edi
call   1030 <is_leap_year@plt>
cmp    $0x1,%rax
mov    $0x1d,%eax
sbb    $0x0,%eax
pop    %rcx
ret
movslq %edi,%rax
lea    0xecb(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
@days_in_month.month_days = internal global [12 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @days_in_month(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i64 @is_leap_year(i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 29, i32 28
store i32 %13, i32* %3
br label %19
14: ; preds = %2
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [12 x i32], [12 x i32]* @days_in_month.month_days, i64 0, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %3
br label %19
19: ; preds = %14, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@days_in_month.month_days = internal unnamed_addr constant [12 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @days_in_month(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i64 @is_leap_year(i32 %1)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 28, i32 29
br label %12
8: ; preds = %2
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds [12 x i32], [12 x i32]* @days_in_month.month_days, i64 0, i64 %9
%11 = load i32, i32* %10
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ %7, %4 ], [ %11, %8 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int parse_reply(const size_t buflen, char *buf, uint64_t *timestamp) {
  return 1;
}


x86 assembly (clang, -O0):
<parse_reply>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @parse_reply(i64 %0, i8* %1, i32* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
ret i32 1
}

LLVM IR (-O2):
define i32 @parse_reply(i64 %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 1
}
int begin_cmd_p(int c) { return c == '('; }


x86 assembly (clang, -O0):
<begin_cmd_p>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x28,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin_cmd_p>:
xor    %eax,%eax
cmp    $0x28,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @begin_cmd_p(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 40
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @begin_cmd_p(i32 %0) {
%2 = icmp eq i32 %0, 40
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct iface {
  int dummy;
};

/* Variables and functions */
struct iface *iface_find_by_name(char const *);
int iface_get_vif(struct iface *);
int iface_get_vif_by_name(const char *ifname) {
  int vif;
  struct iface *iface;
  iface = iface_find_by_name(ifname);
  if (!iface)
    return -1;
  vif = iface_get_vif(iface);
  if (vif < 0)
    return -1;
  return vif;
}


x86 assembly (clang, -O0):
<iface_get_vif_by_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <iface_find_by_name@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1150 <iface_get_vif_by_name+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <iface_get_vif_by_name+0x58>
mov    -0x20(%rbp),%rdi
call   1040 <iface_get_vif@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1172 <iface_get_vif_by_name+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <iface_get_vif_by_name+0x58>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iface_get_vif_by_name>:
push   %rax
call   1030 <iface_find_by_name@plt>
test   %rax,%rax
je     1141 <iface_get_vif_by_name+0x21>
mov    %rax,%rdi
call   1040 <iface_get_vif@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.iface = type { i32 }
define i32 @iface_get_vif_by_name(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.iface*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call %struct.iface* @iface_find_by_name(i8* %6)
store %struct.iface* %7, %struct.iface** %5
%8 = load %struct.iface*, %struct.iface** %5
%9 = icmp ne %struct.iface* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i32 -1, i32* %2
br label %19
11: ; preds = %1
%12 = load %struct.iface*, %struct.iface** %5
%13 = call i32 @iface_get_vif(%struct.iface* %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 -1, i32* %2
br label %19
17: ; preds = %11
%18 = load i32, i32* %4
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %16, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.iface = type { i32 }
define i32 @iface_get_vif_by_name(i8* %0) {
%2 = tail call %struct.iface* @iface_find_by_name(i8* %0)
%3 = icmp eq %struct.iface* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @iface_get_vif(%struct.iface* %2)
%6 = icmp sgt i32 %5, -1
%7 = select i1 %6, i32 %5, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, char *, unsigned int);
unsigned int strlen(char *);
int generate_cookie(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len) {
  *cookie_len = strlen("ABCDEFGHIJKLMNOP");
  memcpy(cookie, "ABCDEFGHIJKLMNOP", *cookie_len);
  return 1;
}


x86 assembly (clang, -O0):
<generate_cookie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xea7(%rip),%rsi
call   1040 <memcpy@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_cookie>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
lea    0xece(%rip),%r15
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %eax,(%rbx)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"ABCDEFGHIJKLMNOP\00"
define i32 @generate_cookie(i32* %0, i8* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = call i32 @strlen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %6
store i32 %7, i32* %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 @memcpy(i8* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"ABCDEFGHIJKLMNOP\00"
define i32 @generate_cookie(i32* nocapture readnone %0, i8* %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %2
%5 = tail call i32 @memcpy(i8* %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}
/* Type definitions */
struct RNAdistance_args_info {
  int dummy;
};

/* Variables and functions */
int RNAdistance_cmdline_parser2(int, char **, struct RNAdistance_args_info *,
                                int /*<<< orphan*/, int, int);
int RNAdistance_cmdline_parser(int argc, char **argv,
                               struct RNAdistance_args_info *args_info) {
  return RNAdistance_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<RNAdistance_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <RNAdistance_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAdistance_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <RNAdistance_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.RNAdistance_args_info = type { i32 }
define i32 @RNAdistance_cmdline_parser(i32 %0, i8** %1, %struct.RNAdistance_args_info* %2) {
%4 = tail call i32 @RNAdistance_cmdline_parser2(i32 %0, i8** %1, %struct.RNAdistance_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ yuv420_argb32(int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ const *,
                                 int /*<<< orphan*/ const *,
                                 int /*<<< orphan*/ const *, int, int, int, int,
                                 int, int);
void mmx_argb32(uint8_t *image, const uint8_t *py, const uint8_t *pu,
                const uint8_t *pv, int width, int height, int rgb_stride,
                int y_stride, int uv_stride) {
  yuv420_argb32(image, py, pu, pv, width, height, rgb_stride, y_stride,
                uv_stride, 1);
}


x86 assembly (clang, -O0):
<mmx_argb32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
movl   $0x1,0x18(%rsp)
call   1030 <yuv420_argb32@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmx_argb32>:
push   %rax
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%r11d
mov    0x20(%rsp),%eax
push   $0x1
push   %rax
push   %r11
push   %r10
call   1030 <yuv420_argb32@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @mmx_argb32(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%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
store i32* %0, i32** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i32* %3, i32** %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32*, i32** %10
%20 = load i32*, i32** %11
%21 = load i32*, i32** %12
%22 = load i32*, i32** %13
%23 = load i32, i32* %14
%24 = load i32, i32* %15
%25 = load i32, i32* %16
%26 = load i32, i32* %17
%27 = load i32, i32* %18
%28 = call i32 @yuv420_argb32(i32* %19, i32* %20, i32* %21, i32* %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 1)
ret void
}

LLVM IR (-O2):
define void @mmx_argb32(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = tail call i32 @yuv420_argb32(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int strlen(char *);
int main() {
  char *str = "this is a test\n";
  int len = strlen(str);
  if (len != 15) {
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
je     1150 <main+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <strlen@plt>
cmp    $0xf,%eax
jne    1136 <main+0x16>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"this is a test\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strlen(i8* %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 15
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"this is a test\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 15
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Function() { printf("Call Function!\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Call Function!\00"
define void @Function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void debugChar(int ch) { putchar(ch); }


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

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

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

LLVM IR (-O2):
define void @debugChar(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret void
}
float limitf(float a) { return a < -1 ? -1 : (a > 1 ? 1 : a); }


x86 assembly (clang, -O0):
<limitf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <limitf+0x2d>
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1169 <limitf+0x69>
movss  -0x4(%rbp),%xmm0
movss  0xeca(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1155 <limitf+0x55>
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    115f <limitf+0x5f>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<limitf>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
movss  0xef0(%rip),%xmm2
cmpltss %xmm2,%xmm0
movaps %xmm0,%xmm3
andnps %xmm1,%xmm3
andps  %xmm2,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @limitf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, -1.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load float, float* %2
%8 = fcmp ogt float %7, 1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load float, float* %2
br label %12
12: ; preds = %10, %9
%13 = phi float [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi float [ -1.000000e+00, %5 ], [ %13, %12 ]
ret float %15
}

LLVM IR (-O2):
define float @limitf(float %0) {
%2 = fcmp olt float %0, -1.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float -1.000000e+00, float %4
ret float %5
}
/* Variables and functions */
void *_test_malloc(size_t const, char const *, int const);
int /*<<< orphan*/ memset(void *const, int /*<<< orphan*/, size_t const);
void *_test_calloc(const size_t number_of_elements, const size_t size,
                   const char *file, const int line) {
  void *const ptr = _test_malloc(number_of_elements * size, file, line);
  if (ptr) {
    memset(ptr, 0, number_of_elements * size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<_test_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <_test_malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     116f <_test_calloc+0x4f>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1040 <_test_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     114d <_test_calloc+0x2d>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_test_calloc(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = mul i64 %1, %0
%6 = tail call i8* @_test_malloc(i64 %5, i8* %2, i32 %3)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @memset(i8* %6, i32 0, i64 %5)
br label %10
10: ; preds = %8, %4
ret i8* %6
}
int gcspy_driverControlIsBackground(char val) { return (val & 2) != 0; }


x86 assembly (clang, -O0):
<gcspy_driverControlIsBackground>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcspy_driverControlIsBackground>:
shr    %dil
and    $0x1,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @gcspy_driverControlIsBackground(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, 2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @gcspy_driverControlIsBackground(i8 signext %0) {
%2 = lshr i8 %0, 1
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int php_tvtoto(struct timeval *timeouttv) {
  if (timeouttv) {
    return (timeouttv->tv_sec * 1000) + (timeouttv->tv_usec / 1000);
  }
  return -1;
}


x86 assembly (clang, -O0):
<php_tvtoto>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113e <php_tvtoto+0x3e>
mov    -0x10(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <php_tvtoto+0x45>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<php_tvtoto>:
test   %rdi,%rdi
je     1126 <php_tvtoto+0x26>
imul   $0x3e8,(%rdi),%ecx
movslq 0x4(%rdi),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @php_tvtoto(%struct.timeval* %0) {
%2 = alloca i32
%3 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
%4 = load %struct.timeval*, %struct.timeval** %3
%5 = icmp ne %struct.timeval* %4, null
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = load %struct.timeval*, %struct.timeval** %3
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = sdiv i32 %13, 1000
%15 = add nsw i32 %10, %14
store i32 %15, i32* %2
br label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @php_tvtoto(%struct.timeval* %0) {
%2 = icmp eq %struct.timeval* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
br label %11
11: ; preds = %1, %3
%12 = phi i32 [ %10, %3 ], [ -1, %1 ]
ret i32 %12
}