xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ferror(int /*<<< orphan*/ *);
void uninit_ferror(void) {
  FILE *fp;
  ferror(fp);
}


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

x86 assembly (clang, -O2):
<uninit_ferror>:
jmp    1030 <ferror@plt>

LLVM IR (-O0):
define void @uninit_ferror() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @ferror(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninit_ferror() {
%1 = tail call i32 @ferror(i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int quitopt() {
  clear();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @quitopt() {
%1 = call i32 (...) @clear()
ret i32 0
}

LLVM IR (-O2):
define i32 @quitopt() {
%1 = tail call i32 (...) @clear()
ret i32 0
}
void rl_ttyset(int Reset) {}


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

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

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

LLVM IR (-O2):
define void @rl_ttyset(i32 %0) {
ret void
}
/* Type definitions */
struct inode {
  int dummy;
};
struct dentry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IPUT(struct inode *);
int /*<<< orphan*/ print_entry_location();
int /*<<< orphan*/ print_exit_location();
void unionfs_d_iput(struct dentry *dentry, struct inode *inode) {
  print_entry_location();
  IPUT(inode);
  print_exit_location();
}


x86 assembly (clang, -O0):
<unionfs_d_iput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <print_entry_location@plt>
mov    -0x10(%rbp),%rdi
call   1040 <IPUT@plt>
mov    $0x0,%al
call   1050 <print_exit_location@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unionfs_d_iput>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <print_entry_location@plt>
mov    %rbx,%rdi
call   1040 <IPUT@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <print_exit_location@plt>

LLVM IR (-O0):
%struct.dentry = type { i32 }
%struct.inode = type { i32 }
define void @unionfs_d_iput(%struct.dentry* %0, %struct.inode* %1) {
%3 = alloca %struct.dentry*
%4 = alloca %struct.inode*
store %struct.dentry* %0, %struct.dentry** %3
store %struct.inode* %1, %struct.inode** %4
%5 = call i32 (...) @print_entry_location()
%6 = load %struct.inode*, %struct.inode** %4
%7 = call i32 @IPUT(%struct.inode* %6)
%8 = call i32 (...) @print_exit_location()
ret void
}

LLVM IR (-O2):
%struct.dentry = type { i32 }
%struct.inode = type { i32 }
define void @unionfs_d_iput(%struct.dentry* nocapture readnone %0, %struct.inode* %1) {
%3 = tail call i32 (...) @print_entry_location()
%4 = tail call i32 @IPUT(%struct.inode* %1)
%5 = tail call i32 (...) @print_exit_location()
ret void
}
/* Variables and functions */
int cm_delete_entry(char *, char *, char *, char *);
int delgroup(char *group) {
  int i;
  if ((i = cm_delete_entry(group, "%[^:]:%*[^:]:%*d:%*[^:]", "/etc/group",
                           "/etc/.group.cm")) != 0) {
    return i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<delgroup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xeea(%rip),%rdx
lea    0xeee(%rip),%rcx
call   1030 <cm_delete_entry@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1151 <delgroup+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <delgroup+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delgroup>:
lea    0xee9(%rip),%rsi
lea    0xefa(%rip),%rdx
lea    0xefe(%rip),%rcx
jmp    1030 <cm_delete_entry@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%[^:]:%*[^:]:%*d:%*[^:]\00"
@.str.1 = [11 x i8] c"/etc/group\00"
@.str.2 = [15 x i8] c"/etc/.group.cm\00"
define i32 @delgroup(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @cm_delete_entry(i8* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [24 x i8] c"%[^:]:%*[^:]:%*d:%*[^:]\00"
@.str.1 = [11 x i8] c"/etc/group\00"
@.str.2 = [15 x i8] c"/etc/.group.cm\00"
define i32 @delgroup(i8* %0) {
%2 = tail call i32 @cm_delete_entry(i8* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 %2
}
void *func1(void *param) {
  static retvalue = 42;
  chdir("/bin");
  usleep(300000);
  return &retvalue;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <chdir@plt>
mov    $0x493e0,%edi
mov    $0x0,%al
call   1040 <usleep@plt>
lea    0x2ee3(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <chdir@plt>
mov    $0x493e0,%edi
xor    %eax,%eax
call   1040 <usleep@plt>
lea    0x2eee(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@func1.retvalue = internal global i32 42
@.str = [5 x i8] c"/bin\00"
define i8* @func1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 300000)
ret i8* bitcast (i32* @func1.retvalue to i8*)
}

LLVM IR (-O2):
@func1.retvalue = internal global i32 42
@.str = [5 x i8] c"/bin\00"
define i8* @func1(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 300000)
ret i8* bitcast (i32* @func1.retvalue to i8*)
}
int Sfile_count_char(char *text, char to_count) {
  int count = 0;
  char *cpt;
  for (cpt = text; *cpt != 0; cpt++)
    if (*cpt == to_count)
      count++;
  return count;
}


x86 assembly (clang, -O0):
<Sfile_count_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <Sfile_count_char+0x5f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <Sfile_count_char+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <Sfile_count_char+0x4e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111d <Sfile_count_char+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sfile_count_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <Sfile_count_char+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <Sfile_count_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Sfile_count_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
int camera_report_dsm_err(int type, int err_num, const char *str) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @camera_report_dsm_err(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
double pow(double, int);
double strength_node(double nw1, double nw2, double ew) {
  return 1.0 * nw1 * nw2 / pow(ew, 2);
}


x86 assembly (clang, -O0):
<strength_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_node>:
push   %rax
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm2,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @strength_node(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fmul double 1.000000e+00, %7
%9 = load double, double* %5
%10 = fmul double %8, %9
%11 = load double, double* %6
%12 = call double @pow(double %11, i32 2)
%13 = fdiv double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @strength_node(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = tail call double @pow(double %2, i32 2)
%6 = fdiv double %4, %5
ret double %6
}
int test_imm_30int64_highword_reg(long long val) {
  return ((val >> 32) & (0x30 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_30int64_highword_reg>:
movabs $0x3000000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_30int64_highword_reg(i64 %0) {
%2 = and i64 %0, 206158430208
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ smp_test_mpool_create();
void smp_test_mpool_main() { smp_test_mpool_create(); }


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

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

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

LLVM IR (-O2):
define void @smp_test_mpool_main() {
%1 = tail call i32 (...) @smp_test_mpool_create()
ret void
}
int number_of_digits_long(long num) {
  int digits = 0;
  if (num < 0) {
    num *= -1;
  }
  while (num != 0) {
    digits += 1;
    num /= 10;
  }
  return digits;
}


x86 assembly (clang, -O0):
<number_of_digits_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1123 <number_of_digits_long+0x23>
imul   $0xffffffffffffffff,-0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1128 <number_of_digits_long+0x28>
cmpq   $0x0,-0x8(%rbp)
je     1153 <number_of_digits_long+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1128 <number_of_digits_long+0x28>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_digits_long>:
test   %rdi,%rdi
je     1147 <number_of_digits_long+0x47>
mov    %rdi,%rsi
neg    %rsi
cmovs  %rdi,%rsi
xor    %ecx,%ecx
movabs $0x6666666666666667,%rdi
66 66 66
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %rsi,%rax
imul   %rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    $0x9,%rsi
cmp    $0x12,%rsi
mov    %rdx,%rsi
ja     1120 <number_of_digits_long+0x20>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @number_of_digits_long(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = phi i64 [ %9, %5 ], [ %4, %3 ]
%8 = add nuw nsw i32 %6, 1
%9 = sdiv i64 %7, 10
%10 = add i64 %7, 9
%11 = icmp ult i64 %10, 19
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %13
}
int isonum_732(char *p) {
  return (((p[0] & 0xff) << 24) | ((p[1] & 0xff) << 16) | ((p[2] & 0xff) << 8) |
          (p[3] & 0xff));
}


x86 assembly (clang, -O0):
<isonum_732>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isonum_732(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int octave_o_excl_wrapper(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @octave_o_excl_wrapper() {
ret i32 -1
}
/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ move(scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
void done() {
  move(LINES - 1, 0);
  clrtoeol();
  refresh();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<done>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e8d(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
xor    %esi,%esi
call   1070 <move@plt>
mov    $0x0,%al
call   1050 <clrtoeol@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<done>:
push   %rax
mov    0x2e90(%rip),%rax
mov    (%rax),%rdi
add    $0xffffffffffffffff,%rdi
xor    %esi,%esi
call   1070 <move@plt>
xor    %eax,%eax
call   1050 <clrtoeol@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@LINES = global i64 0
define void @done() {
%1 = load i64, i64* @LINES
%2 = sub nsw i64 %1, 1
%3 = call i32 @move(i64 %2, i32 0)
%4 = call i32 (...) @clrtoeol()
%5 = call i32 (...) @refresh()
%6 = call i32 (...) @endwin()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LINES = global i64 0
define void @done() {
%1 = load i64, i64* @LINES
%2 = add nsw i64 %1, -1
%3 = tail call i32 @move(i64 %2, i32 0)
%4 = tail call i32 (...) @clrtoeol()
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @endwin()
%7 = tail call i32 @exit(i32 0)
unreachable
}
void *malloc_watch(addr) void *addr;
{
  register int i;
  void *ret;
  if (addr == 0)
    return addr;
  ret = (void *)0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @malloc_watch(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ core9_swap(char *, int);
void U_EMRCHORD_swap(char *record, int torev) { core9_swap(record, torev); }


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

x86 assembly (clang, -O2):
<U_EMRCHORD_swap>:
jmp    1030 <core9_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRCHORD_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core9_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
void _msgout(char *msg) { syslog(LOG_ERR, "%s", msg); }


x86 assembly (clang, -O0):
<_msgout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_msgout>:
mov    %rdi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [3 x i8] c"%s\00"
define void @_msgout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_ERR
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [3 x i8] c"%s\00"
define void @_msgout(i8* %0) {
%2 = load i32, i32* @LOG_ERR
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int bwb_stripcr(char *s) {
  bwx_DEBUG(__FUNCTION__);
  while (*s) {
    if (*s < ' ')
      *s = ' ';
    s++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<bwb_stripcr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <bwb_stripcr+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jge    114e <bwb_stripcr+0x3e>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112a <bwb_stripcr+0x1a>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_stripcr>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <bwx_DEBUG@plt>
mov    (%rbx),%al
test   %al,%al
je     1145 <bwb_stripcr+0x35>
add    $0x1,%rbx
jmp    113b <bwb_stripcr+0x2b>
xchg   %ax,%ax
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1145 <bwb_stripcr+0x35>
cmp    $0x1f,%al
jg     1130 <bwb_stripcr+0x20>
movb   $0x20,-0x1(%rbx)
jmp    1130 <bwb_stripcr+0x20>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__FUNCTION__.bwb_stripcr = [12 x i8] c"bwb_stripcr\00"
define i32 @bwb_stripcr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.bwb_stripcr, i64 0, i64 0))
br label %4
4: ; preds = %15, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp slt i32 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %2
store i8 32, i8* %14
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %4
18: ; preds = %4
ret i32 -1
}

LLVM IR (-O2):
@__FUNCTION__.bwb_stripcr = [12 x i8] c"bwb_stripcr\00"
define i32 @bwb_stripcr(i8* nocapture %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.bwb_stripcr, i64 0, i64 0))
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %10
%6 = phi i8 [ %12, %10 ], [ %3, %1 ]
%7 = phi i8* [ %11, %10 ], [ %0, %1 ]
%8 = icmp slt i8 %6, 32
br i1 %8, label %9, label %10
9: ; preds = %5
store i8 32, i8* %7
br label %10
10: ; preds = %9, %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %10, %1
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ __NR_kill;
long syscall(int /*<<< orphan*/, int, int);
long int __kill(int x, int y) { return syscall(__NR_kill, x, y); }


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

x86 assembly (clang, -O2):
<__kill>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_kill = global i32 0
define i64 @__kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @__NR_kill
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i64 @syscall(i32 %5, i32 %6, i32 %7)
ret i64 %8
}

LLVM IR (-O2):
@__NR_kill = global i32 0
define i64 @__kill(i32 %0, i32 %1) {
%3 = load i32, i32* @__NR_kill
%4 = tail call i64 @syscall(i32 %3, i32 %0, i32 %1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("git test\n");
  printf("git test2\n");
  printf("git test3\n");
  printf("git test4\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    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%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    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"git test\0A\00"
@.str.1 = [11 x i8] c"git test2\0A\00"
@.str.2 = [11 x i8] c"git test3\0A\00"
@.str.3 = [11 x i8] c"git test4\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"git test\00"
@str.4 = [10 x i8] c"git test2\00"
@str.5 = [10 x i8] c"git test3\00"
@str.6 = [10 x i8] c"git test4\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct Bot {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void on_cp_chat_join(struct Bot *self, char *chat_name) {
  ((void)(self));
  printf("Joined chat #%s\n", chat_name);
}


x86 assembly (clang, -O0):
<on_cp_chat_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Bot = type { i32 }
@.str = [17 x i8] c"Joined chat #%s\0A\00"
define void @on_cp_chat_join(%struct.Bot* %0, i8* %1) {
%3 = alloca %struct.Bot*
%4 = alloca i8*
store %struct.Bot* %0, %struct.Bot** %3
store i8* %1, i8** %4
%5 = load %struct.Bot*, %struct.Bot** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
%struct.Bot = type { i32 }
@.str = [17 x i8] c"Joined chat #%s\0A\00"
define void @on_cp_chat_join(%struct.Bot* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void g_strdupv() {}


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

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

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

LLVM IR (-O2):
define void @g_strdupv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ midi_close();
int /*<<< orphan*/ plat_midi_close();
void system_midi_close(void *p) {
  plat_midi_close();
  midi_close();
}


x86 assembly (clang, -O0):
<system_midi_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <plat_midi_close@plt>
mov    $0x0,%al
call   1030 <midi_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_midi_close>:
push   %rax
xor    %eax,%eax
call   1040 <plat_midi_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <midi_close@plt>

LLVM IR (-O0):
define void @system_midi_close(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @plat_midi_close()
%4 = call i32 (...) @midi_close()
ret void
}

LLVM IR (-O2):
define void @system_midi_close(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @plat_midi_close()
%3 = tail call i32 (...) @midi_close()
ret void
}
float sclamp(float k) {
  if (k < -1.f)
    return -1.f;
  else if (k > 1.f)
    return 1.f;
  else
    return k;
}


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

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

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

LLVM IR (-O2):
define float @sclamp(float %0) {
%2 = fcmp olt float %0, -1.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float -1.000000e+00, float %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ eval_standard(int, char const **);
int main(int argc, const char *argv[]) {
  eval_standard(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <eval_standard@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <eval_standard@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @eval_standard(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @eval_standard(i32 %0, i8** %1)
ret i32 0
}
__attribute__((used)) int raise(int sig_no __attribute__((unused))) {
  do {
    libc_fatal(
        "Code is unreachable",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/qdk0901/iotjs-openwrt/refs/heads/master/"
        "deps/jerry/jerry-libc/target/linux/jerry-libc-target.c",
        __func__, 34);
  } while (0);
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xf9d(%rip),%rdx
mov    $0x22,%ecx
mov    $0x0,%al
call   1030 <libc_fatal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
lea    0xee9(%rip),%rdi
lea    0xef6(%rip),%rsi
lea    0xfa8(%rip),%rdx
mov    $0x22,%ecx
xor    %eax,%eax
jmp    1030 <libc_fatal@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Code is unreachable\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/qdk0901/iotjs-openwrt/refs/heads/master/deps/jerry/jerry-libc/target/linux/jerry-libc-target.c\00"
@__func__.raise = [6 x i8] c"raise\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @raise to i8*)], section "llvm.metadata"
define i32 @raise(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %1
%5 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @libc_fatal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.raise, i64 0, i64 0), i32 34)
br label %6
6: ; preds = %4
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [20 x i8] c"Code is unreachable\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/qdk0901/iotjs-openwrt/refs/heads/master/deps/jerry/jerry-libc/target/linux/jerry-libc-target.c\00"
@__func__.raise = [6 x i8] c"raise\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @raise to i8*)], section "llvm.metadata"
define i32 @raise(i32 %0) {
%2 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @libc_fatal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.raise, i64 0, i64 0), i32 34)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit_test(int);
int /*<<< orphan*/ print_error(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strsignal(int);
void exception_handler(int sig) {
  print_error("                "
              "%s\n",
              strsignal(sig));
  exit_test(1);
}


x86 assembly (clang, -O0):
<exception_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strsignal@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <print_error@plt>
mov    $0x1,%edi
call   1040 <exit_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exception_handler>:
push   %rax
call   1050 <strsignal@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <print_error@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <exit_test@plt>

LLVM IR (-O0):
@.str = [20 x i8] c" %s\0A\00"
define void @exception_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @strsignal(i32 %3)
%5 = call i32 @print_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit_test(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c" %s\0A\00"
define void @exception_handler(i32 %0) {
%2 = tail call i32 @strsignal(i32 %0)
%3 = tail call i32 @print_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit_test(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f1(void) { printf("the 11111 exit handler\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"the 11111 exit handler\0A\00"
define void @f1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"the 11111 exit handler\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
void rop3_50_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T | S;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_50_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_50_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %6
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_50_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XMapEvent;

/* Variables and functions */
unsigned long get_XMapEvent_serial(void *_p) {
  return (unsigned long)((XMapEvent *)_p)->serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XMapEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ EMALLOC(long, float **);
void hst_alloc_n(int na, long n, float *a[]) {
  for (int i = 0; i < na; ++i)
    EMALLOC(n, &a[i]);
}


x86 assembly (clang, -O0):
<hst_alloc_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115c <hst_alloc_n+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <EMALLOC@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <hst_alloc_n+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hst_alloc_n>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1145 <hst_alloc_n+0x35>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <EMALLOC@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <hst_alloc_n+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @hst_alloc_n(i32 %0, i64 %1, float** %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = getelementptr inbounds float*, float** %2, i64 %9
%11 = tail call i32 @EMALLOC(i64 %1, float** %10)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %7, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("DSO\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"DSO\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  i = 0;
  while (i < 2) {
    i = i + 10;
  }
  assert(i == 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    113e <main+0x2e>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
cmpl   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ i2c_SCL_set(int);
int /*<<< orphan*/ i2c_SDA_set(int);
void i2c_start_cond(void) {
  i2c_SDA_set(1);
  i2c_SCL_set(1);
  i2c_SDA_set(0);
}


x86 assembly (clang, -O0):
<i2c_start_cond>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <i2c_SDA_set@plt>
mov    $0x1,%edi
call   1040 <i2c_SCL_set@plt>
xor    %edi,%edi
call   1030 <i2c_SDA_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_start_cond>:
push   %rax
mov    $0x1,%edi
call   1030 <i2c_SDA_set@plt>
mov    $0x1,%edi
call   1040 <i2c_SCL_set@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <i2c_SDA_set@plt>

LLVM IR (-O0):
define void @i2c_start_cond() {
%1 = call i32 @i2c_SDA_set(i32 1)
%2 = call i32 @i2c_SCL_set(i32 1)
%3 = call i32 @i2c_SDA_set(i32 0)
ret void
}

LLVM IR (-O2):
define void @i2c_start_cond() {
%1 = tail call i32 @i2c_SDA_set(i32 1)
%2 = tail call i32 @i2c_SCL_set(i32 1)
%3 = tail call i32 @i2c_SDA_set(i32 0)
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
char ft_wchrbin(wchar_t c) {
  char i;
  i = 0;
  while (c > 0) {
    c = c >> 1;
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_wchrbin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112b <ft_wchrbin+0x2b>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    110b <ft_wchrbin+0xb>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_wchrbin>:
xor    %eax,%eax
test   %edi,%edi
jle    111b <ft_wchrbin+0x1b>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%al
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ft_wchrbin+0x10>
ret

LLVM IR (-O0):
define signext i8 @ft_wchrbin(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = ashr i32 %8, 1
store i32 %9, i32* %2
%10 = load i8, i8* %3
%11 = add i8 %10, 1
store i8 %11, i8* %3
br label %4
12: ; preds = %4
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @ft_wchrbin(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i8 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i8 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8 [ 0, %1 ], [ %7, %3 ]
ret i8 %10
}