xunge/DecIR huggingface dataset:
int rgb_to_luminance(int r, int g, int b) {
  return (((r * 54 + g * 182 + b * 20) + 128) >> 8);
}


x86 assembly (clang, -O0):
<rgb_to_luminance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x36,-0x4(%rbp),%eax
imul   $0xb6,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0x14,-0xc(%rbp),%ecx
add    %ecx,%eax
add    $0x80,%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_luminance>:
imul   $0x36,%edi,%eax
imul   $0xb6,%esi,%ecx
add    %eax,%ecx
lea    (%rdx,%rdx,4),%eax
lea    (%rcx,%rax,4),%eax
add    $0x80,%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @rgb_to_luminance(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 54
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 182
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 20
%14 = add nsw i32 %11, %13
%15 = add nsw i32 %14, 128
%16 = ashr i32 %15, 8
ret i32 %16
}

LLVM IR (-O2):
define i32 @rgb_to_luminance(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 54
%5 = mul nsw i32 %1, 182
%6 = mul nsw i32 %2, 20
%7 = add i32 %4, 128
%8 = add i32 %7, %5
%9 = add i32 %8, %6
%10 = ashr i32 %9, 8
ret i32 %10
}
int (*matrix2())[2] {
  static int arr[][2] = {{11, 12}, {21, 22}, {31, 32}, {41, 42}, {51, 52}};
  return arr;
}


x86 assembly (clang, -O0):
<matrix2>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix2>:
lea    0x2f29(%rip),%rax
ret

LLVM IR (-O0):
@matrix2.arr = internal global [5 x [2 x i32]] [[2 x i32] [i32 11, i32 12], [2 x i32] [i32 21, i32 22], [2 x i32] [i32 31, i32 32], [2 x i32] [i32 41, i32 42], [2 x i32] [i32 51, i32 52]]
define [2 x i32]* @matrix2() {
ret [2 x i32]* getelementptr inbounds ([5 x [2 x i32]], [5 x [2 x i32]]* @matrix2.arr, i64 0, i64 0)
}

