xunge/DecIR huggingface dataset:
int f2(void) {
  int array[10];
  int i;
  i = sizeof array / sizeof *array;
  i += sizeof array / sizeof array[0];
  i += sizeof(array) / sizeof(*array);
  i += sizeof(array) / sizeof(array[0]);
  i += (sizeof(array)) / (sizeof(array[0]));
  i += sizeof(array) / sizeof(int);
  i += sizeof(array) / sizeof(char);
  i += sizeof(*array) / sizeof(char);
  i += sizeof(array[0]) / sizeof(char);
  return i;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x34(%rbp)
movslq -0x34(%rbp),%rax
add    $0xa,%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
add    $0xa,%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
add    $0xa,%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
add    $0xa,%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
add    $0xa,%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
add    $0x28,%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
add    $0x4,%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
add    $0x4,%rax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f2() {
%1 = alloca [10 x i32]
%2 = alloca i32
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = add i64 %4, 10
%6 = trunc i64 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = add i64 %8, 10
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = add i64 %12, 10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = add i64 %16, 10
%18 = trunc i64 %17 to i32
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = add i64 %20, 10
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = add i64 %24, 40
%26 = trunc i64 %25 to i32
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = add i64 %28, 4
%30 = trunc i64 %29 to i32
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = add i64 %32, 4
%34 = trunc i64 %33 to i32
store i32 %34, i32* %2
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @f2() {
ret i32 108
}
/* Variables and functions */
int /*<<< orphan*/ pam_end();
void dumpme(void) { pam_end(); }


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

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

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

LLVM IR (-O2):
define void @dumpme() {
%1 = tail call i32 (...) @pam_end()
ret void
}
void gtk_requisition_copy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_requisition_copy() {
ret void
}
int BSVM2_NatCall_RegisterProcAddress(char *name, void *addr) { return (0); }


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

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

LLVM IR (-O0):
define i32 @BSVM2_NatCall_RegisterProcAddress(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @BSVM2_NatCall_RegisterProcAddress(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func3();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from subdir2/subdir3/prog3.c\n");
  func3();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Hello from subdir2/subdir3/prog3.c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @func3()
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Hello from subdir2/subdir3/prog3.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func3()
ret i32 0
}
/* Variables and functions */
int plusminus(int, int, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int printThis = plusminus(5, 10, 1);
  printf("%d\n", printThis);
  printThis = plusminus(5, 10, 0);
  printf("%d\n", printThis);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
mov    $0xa,%esi
mov    $0x1,%edx
call   1040 <plusminus@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1040 <plusminus@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
mov    $0xa,%esi
mov    $0x1,%edx
call   1040 <plusminus@plt>
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1040 <plusminus@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @plusminus(i32 5, i32 10, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @plusminus(i32 5, i32 10, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
gether(out, cp) register char *out;
register char *cp;
{
  register int i;
  for (i = 6; i != 0; i--) {
    *out++ = htoi(cp);
    if ((cp = strchr(cp, ':')) == (char *)0)
      break;
    cp++;
  }
}


x86 assembly (clang, -O0):
<gether>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x6,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     119a <gether+0x7a>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <htoi@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1180 <gether+0x60>
jmp    119a <gether+0x7a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1137 <gether+0x17>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gether>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %r15d,%r15d
xchg   %ax,%ax
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <htoi@plt>
mov    %al,(%r14,%r15,1)
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1164 <gether+0x44>
mov    %rax,%rbx
add    $0x1,%rbx
lea    0x1(%r15),%rax
cmp    $0x5,%r15d
mov    %rax,%r15
jne    1130 <gether+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @gether(i8* nocapture writeonly %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 6, %2 ], [ %13, %3 ]
%5 = phi i8* [ %1, %2 ], [ %12, %3 ]
%6 = phi i8* [ %0, %2 ], [ %11, %3 ]
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @htoi to i32 (i8*, ...)*)(i8* %5)
%8 = trunc i32 %7 to i8
store i8 %8, i8* %6
%9 = tail call i8* @strchr(i8* dereferenceable(1) %5, i32 58)
%10 = icmp eq i8* %9, null
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = add nsw i32 %4, -1
%14 = icmp eq i32 %13, 0
%15 = select i1 %10, i1 true, i1 %14
br i1 %15, label %16, label %3
16: ; preds = %3
ret i32 undef
}
int test_imm_7Cuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x7C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Cuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 124
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
asl() {
  ol("movl %eax, %ecx");
  ol("movl %edx, %eax");
  ol("sall %cl, %eax");
}


x86 assembly (clang, -O0):
<asl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xee5(%rip),%rdi
call   1030 <ol@plt>
lea    0xee9(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asl>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xeec(%rip),%rdi
call   1030 <ol@plt>
lea    0xef0(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"movl %eax, %ecx\00"
@.str.1 = [16 x i8] c"movl %edx, %eax\00"
@.str.2 = [15 x i8] c"sall %cl, %eax\00"
define i32 @asl() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"movl %eax, %ecx\00"
@.str.1 = [16 x i8] c"movl %edx, %eax\00"
@.str.2 = [15 x i8] c"sall %cl, %eax\00"
define i32 @asl() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 undef
}
long hash_int(int num) {
  long hash = num;
  if (hash == -1) {
    hash = -2;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1122 <hash_int+0x22>
movq   $0xfffffffffffffffe,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_int>:
cmp    $0xffffffff,%edi
mov    $0xfffffffe,%eax
cmovne %edi,%eax
cltq
ret

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

LLVM IR (-O2):
define i64 @hash_int(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = select i1 %2, i32 -2, i32 %0
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ ExtSelect(char *, char *, int /*<<< orphan*/);
void ExttJobSelect(void) {
  ExtSelect("tJob",
            "tJob.uJob,tJob.uMasterJob,tJob.cJob,tJob.cZone,tJob.uNSSet,tJob."
            "cTargetServer,tJob.uPriority,tJob.uTime,tJob.cJobData,tJob.uOwner,"
            "tJob.uCreatedBy,tJob.uCreatedDate,tJob.uModBy,tJob.uModDate",
            0);
}


x86 assembly (clang, -O0):
<ExttJobSelect>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee3(%rip),%rsi
xor    %edx,%edx
call   1030 <ExtSelect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExttJobSelect>:
lea    0xee9(%rip),%rdi
lea    0xee7(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ExtSelect@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"tJob\00"
@.str.1 = [190 x i8] c"tJob.uJob,tJob.uMasterJob,tJob.cJob,tJob.cZone,tJob.uNSSet,tJob.cTargetServer,tJob.uPriority,tJob.uTime,tJob.cJobData,tJob.uOwner,tJob.uCreatedBy,tJob.uCreatedDate,tJob.uModBy,tJob.uModDate\00"
define void @ExttJobSelect() {
%1 = call i32 @ExtSelect(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"tJob\00"
@.str.1 = [190 x i8] c"tJob.uJob,tJob.uMasterJob,tJob.cJob,tJob.cZone,tJob.uNSSet,tJob.cTargetServer,tJob.uPriority,tJob.uTime,tJob.cJobData,tJob.uOwner,tJob.uCreatedBy,tJob.uCreatedDate,tJob.uModBy,tJob.uModDate\00"
define void @ExttJobSelect() {
%1 = tail call i32 @ExtSelect(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arch_disable_interrupts();
int /*<<< orphan*/ sleep(int);
void cpu_stop(void) {
  arch_disable_interrupts();
  while (1)
    sleep(3600);
}


x86 assembly (clang, -O0):
<cpu_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arch_disable_interrupts@plt>
mov    $0xe10,%edi
call   1040 <sleep@plt>
jmp    112b <cpu_stop+0xb>

x86 assembly (clang, -O2):
<cpu_stop>:
push   %rax
xor    %eax,%eax
call   1030 <arch_disable_interrupts@plt>
nopl   0x0(%rax,%rax,1)
mov    $0xe10,%edi
call   1040 <sleep@plt>
jmp    1130 <cpu_stop+0x10>

LLVM IR (-O0):
define void @cpu_stop() {
%1 = call i32 (...) @arch_disable_interrupts()
br label %2
2: ; preds = %0, %2
%3 = call i32 @sleep(i32 3600)
br label %2
}

LLVM IR (-O2):
define void @cpu_stop() {
%1 = tail call i32 (...) @arch_disable_interrupts()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @sleep(i32 3600)
br label %2
}
void foo437() {}


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

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

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

LLVM IR (-O2):
define void @foo437() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void multerr(int pnctn_sts[]) {
  if (pnctn_sts[1] == 1) {
    printf("Error: open block comment\n");
  }
  if (pnctn_sts[0] != 0) {
    printf("Error: open braces\n");
  }
}


x86 assembly (clang, -O0):
<multerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,0x4(%rax)
jne    1136 <multerr+0x26>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     114f <multerr+0x3f>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multerr>:
push   %rbx
mov    %rdi,%rbx
cmpl   $0x1,0x4(%rdi)
jne    1126 <multerr+0x16>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,(%rbx)
je     1138 <multerr+0x28>
lea    0xece(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Error: open block comment\0A\00"
@.str.1 = [20 x i8] c"Error: open braces\0A\00"
define void @multerr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Error: open braces\00"
@str.2 = [26 x i8] c"Error: open block comment\00"
define void @multerr(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %0
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
ret void
}
int test02_inv(int a, int b) { return (a <= b) ? 0x80000000 : 0x7FFFFFFF; }


x86 assembly (clang, -O0):
<test02_inv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    $0x7fffffff,%eax
mov    $0x80000000,%ecx
cmp    %esi,%edx
cmovle %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test02_inv>:
xor    %ecx,%ecx
cmp    %esi,%edi
setg   %cl
mov    $0x80000000,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test02_inv(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -2147483648, i32 2147483647
ret i32 %9
}

LLVM IR (-O2):
define i32 @test02_inv(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 2147483647, i32 -2147483648
ret i32 %4
}
int sarprintf(const char *format, ...) {
  format = format;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @sarprintf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8* %3, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @sarprintf(i8* nocapture readnone %0, ...) {
ret i32 0
}
struct lvar_leaf_entry *lentry_lvar(const struct iam_lentry *lent) {
  return (struct lvar_leaf_entry *)lent;
}


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

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

LLVM IR (-O0):
%struct.lvar_leaf_entry = type opaque
%struct.iam_lentry = type opaque
define %struct.lvar_leaf_entry* @lentry_lvar(%struct.iam_lentry* %0) {
%2 = alloca %struct.iam_lentry*
store %struct.iam_lentry* %0, %struct.iam_lentry** %2
%3 = load %struct.iam_lentry*, %struct.iam_lentry** %2
%4 = bitcast %struct.iam_lentry* %3 to %struct.lvar_leaf_entry*
ret %struct.lvar_leaf_entry* %4
}

LLVM IR (-O2):
%struct.lvar_leaf_entry = type opaque
%struct.iam_lentry = type opaque
define %struct.lvar_leaf_entry* @lentry_lvar(%struct.iam_lentry* readnone %0) {
%2 = bitcast %struct.iam_lentry* %0 to %struct.lvar_leaf_entry*
ret %struct.lvar_leaf_entry* %2
}
double exp2(double x) {}


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

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

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

LLVM IR (-O2):
define double @exp2(double %0) {
ret double undef
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
void becomesLowercase(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++) {
    s[i] = tolower(s[i]);
  }
}


x86 assembly (clang, -O0):
<becomesLowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <becomesLowercase+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <becomesLowercase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<becomesLowercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <becomesLowercase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <becomesLowercase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @becomesLowercase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CLEAR_PRINTS();
int /*<<< orphan*/ PRINT_STRING_WITH_LITERAL_STRING(char *, char *, int, int);
void print(char *text) {
  CLEAR_PRINTS();
  PRINT_STRING_WITH_LITERAL_STRING("string", text, 3000, 1);
  return;
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <CLEAR_PRINTS@plt>
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0xbb8,%edx
mov    $0x1,%ecx
call   1030 <PRINT_STRING_WITH_LITERAL_STRING@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <CLEAR_PRINTS@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    $0xbb8,%edx
mov    $0x1,%ecx
pop    %rbx
jmp    1030 <PRINT_STRING_WITH_LITERAL_STRING@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"string\00"
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @CLEAR_PRINTS()
%4 = load i8*, i8** %2
%5 = call i32 @PRINT_STRING_WITH_LITERAL_STRING(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i32 3000, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"string\00"
define void @print(i8* %0) {
%2 = tail call i32 (...) @CLEAR_PRINTS()
%3 = tail call i32 @PRINT_STRING_WITH_LITERAL_STRING(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 3000, i32 1)
ret void
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void send_class(struct ship *ship, long a) { Write(3, ship, a, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_class>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x3,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_class>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x3,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_class(%struct.ship* %0, i64 %1) {
%3 = alloca %struct.ship*
%4 = alloca i64
store %struct.ship* %0, %struct.ship** %3
store i64 %1, i64* %4
%5 = load %struct.ship*, %struct.ship** %3
%6 = load i64, i64* %4
%7 = call i32 @Write(i32 3, %struct.ship* %5, i64 %6, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_class(%struct.ship* %0, i64 %1) {
%3 = tail call i32 @Write(i32 3, %struct.ship* %0, i64 %1, i32 0, i32 0, i32 0)
ret void
}
float absoluteValue(float x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<absoluteValue>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <absoluteValue+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <absoluteValue+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absoluteValue>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @absoluteValue(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ I2CAL_output_clock(int);
int /*<<< orphan*/ I2CAL_output_data(int);
void SendI2CNack(void) {
  I2CAL_output_data(1);
  I2CAL_output_clock(1);
  I2CAL_output_clock(0);
}


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

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

LLVM IR (-O0):
define void @SendI2CNack() {
%1 = call i32 @I2CAL_output_data(i32 1)
%2 = call i32 @I2CAL_output_clock(i32 1)
%3 = call i32 @I2CAL_output_clock(i32 0)
ret void
}

LLVM IR (-O2):
define void @SendI2CNack() {
%1 = tail call i32 @I2CAL_output_data(i32 1)
%2 = tail call i32 @I2CAL_output_clock(i32 1)
%3 = tail call i32 @I2CAL_output_clock(i32 0)
ret void
}
void SimMainP$Scheduler$init(void) { SimSchedulerBasicP$Scheduler$init(); }


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

x86 assembly (clang, -O2):
<SimMainP$Scheduler$init>:
xor    %eax,%eax
jmp    1030 <SimSchedulerBasicP$Scheduler$init@plt>

LLVM IR (-O0):
define void @"SimMainP$Scheduler$init"() {
%1 = call i32 (...) @"SimSchedulerBasicP$Scheduler$init"()
ret void
}

LLVM IR (-O2):
define void @"SimMainP$Scheduler$init"() {
%1 = tail call i32 (...) @"SimSchedulerBasicP$Scheduler$init"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t p264_cpu_detect(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @p264_cpu_detect() {
ret i32 0
}
void X509_get_serialNumber(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_get_serialNumber() {
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t atomic_fetch_and_add64(uint64_t *addr,
                                                         uint64_t val) {
  asm volatile("lock; "
               "xadd"
               "q"
               " %0, %1"
               : "+a"(val), "+m"(*addr)
               :
               : "cc");
  return val;
}


x86 assembly (clang, -O0):
<atomic_fetch_and_add64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
lock xadd %rax,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_fetch_and_add64>:
mov    %rsi,%rax
lock xadd %rax,(%rdi)
ret

LLVM IR (-O0):
define i8* @atomic_fetch_and_add64(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %3
%7 = call i8* asm sideeffect "lock; xaddq $0, $1", "={ax},=*m,0,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %6, i8* %5, i8** elementtype(i8*) %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define i8* @atomic_fetch_and_add64(i8** %0, i8* %1) {
%3 = tail call i8* asm sideeffect "lock; xaddq $0, $1", "={ax},=*m,0,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %0, i8* %1, i8** elementtype(i8*) %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  unsigned int x = 1;
  printf("ENTER\n");
  char *ptr = (char *)&x;
  if (*ptr == 0)
    printf("BE\n");
  else
    printf("LE \n");
}


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   $0x1,-0x14(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1162 <main+0x52>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x5e>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [6 x i8] c"ENTER\00"
@str.3 = [4 x i8] c"LE \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pipe_multi_transform_stream();
int /*<<< orphan*/ pipe_transform_stream();
int /*<<< orphan*/ stderr;
int main(void) {
  fputs("\n\x1b[34m# [stream-pipe] "
        "pipe_transform_stream"
        "\x1b[0m\n",
        stderr);
  pipe_transform_stream();
  ;
  fputs("\n\x1b[34m# [stream-pipe] "
        "pipe_multi_transform_stream"
        "\x1b[0m\n",
        stderr);
  pipe_multi_transform_stream();
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1050 <pipe_transform_stream@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
lea    0xec6(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <pipe_multi_transform_stream@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%esi
lea    0xebf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1050 <pipe_transform_stream@plt>
mov    (%rbx),%esi
lea    0xedb(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <pipe_multi_transform_stream@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"\0A\1B[34m# [stream-pipe] pipe_transform_stream\1B[0m\0A\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"\0A\1B[34m# [stream-pipe] pipe_multi_transform_stream\1B[0m\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fputs(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @pipe_transform_stream()
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @pipe_multi_transform_stream()
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"\0A\1B[34m# [stream-pipe] pipe_transform_stream\1B[0m\0A\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"\0A\1B[34m# [stream-pipe] pipe_multi_transform_stream\1B[0m\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @pipe_transform_stream()
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @pipe_multi_transform_stream()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
scalar_t__ realloc(char *, int);
void reallocRadar6337483_4() {
  char *buf = malloc(100);
  char *buf2 = (char *)realloc(buf, 0x1000000);
  if (!buf2) {
    return;
  } else {
    free(buf2);
  }
}


x86 assembly (clang, -O0):
<reallocRadar6337483_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1000000,%esi
call   1050 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <reallocRadar6337483_4+0x38>
jmp    1171 <reallocRadar6337483_4+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocRadar6337483_4>:
push   %rax
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x1000000,%esi
call   1050 <realloc@plt>
test   %rax,%rax
je     1156 <reallocRadar6337483_4+0x26>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @reallocRadar6337483_4() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 100)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @realloc(i8* %4, i32 16777216)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %0
br label %13
10: ; preds = %0
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %9, %10
ret void
}

LLVM IR (-O2):
define void @reallocRadar6337483_4() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i64 @realloc(i8* %1, i32 16777216)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = inttoptr i64 %2 to i8*
%6 = tail call i32 @free(i8* %5)
br label %7
7: ; preds = %0, %4
ret void
}
rl_insert_close(count, invoking_key) int count, invoking_key;
{ return (rl_insert(count, invoking_key)); }


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

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

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

LLVM IR (-O2):
define i32 @rl_insert_close(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_insert to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatalerr(char *s) {
  fprintf(stderr, "Fatal Error: %s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<fatalerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatalerr>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Fatal Error: %s\0A\00"
define void @fatalerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Fatal Error: %s\0A\00"
define void @fatalerr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned h1(void) {
  static unsigned xx = 1;
  return xx;
}


x86 assembly (clang, -O0):
<h1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@h1.xx = internal global i32 1
define i32 @h1() {
%1 = load i32, i32* @h1.xx
ret i32 %1
}

LLVM IR (-O2):
define i32 @h1() {
ret i32 1
}
/* Variables and functions */
int triple(int);
int test(int a) { return triple(a) + 2; }


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

x86 assembly (clang, -O2):
<test>:
push   %rax
call   1030 <triple@plt>
add    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = tail call i32 @triple(i32 %0)
%3 = add nsw i32 %2, 2
ret i32 %3
}
__attribute__((no, noclone)) long long mul(long long x, long long y) {
  return x * y;
}


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

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

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

LLVM IR (-O2):
define i64 @mul(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void RB_XMLDB_Generate_Item_Begin(FILE *dest_doc) {
  (dest_doc = dest_doc);
  ;
}


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

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

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

LLVM IR (-O2):
define void @RB_XMLDB_Generate_Item_Begin(i32* nocapture %0) {
ret void
}
void enableWatchdog(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               65, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<enableWatchdog>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x41,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableWatchdog>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x41,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.enableWatchdog = [15 x i8] c"enableWatchdog\00"
define void @enableWatchdog() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.enableWatchdog, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.enableWatchdog = [15 x i8] c"enableWatchdog\00"
define void @enableWatchdog() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.enableWatchdog, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void om_text_close_title(FILE *fp) { (void)fp; }


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

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

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

LLVM IR (-O2):
define void @om_text_close_title(i32* nocapture %0) {
ret void
}
void *Function4Handle(void *a, void *b, void *c, void *d) { return a; }


x86 assembly (clang, -O0):
<Function4Handle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @Function4Handle(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @Function4Handle(i8* readnone returned %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i8* %0
}