xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t load_u32be(uint8_t *p) {
  return ((uint32_t)(p[0]) << 24) | ((uint32_t)(p[1]) << 16) |
         ((uint32_t)(p[2]) << 8) | ((uint32_t)(p[3]) << 0);
}


x86 assembly (clang, -O0):
<load_u32be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_u32be>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @load_u32be(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %0, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Usage: ./me matrixA.file matrixB.file out.file\n"); }


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Usage: ./me matrixA.file matrixB.file out.file\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"Usage: ./me matrixA.file matrixB.file out.file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret void
}
int int_shifts_are_arithemetic() {
  int num = -1;
  return !(num ^ (num >> 1));
}


x86 assembly (clang, -O0):
<int_shifts_are_arithemetic>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_shifts_are_arithemetic() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 1
%5 = xor i32 %2, %4
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @int_shifts_are_arithemetic() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int DelMenu(void) {
  char buffer[100];
  printf("1) Delete by name\n");
  printf("2) Delete by number\n");
  printf("\n");
  printf("Enter selection: ");
  scanf("%s", buffer);
  return buffer[0];
}


x86 assembly (clang, -O0):
<DelMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x70(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DelMenu>:
sub    $0x68,%rsp
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe93(%rip),%rdi
call   1050 <printf@plt>
lea    0xe99(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsbl (%rsp),%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"1) Delete by name\0A\00"
@.str.1 = [21 x i8] c"2) Delete by number\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [18 x i8] c"Enter selection: \00"
@.str.4 = [3 x i8] c"%s\00"
define i32 @DelMenu() {
%1 = alloca [100 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str.3 = [18 x i8] c"Enter selection: \00"
@.str.4 = [3 x i8] c"%s\00"
@str = [18 x i8] c"1) Delete by name\00"
@str.5 = [20 x i8] c"2) Delete by number\00"
define i32 @DelMenu() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
ret i32 %9
}
double lower_eq(double a, double b) { return a <= b; }


x86 assembly (clang, -O0):
<lower_eq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_eq>:
cmplesd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lower_eq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @lower_eq(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
int f(int x) {
  while (x > 0)
    x = x - 1;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111f <f+0x1f>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <f+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
test   %edi,%edi
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = call i32 @llvm.smin.i32(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
double abs(double);
double UC_11_5_2(double M_v_s_d, double M_v_sym_u_d) {
  return (abs(M_v_s_d) / M_v_sym_u_d);
}


x86 assembly (clang, -O0):
<UC_11_5_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <abs@plt>
divsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UC_11_5_2>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <abs@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @UC_11_5_2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @abs(double %5)
%7 = load double, double* %4
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @UC_11_5_2(double %0, double %1) {
%3 = tail call double @abs(double %0)
%4 = fdiv double %3, %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ zeninitinstargbits();
int /*<<< orphan*/ zeninitinstnames();
int /*<<< orphan*/ zeninitinsttabs();
void zeninitdata(void) {
  zeninitinstnames();
  zeninitinstargbits();
  zeninitinsttabs();
  return;
}


x86 assembly (clang, -O0):
<zeninitdata>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <zeninitinstnames@plt>
mov    $0x0,%al
call   1040 <zeninitinstargbits@plt>
mov    $0x0,%al
call   1050 <zeninitinsttabs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeninitdata>:
push   %rax
xor    %eax,%eax
call   1030 <zeninitinstnames@plt>
xor    %eax,%eax
call   1040 <zeninitinstargbits@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <zeninitinsttabs@plt>

LLVM IR (-O0):
define void @zeninitdata() {
%1 = call i32 (...) @zeninitinstnames()
%2 = call i32 (...) @zeninitinstargbits()
%3 = call i32 (...) @zeninitinsttabs()
ret void
}

LLVM IR (-O2):
define void @zeninitdata() {
%1 = tail call i32 (...) @zeninitinstnames()
%2 = tail call i32 (...) @zeninitinstargbits()
%3 = tail call i32 (...) @zeninitinsttabs()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ subwindow;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
unsigned long get_XKeyPressedEvent_subwindow(void *_p) {
  return (unsigned long)((XKeyPressedEvent *)_p)->subwindow;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XKeyPressedEvent_subwindow(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void lgtd_lifx_tagging_deallocate_tag(struct lgtd_lifx_tag *tag) { (void)tag; }


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

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

LLVM IR (-O0):
%struct.lgtd_lifx_tag = type opaque
define void @lgtd_lifx_tagging_deallocate_tag(%struct.lgtd_lifx_tag* %0) {
%2 = alloca %struct.lgtd_lifx_tag*
store %struct.lgtd_lifx_tag* %0, %struct.lgtd_lifx_tag** %2
%3 = load %struct.lgtd_lifx_tag*, %struct.lgtd_lifx_tag** %2
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_tag = type opaque
define void @lgtd_lifx_tagging_deallocate_tag(%struct.lgtd_lifx_tag* nocapture %0) {
ret void
}
/* Variables and functions */
float ANTweenTimingFunctionSineInOut(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionSineInOut(float time, float duration) {
  return ANTweenTimingFunctionSineInOut(time, 0, 1, duration);
}


x86 assembly (clang, -O0):
<ANTweenProgressTimingFunctionSineInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <ANTweenTimingFunctionSineInOut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionSineInOut>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionSineInOut@plt>

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

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionSineInOut(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionSineInOut(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Type definitions */
struct preprocess {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pp_define_internal(struct preprocess *, char const *,
                                      char const *, int /*<<< orphan*/);
void pp_define(struct preprocess *pp, const char *name, const char *str) {
  pp_define_internal(pp, name, str, 0);
}


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

x86 assembly (clang, -O2):
<pp_define>:
xor    %ecx,%ecx
jmp    1030 <pp_define_internal@plt>

LLVM IR (-O0):
%struct.preprocess = type { i32 }
define void @pp_define(%struct.preprocess* %0, i8* %1, i8* %2) {
%4 = alloca %struct.preprocess*
%5 = alloca i8*
%6 = alloca i8*
store %struct.preprocess* %0, %struct.preprocess** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.preprocess*, %struct.preprocess** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @pp_define_internal(%struct.preprocess* %7, i8* %8, i8* %9, i32 0)
ret void
}

LLVM IR (-O2):
%struct.preprocess = type { i32 }
define void @pp_define(%struct.preprocess* %0, i8* %1, i8* %2) {
%4 = tail call i32 @pp_define_internal(%struct.preprocess* %0, i8* %1, i8* %2, i32 0)
ret void
}
and() { call("ccand"); }


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

x86 assembly (clang, -O2):
<and>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccand\00"
define i32 @and() {
%1 = alloca i32
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @call to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccand\00"
define i32 @and() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @call to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int foo(int i, int j) { return i + 100 < j + 1000; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x64,%eax
mov    -0x8(%rbp),%ecx
add    $0x3e8,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    $0x384,%esi
xor    %eax,%eax
cmp    %edi,%esi
setg   %al
ret

LLVM IR (-O0):
define i32 @foo(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 = add nsw i32 %5, 100
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1000
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 900
%4 = icmp sgt i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void foo710() {}


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

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

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

LLVM IR (-O2):
define void @foo710() {
ret void
}
/* Variables and functions */
void *malloc(int);
void *internal(int n) { return malloc(n * 200); }


x86 assembly (clang, -O0):
<internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xc8,-0x4(%rbp),%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal>:
imul   $0xc8,%edi,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @internal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 200
%5 = call i8* @malloc(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @internal(i32 %0) {
%2 = mul nsw i32 %0, 200
%3 = tail call i8* @malloc(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((no)) void foo(int i1, int i2, int i3) {
  if (i3 != 3)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
je     1132 <foo+0x22>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x3,%edx
jne    1116 <foo+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 3
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %3
ret void
}
void final() {
  printf(__func__);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<final>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@__func__.final = [6 x i8] c"final\00"
define void @final() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.final, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_memdel(void **);
void ft_freechar2(char ***c2) {
  size_t i;
  i = 0;
  while ((*c2)[i])
    ft_memdel((void **)((*c2) + i++));
  ft_memdel((void **)c2);
}


x86 assembly (clang, -O0):
<ft_freechar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1161 <ft_freechar2+0x51>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <ft_memdel@plt>
jmp    1124 <ft_freechar2+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <ft_memdel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_freechar2>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
cmpq   $0x0,(%rdi)
je     1152 <ft_freechar2+0x42>
mov    $0x8,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    0x1(%rbx),%r12
call   1030 <ft_memdel@plt>
mov    (%r14),%rax
lea    (%rax,%rbx,8),%rdi
add    $0x8,%rdi
cmpq   $0x0,(%rax,%r15,1)
lea    0x8(%r15),%r15
mov    %r12,%rbx
jne    1130 <ft_freechar2+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <ft_memdel@plt>

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

LLVM IR (-O2):
define void @ft_freechar2(i8*** %0) {
%2 = load i8**, i8*** %0
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i8** [ %11, %5 ], [ %2, %1 ]
%7 = phi i64 [ %8, %5 ], [ 0, %1 ]
%8 = add i64 %7, 1
%9 = tail call i32 @ft_memdel(i8** %6)
%10 = load i8**, i8*** %0
%11 = getelementptr inbounds i8*, i8** %10, i64 %8
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = bitcast i8*** %0 to i8**
%16 = tail call i32 @ft_memdel(i8** %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void FCEUD_PrintError(char *s) { printf("Error %s", s); }


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

x86 assembly (clang, -O2):
<FCEUD_PrintError>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"Error %s\00"
define void @FCEUD_PrintError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_COMPILE;
int /*<<< orphan*/ do_one_wheel();
int /*<<< orphan*/ glEndList();
int /*<<< orphan*/ glNewList(int, int /*<<< orphan*/);
int /*<<< orphan*/ glRotatef(double, double, double, double);
void init_wheel(void) {
  glNewList(2, GL_COMPILE);
  do_one_wheel();
  glRotatef(180.0, 0.0, 1.0, 0.0);
  do_one_wheel();
  glRotatef(180.0, 0.0, 1.0, 0.0);
  glEndList();
}


x86 assembly (clang, -O0):
<init_wheel>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    $0x2,%edi
call   1040 <glNewList@plt>
mov    $0x0,%al
call   1030 <do_one_wheel@plt>
movsd  0xe9a(%rip),%xmm0
xorps  %xmm3,%xmm3
movsd  0xe97(%rip),%xmm2
movaps %xmm3,%xmm1
call   1050 <glRotatef@plt>
mov    $0x0,%al
call   1030 <do_one_wheel@plt>
movsd  0xe78(%rip),%xmm0
xorps  %xmm3,%xmm3
movsd  0xe75(%rip),%xmm2
movaps %xmm3,%xmm1
call   1050 <glRotatef@plt>
mov    $0x0,%al
call   1060 <glEndList@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_wheel>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
mov    $0x2,%edi
call   1040 <glNewList@plt>
xor    %eax,%eax
call   1030 <do_one_wheel@plt>
movsd  0xe9d(%rip),%xmm0
movsd  0xe9d(%rip),%xmm2
xorps  %xmm1,%xmm1
xorps  %xmm3,%xmm3
call   1050 <glRotatef@plt>
xor    %eax,%eax
call   1030 <do_one_wheel@plt>
xorps  %xmm1,%xmm1
xorps  %xmm3,%xmm3
movsd  0xe75(%rip),%xmm0
movsd  0xe75(%rip),%xmm2
call   1050 <glRotatef@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <glEndList@plt>

LLVM IR (-O0):
@GL_COMPILE = global i32 0
define void @init_wheel() {
%1 = load i32, i32* @GL_COMPILE
%2 = call i32 @glNewList(i32 2, i32 %1)
%3 = call i32 (...) @do_one_wheel()
%4 = call i32 @glRotatef(double 1.800000e+02, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%5 = call i32 (...) @do_one_wheel()
%6 = call i32 @glRotatef(double 1.800000e+02, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%7 = call i32 (...) @glEndList()
ret void
}

LLVM IR (-O2):
@GL_COMPILE = global i32 0
define void @init_wheel() {
%1 = load i32, i32* @GL_COMPILE
%2 = tail call i32 @glNewList(i32 2, i32 %1)
%3 = tail call i32 (...) @do_one_wheel()
%4 = tail call i32 @glRotatef(double 1.800000e+02, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%5 = tail call i32 (...) @do_one_wheel()
%6 = tail call i32 @glRotatef(double 1.800000e+02, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%7 = tail call i32 (...) @glEndList()
ret void
}
void replaceStars(char *comman) {
  int j = 0;
  while (comman[j] != '\0') {
    if (comman[j] == '*')
      comman[j] = ' ';
    j++;
  }
}


x86 assembly (clang, -O0):
<replaceStars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <replaceStars+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1145 <replaceStars+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <replaceStars+0xf>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @replaceStars(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 42, label %6
]
6: ; preds = %2
store i8 32, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret void
}
int dolby_dap_set_vspe_vdhe(int port_id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dolby_dap_set_vspe_vdhe(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bt(short);
short add(short a, short b) {
  bt(a);
  return a + b + 12;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <bt@plt>
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
add    $0xc,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
call   1030 <bt@plt>
lea    (%rbx,%r14,1),%eax
add    $0xc,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i16 @add(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = call i32 @bt(i16 signext %5)
%7 = load i16, i16* %3
%8 = sext i16 %7 to i32
%9 = load i16, i16* %4
%10 = sext i16 %9 to i32
%11 = add nsw i32 %8, %10
%12 = add nsw i32 %11, 12
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define signext i16 @add(i16 signext %0, i16 signext %1) {
%3 = tail call i32 @bt(i16 signext %0)
%4 = add i16 %0, 12
%5 = add i16 %4, %1
ret i16 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t mkmem(int base, int index, int off) {}


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

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

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

LLVM IR (-O2):
define i32 @mkmem(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
int sum(const a, const int *const b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
void XRayEndFrame(struct XRayTraceCapture *capture) {}


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

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

LLVM IR (-O0):
%struct.XRayTraceCapture = type opaque
define void @XRayEndFrame(%struct.XRayTraceCapture* %0) {
%2 = alloca %struct.XRayTraceCapture*
store %struct.XRayTraceCapture* %0, %struct.XRayTraceCapture** %2
ret void
}

LLVM IR (-O2):
%struct.XRayTraceCapture = type opaque
define void @XRayEndFrame(%struct.XRayTraceCapture* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Qt_setColor(char *, int, int, int, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void Qt_setColorTrace(char *widget, int r, int g, int b, int alpha, int trace) {
  char asc[80];
  (void)(widget);
  sprintf(asc, "color_%d", trace);
  Qt_setColor(asc, r, g, b, alpha);
}


x86 assembly (clang, -O0):
<Qt_setColorTrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <Qt_setColor@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qt_setColorTrace>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %esi,%ebp
lea    0xec3(%rip),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
mov    %r9d,%edx
call   1040 <sprintf@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <Qt_setColor@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"color_%d\00"
define void @Qt_setColorTrace(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [80 x i8]
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i8*, i8** %7
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%16 = load i32, i32* %12
%17 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = load i32, i32* %11
%23 = call i32 @Qt_setColor(i8* %18, i32 %19, i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"color_%d\00"
define void @Qt_setColorTrace(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca [80 x i8]
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%10 = call i32 @Qt_setColor(i8* %8, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
unsigned __lshrsi3(unsigned long a, int b) { return a >> b; }


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

x86 assembly (clang, -O2):
<__lshrsi3>:
mov    %esi,%ecx
mov    %rdi,%rax
shr    %cl,%rax
ret

LLVM IR (-O0):
define i32 @__lshrsi3(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = lshr i64 %5, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__lshrsi3(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = lshr i64 %0, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
void wait(void) { return; }


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

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

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

LLVM IR (-O2):
define void @wait() {
ret void
}
int u8_to_dbm(const int power) { return power > 63 ? power - 0x100 : power; }


x86 assembly (clang, -O0):
<u8_to_dbm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x3f,-0x4(%rbp)
jle    1121 <u8_to_dbm+0x21>
mov    -0x4(%rbp),%eax
sub    $0x100,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <u8_to_dbm+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_to_dbm>:
lea    -0x100(%rdi),%eax
cmp    $0x40,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @u8_to_dbm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 63
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 256
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @u8_to_dbm(i32 %0) {
%2 = icmp sgt i32 %0, 63
%3 = add nsw i32 %0, -256
%4 = select i1 %2, i32 %3, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/);
void closeall() {
  register int u;
  for (u = 10; u < 20;)
    close(u++);
}


x86 assembly (clang, -O0):
<closeall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    113e <closeall+0x2e>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1030 <close@plt>
jmp    111f <closeall+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeall>:
push   %rax
mov    $0xa,%edi
call   1030 <close@plt>
mov    $0xb,%edi
call   1030 <close@plt>
mov    $0xc,%edi
call   1030 <close@plt>
mov    $0xd,%edi
call   1030 <close@plt>
mov    $0xe,%edi
call   1030 <close@plt>
mov    $0xf,%edi
call   1030 <close@plt>
mov    $0x10,%edi
call   1030 <close@plt>
mov    $0x11,%edi
call   1030 <close@plt>
mov    $0x12,%edi
call   1030 <close@plt>
mov    $0x13,%edi
pop    %rax
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closeall() {
%1 = tail call i32 @close(i32 10)
%2 = tail call i32 @close(i32 11)
%3 = tail call i32 @close(i32 12)
%4 = tail call i32 @close(i32 13)
%5 = tail call i32 @close(i32 14)
%6 = tail call i32 @close(i32 15)
%7 = tail call i32 @close(i32 16)
%8 = tail call i32 @close(i32 17)
%9 = tail call i32 @close(i32 18)
%10 = tail call i32 @close(i32 19)
ret void
}
long int get_stat_atime_ns(struct stat const *st) { return 0; }


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i64 @get_stat_atime_ns(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
ret i64 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i64 @get_stat_atime_ns(%struct.stat* nocapture readnone %0) {
ret i64 0
}
int ft_nbrlen(int n) {
  int i;
  i = 1;
  if (n < 0)
    n *= -1;
  while (n > 9) {
    n /= 10;
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_nbrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <ft_nbrlen+0x1f>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <ft_nbrlen+0x24>
cmpl   $0x9,-0x4(%rbp)
jle    114a <ft_nbrlen+0x4a>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ft_nbrlen+0x24>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrlen>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    $0x1,%eax
cmp    $0xa,%ecx
jb     1134 <ft_nbrlen+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%edx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1120 <ft_nbrlen+0x20>
ret

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

LLVM IR (-O2):
define i32 @ft_nbrlen(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = icmp ugt i32 %2, 9
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %2, %1 ]
%7 = udiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = icmp ugt i32 %6, 99
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
char getch();
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ ungets(char *);
int main(void) {
  ungets("test");
  putchar(getch());
  putchar(getch());
  putchar(getch());
  putchar(getch());
  putchar(getch());
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <ungets@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <ungets@plt>
xor    %eax,%eax
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ungets(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call signext i8 (...) @getch()
%4 = call i32 @putchar(i8 signext %3)
%5 = call signext i8 (...) @getch()
%6 = call i32 @putchar(i8 signext %5)
%7 = call signext i8 (...) @getch()
%8 = call i32 @putchar(i8 signext %7)
%9 = call signext i8 (...) @getch()
%10 = call i32 @putchar(i8 signext %9)
%11 = call signext i8 (...) @getch()
%12 = call i32 @putchar(i8 signext %11)
%13 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = tail call i32 @ungets(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getch()
%3 = tail call i32 @putchar(i8 signext %2)
%4 = tail call signext i8 (...) @getch()
%5 = tail call i32 @putchar(i8 signext %4)
%6 = tail call signext i8 (...) @getch()
%7 = tail call i32 @putchar(i8 signext %6)
%8 = tail call signext i8 (...) @getch()
%9 = tail call i32 @putchar(i8 signext %8)
%10 = tail call signext i8 (...) @getch()
%11 = tail call i32 @putchar(i8 signext %10)
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
void __ipipe_early_client_setup(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_im_context_focus_out() {
ret void
}
/* Variables and functions */
scalar_t__ getchar();
int /*<<< orphan*/ isdigit(char);
char read() {
  char ch = 0;
  do {
    ch = (char)getchar();
  } while (!isdigit(ch));
  return ch;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <read+0xc>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rax,%rbx
movsbl %bl,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1130 <read+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @read() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %5, %0
%3 = call i64 (...) @getchar()
%4 = trunc i64 %3 to i8
store i8 %4, i8* %1
br label %5
5: ; preds = %2
%6 = load i8, i8* %1
%7 = call i32 @isdigit(i8 signext %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %2, label %10
10: ; preds = %5
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @read() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @getchar()
%3 = trunc i64 %2 to i8
%4 = tail call i32 @isdigit(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %1, label %6
6: ; preds = %1
%7 = trunc i64 %2 to i8
ret i8 %7
}
/* Type definitions */
struct host_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tcp_send_ack(int, struct host_info *, struct host_info *);
void tcp_keepalive_ack(int sockfd, struct host_info *tx_host,
                       struct host_info *rx_host) {
  printf("-------------------keep alive ack-------------------\n");
  tcp_send_ack(sockfd, tx_host, rx_host);
}


x86 assembly (clang, -O0):
<tcp_keepalive_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <tcp_send_ack@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_keepalive_ack>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <tcp_send_ack@plt>

LLVM IR (-O0):
%struct.host_info = type { i32 }
@.str = [54 x i8] c"-------------------keep alive ack-------------------\0A\00"
define void @tcp_keepalive_ack(i32 %0, %struct.host_info* %1, %struct.host_info* %2) {
%4 = alloca i32
%5 = alloca %struct.host_info*
%6 = alloca %struct.host_info*
store i32 %0, i32* %4
store %struct.host_info* %1, %struct.host_info** %5
store %struct.host_info* %2, %struct.host_info** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = load %struct.host_info*, %struct.host_info** %5
%10 = load %struct.host_info*, %struct.host_info** %6
%11 = call i32 @tcp_send_ack(i32 %8, %struct.host_info* %9, %struct.host_info* %10)
ret void
}

LLVM IR (-O2):
%struct.host_info = type { i32 }
@str = [53 x i8] c"-------------------keep alive ack-------------------\00"
define void @tcp_keepalive_ack(i32 %0, %struct.host_info* %1, %struct.host_info* %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @tcp_send_ack(i32 %0, %struct.host_info* %1, %struct.host_info* %2)
ret void
}
/* Variables and functions */
void *fopen(char const *, char *);
void *stdio_file_handler_open(const char *file_name) {
  return fopen(file_name, "w");
}


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

x86 assembly (clang, -O2):
<stdio_file_handler_open>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define i8* @stdio_file_handler_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i8* @stdio_file_handler_open(i8* nocapture %0) {
%2 = tail call i8* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}