LLVM IR (-O2):
@matrix2.arr = internal global [5 x [2 x i32]] [[2 x i32] [i32 11, i32 12], [2 x i32] [i32 21, i32 22], [2 x i32] [i32 31, i32 32], [2 x i32] [i32 41, i32 42], [2 x i32] [i32 51, i32 52]]
define [2 x i32]* @matrix2() {
ret [2 x i32]* getelementptr inbounds ([5 x [2 x i32]], [5 x [2 x i32]]* @matrix2.arr, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ write_word_data(int /*<<< orphan*/, int, int /*<<< orphan*/);
void set_bus_direction(uint8_t address, uint16_t direction) {
  write_word_data(address, 0x00, direction);
}


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

x86 assembly (clang, -O2):
<set_bus_direction>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <write_word_data@plt>

LLVM IR (-O0):
define void @set_bus_direction(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 @write_word_data(i32 %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @set_bus_direction(i32 %0, i32 %1) {
%3 = tail call i32 @write_word_data(i32 %0, i32 0, i32 %1)
ret void
}
OP(ed, cf) {}


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

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

LLVM IR (-O0):
define i32 @OP(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
int sd_bytes_number(struct item_head *ih, int block_size) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.item_head = type opaque
define i32 @sd_bytes_number(%struct.item_head* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *create_list(struct node *node) {
  struct node *list = NULL;
  if (NULL == node) {
    return NULL;
  }
  list = node;
  return list;
}


x86 assembly (clang, -O0):
<create_list>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1129 <create_list+0x29>
movq   $0x0,-0x8(%rbp)
jmp    1139 <create_list+0x39>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @create_list(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca %struct.node*
%4 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
store %struct.node* null, %struct.node** %4
%5 = load %struct.node*, %struct.node** %3
%6 = icmp eq %struct.node* null, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store %struct.node* null, %struct.node** %2
br label %11
8: ; preds = %1
%9 = load %struct.node*, %struct.node** %3
store %struct.node* %9, %struct.node** %4
%10 = load %struct.node*, %struct.node** %4
store %struct.node* %10, %struct.node** %2
br label %11
11: ; preds = %8, %7
%12 = load %struct.node*, %struct.node** %2
ret %struct.node* %12
}

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @create_list(%struct.node* readnone %0) {
ret %struct.node* %0
}
void foo_1_1_1_1_2_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_2_2_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g5_set_xmjMC(int /*<<< orphan*/, int, int, double **,
                                double *);
void g5_set_xmj(int adr, int nj, double (*xj)[3], double *mj) {
  g5_set_xmjMC(0, adr, nj, xj, mj);
}


x86 assembly (clang, -O0):
<g5_set_xmj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %edi,%edi
call   1030 <g5_set_xmjMC@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g5_set_xmj>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <g5_set_xmjMC@plt>

LLVM IR (-O0):
define void @g5_set_xmj(i32 %0, i32 %1, [3 x double]* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca [3 x double]*
%8 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store [3 x double]* %2, [3 x double]** %7
store double* %3, double** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load [3 x double]*, [3 x double]** %7
%12 = bitcast [3 x double]* %11 to double**
%13 = load double*, double** %8
%14 = call i32 @g5_set_xmjMC(i32 0, i32 %9, i32 %10, double** %12, double* %13)
ret void
}

LLVM IR (-O2):
define void @g5_set_xmj(i32 %0, i32 %1, [3 x double]* %2, double* %3) {
%5 = bitcast [3 x double]* %2 to double**
%6 = tail call i32 @g5_set_xmjMC(i32 0, i32 %0, i32 %1, double** %5, double* %3)
ret void
}
int config_HAVE_DVBAPI(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @config_HAVE_DVBAPI() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeArrayBoxMap(double ***t, int nrl, int nrh, int ncl, int nch, int ndl,
                     int ndh) {
  free((char *)(t[nrl] + ncl));
  free((char *)(t + nrl));
}


x86 assembly (clang, -O0):
<FreeArrayBoxMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeArrayBoxMap>:
push   %rbx
movslq %esi,%rdx
lea    (%rdi,%rdx,8),%rbx
movslq %ecx,%rax
shl    $0x3,%rax
add    (%rdi,%rdx,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeArrayBoxMap(double*** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds double**, double*** %0, i64 %8
%10 = load double**, double*** %9
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds double*, double** %10, i64 %11
%13 = bitcast double** %12 to i8*
%14 = tail call i32 @free(i8* %13)
%15 = bitcast double*** %9 to i8*
%16 = tail call i32 @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print(char *someString) { puts(someString); }


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

x86 assembly (clang, -O2):
<print>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
int MUSIC_FadeActive(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MUSIC_FadeActive() {
ret i32 0
}
/* Variables and functions */
int psync_sql_statement(char *);
int /*<<< orphan*/ psync_sql_unlock();
int psync_sql_rollback_transaction() {
  int code = psync_sql_statement("ROLLBACK");
  psync_sql_unlock();
  return code;
}


x86 assembly (clang, -O0):
<psync_sql_rollback_transaction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <psync_sql_statement@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <psync_sql_unlock@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psync_sql_rollback_transaction>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <psync_sql_statement@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <psync_sql_unlock@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"ROLLBACK\00"
define i32 @psync_sql_rollback_transaction() {
%1 = alloca i32
%2 = call i32 @psync_sql_statement(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = call i32 (...) @psync_sql_unlock()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"ROLLBACK\00"
define i32 @psync_sql_rollback_transaction() {
%1 = tail call i32 @psync_sql_statement(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @psync_sql_unlock()
ret i32 %1
}
long long int numeric_hex_to_dec(char value[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @numeric_hex_to_dec(i8* nocapture readnone %0) {
ret i64 0
}
/* Type definitions */
struct UAE_CONFIG {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ calltrap(int, struct UAE_CONFIG *);
int SetUaeConfig(struct UAE_CONFIG *a) { calltrap(2, a); }


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

x86 assembly (clang, -O2):
<SetUaeConfig>:
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <calltrap@plt>

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

LLVM IR (-O2):
%struct.UAE_CONFIG = type { i32 }
define i32 @SetUaeConfig(%struct.UAE_CONFIG* %0) {
%2 = tail call i32 @calltrap(i32 2, %struct.UAE_CONFIG* %0)
ret i32 undef
}
void difference_3fo(const float *x, const float *y, float *result) {
  result[0] = x[0] - y[0];
  result[1] = x[1] - y[1];
  result[2] = x[2] - y[2];
}


x86 assembly (clang, -O0):
<difference_3fo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<difference_3fo>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
subss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

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

LLVM IR (-O2):
define void @difference_3fo(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fsub float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main(void) {
  setuid(0);
  system("/bin/bash --rcfile /root/.bashrc -i");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"/bin/bash --rcfile /root/.bashrc -i\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"/bin/bash --rcfile /root/.bashrc -i\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *malloc(int);
char *tostring(char ch) {
  char *buffer = malloc(sizeof(char) * 2);
  assert(buffer);
  buffer[0] = ch;
  buffer[1] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<tostring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tostring>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %bpl,(%rbx)
movb   $0x0,0x1(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @tostring(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = call i8* @malloc(i32 2)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8, i8* %2
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 0, i8* %11
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @tostring(i8 signext %0) {
%2 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%3 = tail call i32 @assert(i8* %2)
store i8 %0, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %4
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int root_depth;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void set_Screen_root_depth(void *_p, int _v) {
  ((Screen *)_p)->root_depth = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_Screen_root_depth(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int get_soft_tv(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_soft_tv() {
ret i32 0
}
/* Variables and functions */
void ILibCreateStack(void **TheStack) { *TheStack = NULL; }


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

x86 assembly (clang, -O2):
<ILibCreateStack>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @ILibCreateStack(i8** nocapture writeonly %0) {
store i8* null, i8** %0
ret void
}
void CRYPTO_malloc_locked(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_malloc_locked() {
ret void
}
trim(s) char *s;
{
  int i = 0;
  while ((s[i] == ' ') || (s[i] == '\t'))
    i++;
  strcpy(s, s + i);
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x15(%rbp)
je     1152 <trim+0x42>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1162 <trim+0x52>
jmp    1170 <trim+0x60>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <trim+0x13>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
xor    %eax,%eax
jmp    1124 <trim+0x14>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rax
movzbl (%rdi,%rax,1),%ecx
cmp    $0x20,%cl
je     1120 <trim+0x10>
cmp    $0x9,%cl
je     1120 <trim+0x10>
mov    %eax,%esi
add    %rdi,%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i32 @trim(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %21, label %13
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 9
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ true, %5 ], [ %20, %13 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %21
%27 = load i8*, i8** %3
%28 = load i8*, i8** %3
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = call i8* @strcpy(i8* %27, i8* %31)
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @trim(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %2, %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* %10)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ dump_stack_data();
int main(int argc, char *argv[]) {
  dump_stack_data();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @dump_stack_data()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @dump_stack_data()
ret i32 0
}
/* Variables and functions */
void main(void) {
  while (true) {
  }
}


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

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

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
scalar_t__ strlen(char *);
char *join_path(char *dest_dir, char *filename) {
  char *path = malloc(strlen(dest_dir) + strlen(filename) + 2);
  sprintf(path, "%s%s%s", dest_dir, "/", filename);
  return path;
}


x86 assembly (clang, -O0):
<join_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xe83(%rip),%rsi
lea    0xe83(%rip),%rcx
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_path>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9e(%rip),%rsi
lea    0xe9e(%rip),%rcx
mov    %rax,%rdi
mov    %r15,%rdx
mov    %r14,%r8
call   1050 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s%s%s\00"
@.str.1 = [2 x i8] c"/\00"
define i8* @join_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 2
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
@.str.1 = [2 x i8] c"/\00"
define noalias i8* @join_path(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 2
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %7, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i8* %7
}
void gtk_window_get_transient_for() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_transient_for() {
ret void
}
int lib_func01() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @lib_func01() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ numbers(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("Enter the number upto which you want to print the numbers from 1:\n");
  scanf("%d", &x);
  numbers(x);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [67 x i8] c"Enter the number upto which you want to print the numbers from 1:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 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* %2)
%5 = load i32, i32* %2
%6 = call i32 @numbers(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [66 x i8] c"Enter the number upto which you want to print the numbers from 1:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 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 @numbers(i32 %5)
ret i32 0
}
/* Variables and functions */
int f473(int *);
int f474(int *p) { return f473(p); }


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

x86 assembly (clang, -O2):
<f474>:
jmp    1030 <f473@plt>

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

LLVM IR (-O2):
define i32 @f474(i32* %0) {
%2 = tail call i32 @f473(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA(int, int);
void GyOutSignalCont(void) { RegWriteA(0x0280, 0x04); }


x86 assembly (clang, -O0):
<GyOutSignalCont>:
push   %rbp
mov    %rsp,%rbp
mov    $0x280,%edi
mov    $0x4,%esi
call   1030 <RegWriteA@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyOutSignalCont>:
mov    $0x280,%edi
mov    $0x4,%esi
jmp    1030 <RegWriteA@plt>

LLVM IR (-O0):
define void @GyOutSignalCont() {
%1 = call i32 @RegWriteA(i32 640, i32 4)
ret void
}

LLVM IR (-O2):
define void @GyOutSignalCont() {
%1 = tail call i32 @RegWriteA(i32 640, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void checkOddOrEven() {
  int input;
  printf("Enter Number\n\n>>");
  scanf("%d", &input);
  if (input % 2 == 0) {
    printf("This is even\n\n");
  } else {
    printf("This is odd\n\n");
  }
}


x86 assembly (clang, -O0):
<checkOddOrEven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1169 <checkOddOrEven+0x49>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    1175 <checkOddOrEven+0x55>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkOddOrEven>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xec7(%rip),%rax
lea    0xeb3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter Number\0A\0A>>\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"This is even\0A\0A\00"
@.str.3 = [14 x i8] c"This is odd\0A\0A\00"
define void @checkOddOrEven() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 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 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter Number\0A\0A>>\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [13 x i8] c"This is odd\0A\00"
@str.4 = [14 x i8] c"This is even\0A\00"
define void @checkOddOrEven() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void InternalFreeMem(void *aptr) { free(aptr); }


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

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

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

LLVM IR (-O2):
define void @InternalFreeMem(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_8Cint16_mem(short *val) {
  return ((*val) & (-0x8C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Cint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -140
%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_8Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -140
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ cleanup_R1();
scalar_t__ scale8_LEAVING_R1_DIRTY(scalar_t__, scalar_t__);
uint8_t blend8(uint8_t a, uint8_t b, uint8_t amountOfB) {
  uint8_t result;
  uint8_t amountOfA = 255 - amountOfB;
  result = scale8_LEAVING_R1_DIRTY(a, amountOfA) +
           scale8_LEAVING_R1_DIRTY(b, amountOfB);
  cleanup_R1();
  return result;
}


x86 assembly (clang, -O0):
<blend8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xff,%eax
sub    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <scale8_LEAVING_R1_DIRTY@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <scale8_LEAVING_R1_DIRTY@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <cleanup_R1@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend8>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    $0xff,%esi
sub    %rdx,%rsi
call   1040 <scale8_LEAVING_R1_DIRTY@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scale8_LEAVING_R1_DIRTY@plt>
mov    %rax,%rbx
add    %r15,%rbx
xor    %eax,%eax
call   1030 <cleanup_R1@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @blend8(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = sub nsw i64 255, %9
store i64 %10, i64* %8
%11 = load i64, i64* %4
%12 = load i64, i64* %8
%13 = call i64 @scale8_LEAVING_R1_DIRTY(i64 %11, i64 %12)
%14 = load i64, i64* %5
%15 = load i64, i64* %6
%16 = call i64 @scale8_LEAVING_R1_DIRTY(i64 %14, i64 %15)
%17 = add nsw i64 %13, %16
store i64 %17, i64* %7
%18 = call i32 (...) @cleanup_R1()
%19 = load i64, i64* %7
ret i64 %19
}

LLVM IR (-O2):
define i64 @blend8(i64 %0, i64 %1, i64 %2) {
%4 = sub nsw i64 255, %2
%5 = tail call i64 @scale8_LEAVING_R1_DIRTY(i64 %0, i64 %4)
%6 = tail call i64 @scale8_LEAVING_R1_DIRTY(i64 %1, i64 %2)
%7 = add nsw i64 %6, %5
%8 = tail call i32 (...) @cleanup_R1()
ret i64 %7
}
float radians(float x) { return x * (3.1415926535897932 / 180.0); }


x86 assembly (clang, -O0):
<radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radians>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3F91DF46A2529D39
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @radians(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3F91DF46A2529D39
%4 = fptrunc double %3 to float
ret float %4
}
void trocar_elementos(int i, int j, int *v) {
  int t = v[i];
  v[i] = v[j];
  v[j] = t;
}


x86 assembly (clang, -O0):
<trocar_elementos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<trocar_elementos>:
movslq %edi,%rax
mov    (%rdx,%rax,4),%ecx
movslq %esi,%rsi
mov    (%rdx,%rsi,4),%edi
mov    %edi,(%rdx,%rax,4)
mov    %ecx,(%rdx,%rsi,4)
ret

LLVM IR (-O0):
define void @trocar_elementos(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** %6
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %6
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %6
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @trocar_elementos(i32 %0, i32 %1, i32* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %2, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
void free(void *ptr) {
  if (ptr)
    ((char *)ptr)[-sizeof(size_t)] &= ~(sizeof(size_t) - 1);
}


x86 assembly (clang, -O0):
<free>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <free+0x23>
mov    -0x8(%rbp),%rax
movsbq -0x8(%rax),%rcx
and    $0xfffffffffffffff8,%rcx
mov    %cl,-0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<free>:
test   %rdi,%rdi
je     1109 <free+0x9>
andb   $0xf8,-0x8(%rdi)
ret

LLVM IR (-O0):
define void @free(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 %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 -8
%8 = load i8, i8* %7
%9 = sext i8 %8 to i64
%10 = and i64 %9, -8
%11 = trunc i64 %10 to i8
store i8 %11, i8* %7
br label %12
12: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = load i8, i8* %4
%6 = and i8 %5, -8
store i8 %6, i8* %4
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world\n");
  printf("I am in itws lab\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
@.str.1 = [18 x i8] c"I am in itws lab\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
@str.2 = [17 x i8] c"I am in itws lab\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t el_aes256_decrypt_output_len(size_t enc_data_len) {
  return enc_data_len;
}


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

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

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

LLVM IR (-O2):
define i64 @el_aes256_decrypt_output_len(i64 returned %0) {
ret i64 %0
}
indreg0imm1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x21,(%rax)
ja     1131 <indreg0imm1+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <indreg0imm1+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0imm1>:
xor    %eax,%eax
cmpl   $0x22,(%r8)
setb   %al
ret

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

LLVM IR (-O2):
define i32 @indreg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = icmp ult i32 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int days(int, int);
int hours(time_t t1, time_t t2) {
  return (t2 - t1 - (days(t1, t2) * 86400)) / 3600;
}


x86 assembly (clang, -O0):
<hours>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <days@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0x15180,%ecx,%ecx
sub    %ecx,%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hours>:
push   %rbx
mov    %esi,%ebx
sub    %edi,%ebx
call   1030 <days@plt>
imul   $0xfffeae80,%eax,%eax
add    %ebx,%eax
cltq
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xb,%eax
add    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hours(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @days(i32 %8, i32 %9)
%11 = mul nsw i32 %10, 86400
%12 = sub nsw i32 %7, %11
%13 = sdiv i32 %12, 3600
ret i32 %13
}

LLVM IR (-O2):
define i32 @hours(i32 %0, i32 %1) {
%3 = sub i32 %1, %0
%4 = tail call i32 @days(i32 %0, i32 %1)
%5 = mul i32 %4, -86400
%6 = add i32 %3, %5
%7 = sdiv i32 %6, 3600
ret i32 %7
}