xunge/DecIR huggingface dataset:
/* Variables and functions */
int sqrt(int);
int is_mersenne(int number) {
  int i = 0;
  for (i = 1; i <= sqrt(number); i++) {
    if (0 == number % i)
      return 1;
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<is_mersenne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1168 <is_mersenne+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    1161 <is_mersenne+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1168 <is_mersenne+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_mersenne>:
push   %rax
call   1030 <sqrt@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_mersenne(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = call i32 @sqrt(i32 %7)
%9 = icmp sle i32 %6, %8
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = icmp eq i32 0, %13
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %2
br label %20
16: ; preds = %10
store i32 0, i32* %2
br label %20
17: ; No predecessors!
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %15, %16, %5
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_mersenne(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
ret i32 1
}
void RAND_egd(void) {}


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

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

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

LLVM IR (-O2):
define void @RAND_egd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void custom_iowrite(char ch) {
  putchar(ch);
  return;
}


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

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

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

LLVM IR (-O2):
define void @custom_iowrite(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int assign_quaddobl_coefficient_of_slice(int i, int j, double *r) {
  int fail;
  fail = _ada_use_c2phc4c(663, &i, &j, r, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @assign_quaddobl_coefficient_of_slice(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc4c(i32 663, i32* %4, i32* %5, double* %2, i32 0)
ret i32 %6
}
/* Variables and functions */
scalar_t__ param_get(char *, char *, char *, char **);
int param_exist(char *key1, char *key2, char *key3) {
  char val[1003];
  if (param_get(key1, key2, key3, &val) < 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<param_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x410(%rbp),%rcx
call   1030 <param_get@plt>
cmp    $0x0,%rax
jge    1155 <param_exist+0x45>
movl   $0x0,-0x4(%rbp)
jmp    115c <param_exist+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_exist>:
sub    $0x3f8,%rsp
mov    %rsp,%rcx
call   1030 <param_get@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
add    $0x3f8,%rsp
ret

LLVM IR (-O0):
define i32 @param_exist(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [1003 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = bitcast [1003 x i8]* %8 to i8**
%13 = call i64 @param_get(i8* %9, i8* %10, i8* %11, i8** %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 0, i32* %4
br label %17
16: ; preds = %3
store i32 1, i32* %4
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @param_exist(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1003 x i8]
%5 = getelementptr inbounds [1003 x i8], [1003 x i8]* %4, i64 0, i64 0
%6 = bitcast [1003 x i8]* %4 to i8**
%7 = call i64 @param_get(i8* %0, i8* %1, i8* %2, i8** %6)
%8 = lshr i64 %7, 63
%9 = trunc i64 %8 to i32
%10 = xor i32 %9, 1
ret i32 %10
}
/* Type definitions */
struct cpuusage_jiffies_stat {
  int dummy;
};

/* Variables and functions */
struct cpuusage_jiffies_stat *proc_get_jiffies_stat_list();
struct cpuusage_jiffies_stat *cpuusage_get_jiffies_stat_list() {
  struct cpuusage_jiffies_stat *jiffies_stat_list = NULL;
  jiffies_stat_list = proc_get_jiffies_stat_list();
  return jiffies_stat_list;
}


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

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

LLVM IR (-O0):
%struct.cpuusage_jiffies_stat = type { i32 }
define %struct.cpuusage_jiffies_stat* @cpuusage_get_jiffies_stat_list() {
%1 = alloca %struct.cpuusage_jiffies_stat*
store %struct.cpuusage_jiffies_stat* null, %struct.cpuusage_jiffies_stat** %1
%2 = call %struct.cpuusage_jiffies_stat* (...) @proc_get_jiffies_stat_list()
store %struct.cpuusage_jiffies_stat* %2, %struct.cpuusage_jiffies_stat** %1
%3 = load %struct.cpuusage_jiffies_stat*, %struct.cpuusage_jiffies_stat** %1
ret %struct.cpuusage_jiffies_stat* %3
}

LLVM IR (-O2):
%struct.cpuusage_jiffies_stat = type { i32 }
define %struct.cpuusage_jiffies_stat* @cpuusage_get_jiffies_stat_list() {
%1 = tail call %struct.cpuusage_jiffies_stat* (...) @proc_get_jiffies_stat_list()
ret %struct.cpuusage_jiffies_stat* %1
}
void account_cpu_user_entry(void) {}


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

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

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

LLVM IR (-O2):
define void @account_cpu_user_entry() {
ret void
}
int isgsep(char ch) {
  switch (ch) {
  case ',':
  case ' ':
  case '\t':
  case '\0':
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<isgsep>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1151 <isgsep+0x51>
jmp    111e <isgsep+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
je     1151 <isgsep+0x51>
jmp    112f <isgsep+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1151 <isgsep+0x51>
jmp    1140 <isgsep+0x40>
mov    -0xc(%rbp),%eax
sub    $0x2c,%eax
jne    115d <isgsep+0x5d>
jmp    1151 <isgsep+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1164 <isgsep+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgsep>:
cmp    $0x2c,%edi
ja     111d <isgsep+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100100000201,%rdx
bt     %rcx,%rdx
jae    111d <isgsep+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isgsep(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 44, label %6
i32 32, label %6
i32 9, label %6
i32 0, label %6
]
6: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isgsep(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 44, label %4
i32 32, label %4
i32 9, label %4
i32 0, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
ssize_t __readv(int fd, const struct iovec *vector, int count) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__readv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readv>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
@ENOSYS = global i32 0
define i32 @__readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@ENOSYS = global i32 0
define i32 @__readv(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Type definitions */
struct atm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ date_time(struct atm *, struct atm *, int);
void date_noon(struct atm *tm, struct atm *now, int *num) {
  date_time(tm, now, 12);
}


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

x86 assembly (clang, -O2):
<date_noon>:
mov    $0xc,%edx
jmp    1030 <date_time@plt>

LLVM IR (-O0):
%struct.atm = type { i32 }
define void @date_noon(%struct.atm* %0, %struct.atm* %1, i32* %2) {
%4 = alloca %struct.atm*
%5 = alloca %struct.atm*
%6 = alloca i32*
store %struct.atm* %0, %struct.atm** %4
store %struct.atm* %1, %struct.atm** %5
store i32* %2, i32** %6
%7 = load %struct.atm*, %struct.atm** %4
%8 = load %struct.atm*, %struct.atm** %5
%9 = call i32 @date_time(%struct.atm* %7, %struct.atm* %8, i32 12)
ret void
}

LLVM IR (-O2):
%struct.atm = type { i32 }
define void @date_noon(%struct.atm* %0, %struct.atm* %1, i32* nocapture readnone %2) {
%4 = tail call i32 @date_time(%struct.atm* %0, %struct.atm* %1, i32 12)
ret void
}
/* Variables and functions */
void wizchip_cs_select(void) {}


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

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

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

LLVM IR (-O2):
define void @wizchip_cs_select() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_matlab_ancient_syntax_comment() {
  test_parser_verify_parse(test_parser_sourcefile("matlab", " ... comment"),
                           "matlab", "", "... comment", 0);
}


x86 assembly (clang, -O0):
<test_matlab_ancient_syntax_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xeba(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_matlab_ancient_syntax_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec8(%rip),%rdx
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"matlab\00"
@.str.1 = [13 x i8] c" ... comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c"... comment\00"
define void @test_matlab_ancient_syntax_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"matlab\00"
@.str.1 = [13 x i8] c" ... comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c"... comment\00"
define void @test_matlab_ancient_syntax_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
float call_degree(float x) {
  return (((x)*180.0f) / 3.141592653589793238462643);
}


x86 assembly (clang, -O0):
<call_degree>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_degree>:
mulss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @call_degree(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.800000e+02
%5 = fpext float %4 to double
%6 = fdiv double %5, 0x400921FB54442D18
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @call_degree(float %0) {
%2 = fmul float %0, 1.800000e+02
%3 = fpext float %2 to double
%4 = fdiv double %3, 0x400921FB54442D18
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ get_offset_of_partition(char const *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ usage();
int main(int argc, const char *argv[]) {
  if (argc != 2) {
    usage();
  }
  printf("0x%llx\n", get_offset_of_partition(argv[1]));
  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)
cmpl   $0x2,-0x8(%rbp)
je     1157 <main+0x27>
mov    $0x0,%al
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <get_offset_of_partition@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1140 <main+0x10>
xor    %eax,%eax
call   1050 <usage@plt>
mov    0x8(%rbx),%rdi
call   1040 <get_offset_of_partition@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"0x%llx\0A\00"
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @get_offset_of_partition(i8* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"0x%llx\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @get_offset_of_partition(i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
double mus_T_fix(double s, double alpha __attribute__((unused))) { return s; }


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

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

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

LLVM IR (-O2):
define double @mus_T_fix(double returned %0, double %1) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ cm_angle(int, int);
void camera_turn_right() { cm_angle(1533 + 100 / 256, 1533 + 100 % 256); }


x86 assembly (clang, -O0):
<camera_turn_right>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5fd,%edi
mov    $0x661,%esi
call   1030 <cm_angle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<camera_turn_right>:
mov    $0x5fd,%edi
mov    $0x661,%esi
jmp    1030 <cm_angle@plt>

LLVM IR (-O0):
define void @camera_turn_right() {
%1 = call i32 @cm_angle(i32 1533, i32 1633)
ret void
}

LLVM IR (-O2):
define void @camera_turn_right() {
%1 = tail call i32 @cm_angle(i32 1533, i32 1633)
ret void
}
void int_disable() { __asm__("cli"); }


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

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

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

LLVM IR (-O2):
define void @int_disable() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void procedimentoEscopo(int N) {
  int i;
  i = N + 1;
  printf("Sucessor de %d: %d\n", N, i);
}


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

x86 assembly (clang, -O2):
<procedimentoEscopo>:
mov    %edi,%esi
lea    0x1(%rsi),%edx
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Sucessor de %d: %d\0A\00"
define void @procedimentoEscopo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Sucessor de %d: %d\0A\00"
define void @procedimentoEscopo(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
int f_ge_rc2(float a1) { return !(((a1) >= (100))); }


x86 assembly (clang, -O0):
<f_ge_rc2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ge_rc2>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @f_ge_rc2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_ge_rc2(float %0) {
%2 = fcmp ult float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a = 252;
  printf("%  x", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xfc,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"% x\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 252)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_prime(int);
unsigned long int nth_prime(int n_prime) {
  int i = 2;
  int prime_count = 0;
  unsigned long int last_prime;
  while (prime_count != n_prime) {
    if (is_prime(i)) {
      prime_count++;
      last_prime = i;
    }
    i++;
  }
  return last_prime;
}


x86 assembly (clang, -O0):
<nth_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1166 <nth_prime+0x56>
mov    -0x8(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%rax
je     1158 <nth_prime+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <nth_prime+0x19>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_prime>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1150 <nth_prime+0x40>
mov    %edi,%r14d
xor    %ebx,%ebx
mov    $0x2,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
call   1030 <is_prime@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovne %rbp,%r15
setne  %cl
add    %ecx,%ebx
add    $0x1,%rbp
cmp    %r14d,%ebx
jne    1130 <nth_prime+0x20>
jmp    1150 <nth_prime+0x40>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @nth_prime(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %16, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %14, %3 ], [ 2, %1 ]
%5 = phi i64 [ %13, %3 ], [ undef, %1 ]
%6 = phi i32 [ %12, %3 ], [ 0, %1 ]
%7 = trunc i64 %4 to i32
%8 = tail call i64 @is_prime(i32 %7)
%9 = icmp eq i64 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %6, %11
%13 = select i1 %9, i64 %5, i64 %4
%14 = add nuw i64 %4, 1
%15 = icmp eq i32 %12, %0
br i1 %15, label %16, label %3
16: ; preds = %3, %1
%17 = phi i64 [ undef, %1 ], [ %13, %3 ]
ret i64 %17
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ PASS(char *);
int /*<<< orphan*/ bar();
int main() {
  bar();
  PASS("rpath-dlopen-in-dylib");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"rpath-dlopen-in-dylib\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bar()
%3 = call i32 @PASS(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@.str = [22 x i8] c"rpath-dlopen-in-dylib\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 @PASS(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
double _edotime_normalize_time(double t) {
  if (t < 0)
    t += 24;
  else if (24 < t)
    t -= 24;
  return t;
}


x86 assembly (clang, -O0):
<_edotime_normalize_time>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112e <_edotime_normalize_time+0x2e>
movsd  0xee1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1160 <_edotime_normalize_time+0x60>
movsd  -0x8(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115b <_edotime_normalize_time+0x5b>
movsd  -0x8(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1160 <_edotime_normalize_time+0x60>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_edotime_normalize_time>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1113 <_edotime_normalize_time+0x13>
addsd  0xeee(%rip),%xmm0
ret
ucomisd 0xee5(%rip),%xmm0
jbe    1125 <_edotime_normalize_time+0x25>
addsd  0xee3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_edotime_normalize_time(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 2.400000e+01
store double %7, double* %2
br label %15
8: ; preds = %1
%9 = load double, double* %2
%10 = fcmp olt double 2.400000e+01, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load double, double* %2
%13 = fsub double %12, 2.400000e+01
store double %13, double* %2
br label %14
14: ; preds = %11, %8
br label %15
15: ; preds = %14, %5
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @_edotime_normalize_time(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fadd double %0, 2.400000e+01
br label %9
5: ; preds = %1
%6 = fcmp ogt double %0, 2.400000e+01
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = fadd double %0, -2.400000e+01
br label %9
9: ; preds = %5, %7, %3
%10 = phi double [ %4, %3 ], [ %8, %7 ], [ %0, %5 ]
ret double %10
}
double _speed() { return 2.5; }


x86 assembly (clang, -O0):
<_speed>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_speed>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_speed() {
ret double 2.500000e+00
}

LLVM IR (-O2):
define double @_speed() {
ret double 2.500000e+00
}
/* Variables and functions */
int /*<<< orphan*/ fun();
int main(void) {
  fun();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fun()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t EMACPowerManagementControlGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x0000002C))) &
          (0x00000200 | 0x00000004 | 0x00000002 | 0x00000001));
}


x86 assembly (clang, -O0):
<EMACPowerManagementControlGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%eax
and    $0x207,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACPowerManagementControlGet>:
movslq %edi,%rcx
mov    $0x207,%eax
and    0x2c(%rcx),%eax
ret

LLVM IR (-O0):
define i32 @EMACPowerManagementControlGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 44
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 519
ret i32 %8
}

LLVM IR (-O2):
define i32 @EMACPowerManagementControlGet(i32 %0) {
%2 = add nsw i32 %0, 44
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 519
ret i32 %6
}
/* Variables and functions */
scalar_t__ lastLegType(char *);
int IsEquivPhase(char *target_phase, char *source_phase) {
  if (lastLegType(target_phase) == lastLegType(source_phase))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<IsEquivPhase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lastLegType@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <lastLegType@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jne    1152 <IsEquivPhase+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1159 <IsEquivPhase+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsEquivPhase>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <lastLegType@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <lastLegType@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @IsEquivPhase(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @lastLegType(i8* %6)
%8 = load i8*, i8** %5
%9 = call i64 @lastLegType(i8* %8)
%10 = icmp eq i64 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @IsEquivPhase(i8* %0, i8* %1) {
%3 = tail call i64 @lastLegType(i8* %0)
%4 = tail call i64 @lastLegType(i8* %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void put_pixel_be(char *px, int color) {
  px[0] = color & 0xFF;
  px[1] = (color >> 8) & 0xFF;
  px[2] = (color >> 16) & 0xFF;
  px[3] = (color >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<put_pixel_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @put_pixel_be(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int test_nested1(int);
int test_nested2(int);
int main() {
  int i = test_nested1(3);
  if (i != 15)
    abort();
  i = test_nested2(4);
  if (i != 22)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1050 <test_nested1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
je     115d <main+0x2d>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0x4,%edi
call   1030 <test_nested2@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x16,-0x8(%rbp)
je     117b <main+0x4b>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1050 <test_nested1@plt>
cmp    $0xf,%eax
jne    1153 <main+0x23>
mov    $0x4,%edi
call   1030 <test_nested2@plt>
cmp    $0x16,%eax
jne    1153 <main+0x23>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @test_nested1(i32 3)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 15
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = call i32 @test_nested2(i32 4)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 22
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_nested1(i32 3)
%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
%6 = tail call i32 @test_nested2(i32 4)
%7 = icmp eq i32 %6, 22
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
ret i32 0
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int errno;
size_t read(int, void *, size_t);
int read_nonblock(int fd, void *data, size_t *p_nbytes) {
  ssize_t ret;
  ret = read(fd, data, *p_nbytes);
  if (ret < 0)
    return -errno;
  *p_nbytes = ret;
  return 0;
}


x86 assembly (clang, -O0):
<read_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
call   1030 <read@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1158 <read_nonblock+0x48>
xor    %eax,%eax
mov    0x2e92(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <read_nonblock+0x5a>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_nonblock>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdx),%rdx
call   1030 <read@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @read_nonblock(i32 %0, i8* %1, i64* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64* %2, i64** %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64*, i64** %7
%12 = load i64, i64* %11
%13 = call i64 @read(i32 %9, i8* %10, i64 %12)
store i64 %13, i64* %8
%14 = load i64, i64* %8
%15 = icmp ult i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load i32, i32* @errno
%18 = sub nsw i32 0, %17
store i32 %18, i32* %4
br label %22
19: ; preds = %3
%20 = load i64, i64* %8
%21 = load i64*, i64** %7
store i64 %20, i64* %21
store i32 0, i32* %4
br label %22
22: ; preds = %19, %16
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @read_nonblock(i32 %0, i8* nocapture %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = tail call i64 @read(i32 %0, i8* %1, i64 %4)
store i64 %5, i64* %2
ret i32 0
}
void initarr(int *arr) {
  arr[0] = 1;
  arr[1] = 1;
  arr[2] = 1;
  arr[3] = 1;
  arr[4] = 1;
  arr[5] = 1;
  arr[6] = 1;
  arr[7] = 1;
  arr[8] = 1;
}


x86 assembly (clang, -O0):
<initarr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x1c(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initarr>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movl   $0x1,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @initarr(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
store i32 1, i32* %5
ret void
}
int cairo_code_draw_tinyButton_get_width() { return 22; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_tinyButton_get_width() {
ret i32 22
}

LLVM IR (-O2):
define i32 @cairo_code_draw_tinyButton_get_width() {
ret i32 22
}
int buf_size_valid_signed(const int size) {
  return __builtin_expect((size >= -1000000), 1) &&
         __builtin_expect((size < 1000000), 1);
}


x86 assembly (clang, -O0):
<buf_size_valid_signed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xfff0bdc0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
movslq %eax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1143 <buf_size_valid_signed+0x43>
cmpl   $0xf4240,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_size_valid_signed>:
add    $0xf4240,%edi
xor    %eax,%eax
cmp    $0x1e8480,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @buf_size_valid_signed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, -1000000
%5 = zext i1 %4 to i32
%6 = sext i32 %5 to i64
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 1000000
%11 = zext i1 %10 to i32
%12 = sext i32 %11 to i64
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @buf_size_valid_signed(i32 %0) {
%2 = add i32 %0, 1000000
%3 = icmp ult i32 %2, 2000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
int /*<<< orphan*/ WatchdogStatusHandle();
void WatchdogStatusRequestUpdate() {
  UAVObjRequestUpdate(WatchdogStatusHandle());
}


x86 assembly (clang, -O0):
<WatchdogStatusRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <WatchdogStatusHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogStatusRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <WatchdogStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @WatchdogStatusRequestUpdate() {
%1 = call i32 (...) @WatchdogStatusHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @WatchdogStatusRequestUpdate() {
%1 = tail call i32 (...) @WatchdogStatusHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ print(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void echo(int connfd) {
  ssize_t n;
  char buf[100];
  while ((n = read(connfd, buf, 100)) > 0) {
    print(buf, n);
    write(connfd, buf, n);
  }
}


x86 assembly (clang, -O0):
<echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0x64,%edx
call   1050 <read@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1178 <echo+0x48>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <print@plt>
mov    -0x4(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <write@plt>
jmp    113b <echo+0xb>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo>:
push   %rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %edi,%ebx
mov    %rsp,%rsi
mov    $0x64,%edx
call   1050 <read@plt>
test   %eax,%eax
jle    117b <echo+0x4b>
mov    %eax,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <print@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x64,%edx
call   1050 <read@plt>
mov    %eax,%ebp
test   %eax,%eax
jg     1150 <echo+0x20>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @echo(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 100)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ %4, %1 ]
%8 = call i32 @print(i8* %3, i32 %7)
%9 = call i32 @write(i32 %0, i8* %3, i32 %7)
%10 = call i32 @read(i32 %0, i8* %3, i32 100)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %1
ret void
}
unsigned long long rdtsc(void) {
  unsigned int low, high;
  asm volatile("rdtsc" : "=a"(low), "=d"(high));
  return low | ((unsigned long long)high) << 32;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
void handle_VTALRM(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_VTALRM(i32 %0) {
ret void
}
int mul(int arg1, int arg2) {
  int result = arg1 * arg2;
  return result;
}


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

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

LLVM IR (-O0):
define i32 @mul(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}