xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isxdigit(char const);
int is_hex(const char *n) {
  int i;
  for (i = 0; n[i]; i++)
    if (!isxdigit(n[i]))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116e <is_hex+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%eax
jne    115b <is_hex+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1175 <is_hex+0x65>
jmp    1160 <is_hex+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <is_hex+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_hex+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isxdigit@plt>
test   %eax,%eax
je     1149 <is_hex+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_hex+0x20>
jmp    114b <is_hex+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_hex(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = tail call i32 @isxdigit(i8 signext %10)
%12 = icmp eq i32 %11, 0
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
int close_audio(int line) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @close_audio(i32 %0) {
ret i32 -1
}
void gtk_text_iter_get_child_anchor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_get_child_anchor() {
ret void
}
unsigned char rev8(unsigned char b) {
  return ((b * 0x80200802ULL) & 0x0884422110ULL) * 0x0101010101ULL >> 32;
}


x86 assembly (clang, -O0):
<rev8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movabs $0x80200802,%rcx
imul   %rcx,%rax
movabs $0x884422110,%rcx
and    %rcx,%rax
movabs $0x101010101,%rcx
imul   %rcx,%rax
shr    $0x20,%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev8>:
mov    %edi,%eax
mov    $0x80200802,%ecx
imul   %rax,%rcx
movabs $0x884422110,%rdx
and    %rcx,%rdx
movabs $0x101010101,%rax
imul   %rdx,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define zeroext i8 @rev8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = mul i64 %4, 2149582850
%6 = and i64 %5, 36578664720
%7 = mul i64 %6, 4311810305
%8 = lshr i64 %7, 32
%9 = trunc i64 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @rev8(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = mul nuw nsw i64 %2, 2149582850
%4 = and i64 %3, 36578664720
%5 = mul i64 %4, 4311810305
%6 = lshr i64 %5, 32
%7 = trunc i64 %6 to i8
ret i8 %7
}
int test_imm_DEint64_highword_reg(long long val) {
  return ((val >> 32) & (0xDE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DEint64_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, 222
%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_DEint64_highword_reg(i64 %0) {
%2 = and i64 %0, 953482739712
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void matrixTranspose() {}


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

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

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

LLVM IR (-O2):
define void @matrixTranspose() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abstract_text___Byte_native_byte_to_s___impl(unsigned char,
                                                                char *, long);
void core__abstract_text___Byte___native_byte_to_s(unsigned char self, char *p0,
                                                   long p1) {
  abstract_text___Byte_native_byte_to_s___impl(self, p0, p1);
RET_LABEL:;
}


x86 assembly (clang, -O0):
<core__abstract_text___Byte___native_byte_to_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movzbl %al,%edi
call   1030 <abstract_text___Byte_native_byte_to_s___impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core__abstract_text___Byte___native_byte_to_s>:
jmp    1030 <abstract_text___Byte_native_byte_to_s___impl@plt>

LLVM IR (-O0):
define void @core__abstract_text___Byte___native_byte_to_s(i8 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i64
store i8 %0, i8* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8, i8* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @abstract_text___Byte_native_byte_to_s___impl(i8 zeroext %7, i8* %8, i64 %9)
br label %11
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @core__abstract_text___Byte___native_byte_to_s(i8 zeroext %0, i8* %1, i64 %2) {
%4 = tail call i32 @abstract_text___Byte_native_byte_to_s___impl(i8 zeroext %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
double erf(double);
double erfc(double x) { return 1.0 - erf(x); }


x86 assembly (clang, -O0):
<erfc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <erf@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erfc>:
push   %rax
call   1030 <erf@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @erfc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @erf(double %3)
%5 = fsub double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @erfc(double %0) {
%2 = tail call double @erf(double %0)
%3 = fsub double 1.000000e+00, %2
ret double %3
}
/* Variables and functions */
int netd_getMyID();
int /*<<< orphan*/ printf(char *, int, char *);
void dumpMsg(char *msg) { printf("From %d, msg=%s\n", netd_getMyID(), msg); }


x86 assembly (clang, -O0):
<dumpMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <netd_getMyID@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpMsg>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <netd_getMyID@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"From %d, msg=%s\0A\00"
define void @dumpMsg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @netd_getMyID()
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"From %d, msg=%s\0A\00"
define void @dumpMsg(i8* %0) {
%2 = tail call i32 (...) @netd_getMyID()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tst_timespec_abs_diff(struct timespec, struct timespec);
long long tst_timespec_to_ms(int /*<<< orphan*/);
long long tst_timespec_abs_diff_ms(struct timespec t1, struct timespec t2) {
  return tst_timespec_to_ms(tst_timespec_abs_diff(t1, t2));
}


x86 assembly (clang, -O0):
<tst_timespec_abs_diff_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <tst_timespec_abs_diff@plt>
mov    %eax,%edi
call   1040 <tst_timespec_to_ms@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_timespec_abs_diff_ms>:
push   %rax
call   1030 <tst_timespec_abs_diff@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <tst_timespec_to_ms@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i64 @tst_timespec_abs_diff_ms(i32 %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @tst_timespec_abs_diff(i32 %8, i32 %10)
%12 = call i64 @tst_timespec_to_ms(i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @tst_timespec_abs_diff_ms(i32 %0, i32 %1) {
%3 = tail call i32 @tst_timespec_abs_diff(i32 %0, i32 %1)
%4 = tail call i64 @tst_timespec_to_ms(i32 %3)
ret i64 %4
}
void OnOpenCB0(const char *connectionID, const char *AccumulatedHeadersStr,
               int AccumulatedHeadersLen) {}


x86 assembly (clang, -O0):
<OnOpenCB0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @OnOpenCB0(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
__attribute__((always_)) void __clear_bit(int nr,
                                          volatile unsigned long *addr) {
  asm volatile("btr %1,%0" : "+m"(*(volatile long *)(addr)) : "Ir"(nr));
}


x86 assembly (clang, -O0):
<__clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btr    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clear_bit>:
btr    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @__clear_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btr $1,$0", "=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
/* Variables and functions */
long atol(char *);
char *getenv(char *);
void get_cant_keys(long *cant_keys) {
  char *env = getenv("CANT_KEYS");
  if (env != NULL) {
    *cant_keys = atol(env);
  } else {
    *cant_keys = 100000000;
  }
}


x86 assembly (clang, -O0):
<get_cant_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115f <get_cant_keys+0x3f>
mov    -0x10(%rbp),%rdi
call   1040 <atol@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    116a <get_cant_keys+0x4a>
mov    -0x8(%rbp),%rax
movq   $0x5f5e100,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cant_keys>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     113f <get_cant_keys+0x1f>
mov    %rax,%rdi
call   1040 <atol@plt>
jmp    1144 <get_cant_keys+0x24>
mov    $0x5f5e100,%eax
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"CANT_KEYS\00"
define void @get_cant_keys(i64* %0) {
%2 = alloca i64*
%3 = alloca i8*
store i64* %0, i64** %2
%4 = call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @atol(i8* %8)
%10 = load i64*, i64** %2
store i64 %9, i64* %10
br label %13
11: ; preds = %1
%12 = load i64*, i64** %2
store i64 100000000, i64* %12
br label %13
13: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"CANT_KEYS\00"
define void @get_cant_keys(i64* nocapture writeonly %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i64 @atol(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ %5, %4 ], [ 100000000, %1 ]
store i64 %7, i64* %0
ret void
}
void asm_setdisppage(char num) {
  asm volatile("movb $0x05,%%ah ; int $0x10" : "+a"(num));
}


x86 assembly (clang, -O0):
<asm_setdisppage>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    $0x5,%ah
int    $0x10
mov    %al,-0x1(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<asm_setdisppage>:
mov    %edi,%eax
mov    $0x5,%ah
int    $0x10
ret

LLVM IR (-O0):
define void @asm_setdisppage(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i8 asm sideeffect "movb $$0x05,%ah ; int $$0x10", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i8 %3)
store i8 %4, i8* %2
ret void
}

LLVM IR (-O2):
define void @asm_setdisppage(i8 signext %0) {
%2 = tail call i8 asm sideeffect "movb $$0x05,%ah ; int $$0x10", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i8 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setStackBottom(void *);
void initStackBottomWith(void *locals) { setStackBottom(locals); }


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

x86 assembly (clang, -O2):
<initStackBottomWith>:
jmp    1030 <setStackBottom@plt>

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

LLVM IR (-O2):
define void @initStackBottomWith(i8* %0) {
%2 = tail call i32 @setStackBottom(i8* %0)
ret void
}
/* Variables and functions */
int rand();
void initializeDoors(int *doors) {
  int x;
  for (x = 0; x < 3; x++) {
    doors[x] = 0;
  }
  doors[rand() % 3] = 1;
}


x86 assembly (clang, -O0):
<initializeDoors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    114a <initializeDoors+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <initializeDoors+0x13>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
movslq %edx,%rcx
movl   $0x1,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializeDoors>:
push   %rbx
mov    %rdi,%rbx
movl   $0x0,0x8(%rdi)
movq   $0x0,(%rdi)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cltq
movl   $0x1,(%rbx,%rax,4)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @initializeDoors(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 1, i32* %6
ret void
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  scanf("%d", &n);
  printf("%d", fun(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <fun@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fun(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCSPGRP;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int tcsetpgrp(int fd, pid_t pgrp_id) { return ioctl(fd, TIOCSPGRP, &pgrp_id); }


x86 assembly (clang, -O0):
<tcsetpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsetpgrp>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@TIOCSPGRP = global i32 0
define i32 @tcsetpgrp(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* @TIOCSPGRP
%7 = call i32 @ioctl(i32 %5, i32 %6, i32* %4)
ret i32 %7
}

LLVM IR (-O2):
@TIOCSPGRP = global i32 0
define i32 @tcsetpgrp(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @TIOCSPGRP
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ quick_sort_int(int *, int /*<<< orphan*/, int);
void quick_sort(int *unsorted, int r) { quick_sort_int(unsorted, 0, r); }


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

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

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = tail call i32 @quick_sort_int(i32* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printGoodbye() {
  printf("Goodbye!\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"Goodbye!\00"
define void @printGoodbye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 123;
  if (i > 0) {
    while (1) {
      if (i == 456)
        printf("1\n");
      i++;
    }
  }
  printf("2\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115c <main+0x4c>
jmp    1135 <main+0x25>
cmpl   $0x1c8,-0x8(%rbp)
jne    114e <main+0x3e>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <main+0x25>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x14d,%ebp
lea    0xee1(%rip),%rbx
nop
sub    $0x1,%ebp
jae    1120 <main+0x10>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@str = [2 x i8] c"1\00"
define i32 @main() {
br label %1
1: ; preds = %0, %6
%2 = phi i32 [ 123, %0 ], [ %7, %6 ]
%3 = icmp eq i32 %2, 456
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = add nuw nsw i32 %2, 1
br label %1
}
void L3FixSlashes(register char *Path) {
  for (; *Path; Path++)
    if (*Path == '\\')
      *Path = '/';
}


x86 assembly (clang, -O0):
<L3FixSlashes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <L3FixSlashes+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    112c <L3FixSlashes+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
jmp    1131 <L3FixSlashes+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <L3FixSlashes+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L3FixSlashes>:
jmp    1117 <L3FixSlashes+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x5c,%al
je     1110 <L3FixSlashes+0x10>
test   %al,%al
jne    1113 <L3FixSlashes+0x13>
ret

LLVM IR (-O0):
define void @L3FixSlashes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 92
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = load i8*, i8** %2
store i8 47, i8* %13
br label %14
14: ; preds = %12, %7
br label %15
15: ; preds = %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @L3FixSlashes(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 92, label %5
]
5: ; preds = %2
store i8 47, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
char *strndup(char const *, int);
void test_1(const char *s) { char *p = strndup(s, 42); }


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

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

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

LLVM IR (-O2):
define void @test_1(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void err(char *s) { fprintf(stderr, "%s!\n", s); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"%s!\0A\00"
define void @err(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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%s!\0A\00"
define void @err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int PHYSFS_isDirectory(char const *);
scalar_t__ strncmp(char const *, char *, int);
int BIND_PHYSFS_isArchive(const char *filename, int forWriting) {
  if (forWriting)
    return (0);
  if (strncmp(filename, "bind::/", 7))
    return (0);
  filename = filename + 6;
  return (PHYSFS_isDirectory(filename));
}


x86 assembly (clang, -O0):
<BIND_PHYSFS_isArchive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1145 <BIND_PHYSFS_isArchive+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1188 <BIND_PHYSFS_isArchive+0x68>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1170 <BIND_PHYSFS_isArchive+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1188 <BIND_PHYSFS_isArchive+0x68>
mov    -0x10(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <PHYSFS_isDirectory@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIND_PHYSFS_isArchive>:
push   %rbx
test   %esi,%esi
jne    113e <BIND_PHYSFS_isArchive+0x1e>
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1142 <BIND_PHYSFS_isArchive+0x22>
xor    %eax,%eax
pop    %rbx
ret
add    $0x6,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <PHYSFS_isDirectory@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"bind::/\00"
define i32 @BIND_PHYSFS_isArchive(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %19
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i64 @strncmp(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 0, i32* %3
br label %19
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 6
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = call i32 @PHYSFS_isDirectory(i8* %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %14, %13, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [8 x i8] c"bind::/\00"
define i32 @BIND_PHYSFS_isArchive(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 6
%9 = tail call i32 @PHYSFS_isDirectory(i8* %8)
br label %10
10: ; preds = %4, %2, %7
%11 = phi i32 [ %9, %7 ], [ 0, %2 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void PicBuf_to_Dummy() {
  fprintf(stderr, "Sorry - preview not supported here\n");
}


x86 assembly (clang, -O0):
<PicBuf_to_Dummy>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PicBuf_to_Dummy>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Sorry - preview not supported here\0A\00"
define void @PicBuf_to_Dummy() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Sorry - preview not supported here\0A\00"
define void @PicBuf_to_Dummy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void wrong_target_2(struct S *s) { abort(); }


x86 assembly (clang, -O0):
<wrong_target_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<wrong_target_2>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @wrong_target_2(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @wrong_target_2(%struct.S* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
int setsched_realtime(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setsched_realtime() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ target;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ readlink(char *, char *, int);
int /*<<< orphan*/ sscanf(char *, char *, int /*<<< orphan*/ *);
pid_t get_pid_from_proc_self() {
  char target[32];
  pid_t pid;
  readlink("/proc/self", target, sizeof(target));
  sscanf(target, "%d", &pid);
  return (pid_t)pid;
}


x86 assembly (clang, -O0):
<get_pid_from_proc_self>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rsi
lea    0xecd(%rip),%rdi
mov    $0x20,%edx
call   1030 <readlink@plt>
lea    -0x20(%rbp),%rdi
lea    0xec3(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pid_from_proc_self>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x20,%edx
call   1030 <readlink@plt>
lea    0xec6(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <sscanf@plt>
mov    0xc(%rsp),%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/proc/self\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_pid_from_proc_self() {
%1 = alloca [32 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%4 = call i32 @readlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i32 32)
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"/proc/self\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_pid_from_proc_self() {
%1 = alloca [32 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 @readlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i32 32)
%6 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
ret i32 %7
}
/* Variables and functions */
int getCoreCount();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("\t\t\tcores: %d\n", getCoreCount());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"\09\09\09cores: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getCoreCount()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
char *mystrdup(const char *in) {
  char *newp = strdup(in);
  if (!newp)
    error_exit_(
        1, 1,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/flok99/multitail/refs/heads/master/mem.c",
        __PRETTY_FUNCTION__, 50,
        "Failed to duplicate a string: out of memory?\n");
  return newp;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116d <mystrdup+0x4d>
mov    $0x1,%esi
lea    0xeb0(%rip),%rdx
lea    0xf2c(%rip),%rcx
mov    $0x32,%r8d
lea    0xf3c(%rip),%r9
mov    %esi,%edi
mov    $0x0,%al
call   1030 <error_exit_@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <mystrdup+0x3a>
lea    0xecb(%rip),%rdx
lea    0xf47(%rip),%rcx
lea    0xf5d(%rip),%r9
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x32,%r8d
xor    %eax,%eax
call   1030 <error_exit_@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/flok99/multitail/refs/heads/master/mem.c\00"
@__PRETTY_FUNCTION__.mystrdup = [29 x i8] c"char *mystrdup(const char *)\00"
@.str.1 = [46 x i8] c"Failed to duplicate a string: out of memory?\0A\00"
define i8* @mystrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (i32, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @error_exit_ to i32 (i32, i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i32 1, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__PRETTY_FUNCTION__.mystrdup, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/flok99/multitail/refs/heads/master/mem.c\00"
@__PRETTY_FUNCTION__.mystrdup = [29 x i8] c"char *mystrdup(const char *)\00"
@.str.1 = [46 x i8] c"Failed to duplicate a string: out of memory?\0A\00"
define i8* @mystrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i32, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @error_exit_ to i32 (i32, i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i32 1, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__PRETTY_FUNCTION__.mystrdup, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void foo_2_1_2_2_2_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_2_2_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stress_set_memcpy_method(char *);
void stress_memcpy_set_default(void) { stress_set_memcpy_method("libc"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"libc\00"
define void @stress_memcpy_set_default() {
%1 = tail call i32 @stress_set_memcpy_method(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int width;
};
typedef TYPE_1__ XExposeEvent;

/* Variables and functions */
void set_XExposeEvent_width(void *_p, int _v) {
  ((XExposeEvent *)_p)->width = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XExposeEvent_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcsncmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void uninitvar_wcsncmp(wchar_t *Ct, wchar_t *S, size_t N) {
  wchar_t *ct;
  wchar_t *s;
  size_t n1, n2;
  (void)wcsncmp(ct, s, n1);
  (void)wcsncmp(ct, S, N);
  (void)wcsncmp(Ct, s, N);
  (void)wcsncmp(Ct, S, n2);
  (void)wcsncmp(Ct, S, N);
}


x86 assembly (clang, -O0):
<uninitvar_wcsncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <wcsncmp@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wcsncmp@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wcsncmp@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1030 <wcsncmp@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wcsncmp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wcsncmp>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <wcsncmp@plt>
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <wcsncmp@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <wcsncmp@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <wcsncmp@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <wcsncmp@plt>

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

LLVM IR (-O2):
define void @uninitvar_wcsncmp(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @wcsncmp(i32* undef, i32* undef, i64 undef)
%5 = tail call i32 @wcsncmp(i32* undef, i32* %1, i64 %2)
%6 = tail call i32 @wcsncmp(i32* %0, i32* undef, i64 %2)
%7 = tail call i32 @wcsncmp(i32* %0, i32* %1, i64 undef)
%8 = tail call i32 @wcsncmp(i32* %0, i32* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CLEAR_PRINTS();
int /*<<< orphan*/ PRINT_STRING_WITH_LITERAL_STRING(char *, char *, int, int);
void print_long(char *text) {
  CLEAR_PRINTS();
  PRINT_STRING_WITH_LITERAL_STRING("string", text, 6000, 1);
  return;
}


x86 assembly (clang, -O0):
<print_long>:
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    $0x1770,%edx
mov    $0x1,%ecx
call   1030 <PRINT_STRING_WITH_LITERAL_STRING@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_long>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <CLEAR_PRINTS@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1770,%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_long(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 6000, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"string\00"
define void @print_long(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 6000, i32 1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ nop();
void nop_sec(void) {
  for (uint32_t i = 0; i <= 291783; i++) {
    nop();
  }
}


x86 assembly (clang, -O0):
<nop_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x473c7,-0x4(%rbp)
jg     1141 <nop_sec+0x31>
mov    $0x0,%al
call   1030 <nop@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <nop_sec+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nop_sec>:
push   %rbx
mov    $0x473c8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <nop@plt>
add    $0xffffffff,%ebx
jne    1120 <nop_sec+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @nop_sec() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 291783
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @nop()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @nop_sec() {
br label %2
1: ; preds = %2
ret void
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @nop()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 291784
br i1 %6, label %1, label %2
}
void gtk_check_menu_item_set_draw_as_radio() {}


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

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

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

LLVM IR (-O2):
define void @gtk_check_menu_item_set_draw_as_radio() {
ret void
}