xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void handle_error(const char *file, int lineno, const char *msg) {
  fprintf(stderr, "%s:%i %s\n", file, lineno, msg);
  ERR_print_errors_fp(stderr);
  exit(-1);
}


x86 assembly (clang, -O0):
<handle_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <ERR_print_errors_fp@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_error>:
push   %rbx
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <ERR_print_errors_fp@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"%s:%i %s\0A\00"
define void @handle_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @ERR_print_errors_fp(i32 %12)
%14 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s:%i %s\0A\00"
define void @handle_error(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%6 = load i32, i32* @stderr
%7 = tail call i32 @ERR_print_errors_fp(i32 %6)
%8 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int invert(int x, int p, int n) {
  int mask = ~((0x1 << 31) >> (31 - n));
  printf("mask is %d", mask);
  mask = mask << p;
  return x ^ mask;
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1f,%ecx
sub    -0xc(%rbp),%ecx
mov    $0x80000000,%eax
sar    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
mov    $0x1f,%cl
sub    %dl,%cl
mov    $0x7fffffff,%ebp
shr    %cl,%ebp
lea    0xed5(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebx,%ecx
shl    %cl,%ebp
xor    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"mask is %d\00"
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sub nsw i32 31, %8
%10 = ashr i32 -2147483648, %9
%11 = xor i32 %10, -1
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %7
%15 = load i32, i32* %5
%16 = shl i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %4
%18 = load i32, i32* %7
%19 = xor i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
@.str = [11 x i8] c"mask is %d\00"
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 31, %2
%5 = lshr i32 2147483647, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = shl i32 %5, %1
%8 = xor i32 %7, %0
ret i32 %8
}
void foo615(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo615(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int *array, int len) {
  for (size_t n = 0; n < len; n++) {
    printf("%d, ", array[n]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jae    1162 <print_array+0x52>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <print_array+0x17>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1157 <print_array+0x37>
mov    %rdi,%r15
movslq %esi,%r12
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ %13, %8 ], [ 0, %4 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
void __pthread_unregister_cancel_2(struct __ptcb *__cb) {
  __asm__ __volatile__("call __pthread_unregister_cancel"
                       :
                       : "a"(__cb)
                       : "ecx", "edx", "memory");
}


x86 assembly (clang, -O0):
<__pthread_unregister_cancel_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
call   1030 <__pthread_unregister_cancel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pthread_unregister_cancel_2>:
mov    %rdi,%rax
call   1030 <__pthread_unregister_cancel@plt>
ret

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

LLVM IR (-O2):
%struct.__ptcb = type opaque
define void @__pthread_unregister_cancel_2(%struct.__ptcb* %0) {
tail call void asm sideeffect "call __pthread_unregister_cancel", "{ax},~{ecx},~{edx},~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.__ptcb* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef size_t int32_t;

/* Variables and functions */
int32_t aeron_find_next_power_of_two(int32_t value) {
  value--;
  for (size_t i = 1; i < sizeof(value) * 8; i = i * 2) {
    value |= (value >> i);
  }
  return value + 1;
}


x86 assembly (clang, -O0):
<aeron_find_next_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpq   $0x40,-0x10(%rbp)
jae    114b <aeron_find_next_power_of_two+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    %cl,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <aeron_find_next_power_of_two+0x1c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_find_next_power_of_two>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @aeron_find_next_power_of_two(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
/* Variables and functions */
void v_ntoh(void *, int);
void v32_ntoh(void *p) { return v_ntoh(p, 4); }


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

x86 assembly (clang, -O2):
<v32_ntoh>:
mov    $0x4,%esi
jmp    1030 <v_ntoh@plt>

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

LLVM IR (-O2):
define void @v32_ntoh(i8* %0) {
tail call void @v_ntoh(i8* %0, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setgid(gid_t gid) {
  __set_errno(ENOSYS);
  return -1;
}


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

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setgid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setgid(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
void XkbAllocGeomOverlayKeys() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocGeomOverlayKeys() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void SSIEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000004))) |= 0x00000002;
}


x86 assembly (clang, -O0):
<SSIEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     $0x2,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIEnable>:
orq    $0x2,0x4(%rdi)
ret

LLVM IR (-O0):
define void @SSIEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 2
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @SSIEnable(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 2
store volatile i64 %5, i64* %3
ret void
}
double p5glove_dot(const double a[3], const double b[3]) {
  double res = 0.0;
  int i;
  for (i = 0; i < 3; i++)
    res += a[i] * b[i];
  return res;
}


x86 assembly (clang, -O0):
<p5glove_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    115f <p5glove_dot+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <p5glove_dot+0x1b>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<p5glove_dot>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  (%rsi),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x8(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @p5glove_dot(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
store i32 0, i32* %6
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load double*, double** %3
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = load double, double* %5
%22 = call double @llvm.fmuladd.f64(double %15, double %20, double %21)
store double %22, double* %5
br label %23
23: ; preds = %10
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %7
26: ; preds = %7
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @p5glove_dot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 0.000000e+00)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %5)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
scalar_t__ m_alloc(scalar_t__, int);
char *strcpy(char *, char *);
scalar_t__ strlen(char *);
char *s_clone(char *s) {
  return strcpy((char *)m_alloc(strlen(s) + 1, sizeof(char)), s);
}


x86 assembly (clang, -O0):
<s_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <m_alloc@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_clone>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <m_alloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @s_clone(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i64 @m_alloc(i64 %5, i32 1)
%7 = inttoptr i64 %6 to i8*
%8 = load i8*, i8** %2
%9 = call i8* @strcpy(i8* %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @s_clone(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @m_alloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
int parity(int v) {
  int i;
  int p = 1;
  for (i = 0; i < 8; i++)
    p ^= (1 & (v >> i));
  return p;
}


x86 assembly (clang, -O0):
<parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    113e <parity+0x3e>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <parity+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity>:
mov    %edi,%eax
shr    %eax
xor    %edi,%eax
mov    %edi,%ecx
shr    $0x2,%ecx
mov    %edi,%edx
shr    $0x3,%edx
xor    %ecx,%edx
xor    %eax,%edx
mov    %edi,%eax
shr    $0x4,%eax
mov    %edi,%ecx
shr    $0x5,%ecx
xor    %eax,%ecx
mov    %edi,%eax
shr    $0x6,%eax
xor    %ecx,%eax
xor    %edx,%eax
shr    $0x7,%edi
xor    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @parity(i32 %0) {
%2 = lshr i32 %0, 1
%3 = xor i32 %2, %0
%4 = lshr i32 %0, 2
%5 = xor i32 %3, %4
%6 = lshr i32 %0, 3
%7 = xor i32 %5, %6
%8 = lshr i32 %0, 4
%9 = xor i32 %7, %8
%10 = lshr i32 %0, 5
%11 = xor i32 %9, %10
%12 = lshr i32 %0, 6
%13 = xor i32 %11, %12
%14 = lshr i32 %0, 7
%15 = xor i32 %13, %14
%16 = and i32 %15, 1
%17 = xor i32 %16, 1
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ dec2bin(char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char operadores[200] = {0};
  dec2bin(operadores, 10, 5);
  printf("%s", operadores);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1040 <memset@plt>
lea    -0xd0(%rbp),%rdi
mov    $0xa,%esi
mov    $0x5,%edx
call   1050 <dec2bin@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0xc0(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x5,%edx
call   1040 <dec2bin@plt>
lea    0xe66(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = bitcast [200 x i8]* %1 to i8*
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%4 = call i32 @dec2bin(i8* %3, i32 10, i32 5)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @dec2bin(i8* %2, i32 10, i32 5)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int dxf_read_is_int(int type) {
  if (type >= 60 && type < 80) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<dxf_read_is_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3c,-0x8(%rbp)
jl     1127 <dxf_read_is_int+0x27>
cmpl   $0x50,-0x8(%rbp)
jge    1127 <dxf_read_is_int+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <dxf_read_is_int+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dxf_read_is_int>:
add    $0xffffffc4,%edi
xor    %eax,%eax
cmp    $0x14,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @dxf_read_is_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 60
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 80
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @dxf_read_is_int(i32 %0) {
%2 = add i32 %0, -60
%3 = icmp ult i32 %2, 20
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int hamt_str_hash(void *key) {
  unsigned int hash = 2166136261;
  for (; *(char *)key != 0; key++) {
    hash *= 16777619;
    ;
    hash ^= *(char *)key;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hamt_str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x811c9dc5,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1147 <hamt_str_hash+0x47>
imul   $0x1000193,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hamt_str_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamt_str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hamt_str_hash+0x27>
add    $0x1,%rdi
mov    $0x811c9dc5,%eax
nop
movsbl %cl,%ecx
imul   $0x1000193,%eax,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hamt_str_hash+0x10>
ret
mov    $0x811c9dc5,%eax
ret

LLVM IR (-O0):
define i32 @hamt_str_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 -2128831035, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = load i32, i32* %3
%11 = mul i32 %10, 16777619
store i32 %11, i32* %3
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i32, i32* %3
%16 = xor i32 %15, %14
store i32 %16, i32* %3
br label %17
17: ; preds = %9
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
br label %4
20: ; preds = %4
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @hamt_str_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ -2128831035, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 16777619
%10 = xor i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ -2128831035, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ Label_Printf(char *, char *);
void Label(char *label) {
  Label_Printf("\n"
               "%s:",
               label);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s:\00"
define void @Label(i8* %0) {
%2 = tail call i32 @Label_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void MozTagAnonymousMemory(const void *aPtr, size_t aLength, const char *aTag) {
}


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

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

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

LLVM IR (-O2):
define void @MozTagAnonymousMemory(i8* nocapture %0, i64 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io2w_read(int, unsigned char *);
unsigned char si475x_readStatus() {
  unsigned char status;
  io2w_read(1, &status);
  return status;
}


x86 assembly (clang, -O0):
<si475x_readStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    -0x1(%rbp),%rsi
call   1030 <io2w_read@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475x_readStatus>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
call   1030 <io2w_read@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @si475x_readStatus() {
%1 = alloca i8
%2 = call i32 @io2w_read(i32 1, i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @si475x_readStatus() {
%1 = alloca i8
%2 = call i32 @io2w_read(i32 1, i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ mcheck(int /*<<< orphan*/ *);
void turn_on_mcheck(void) { mcheck(NULL); }


x86 assembly (clang, -O0):
<turn_on_mcheck>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <mcheck@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_on_mcheck>:
xor    %edi,%edi
jmp    1030 <mcheck@plt>

LLVM IR (-O0):
define void @turn_on_mcheck() {
%1 = call i32 @mcheck(i32* null)
ret void
}

LLVM IR (-O2):
define void @turn_on_mcheck() {
%1 = tail call i32 @mcheck(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msg_print(char *);
void kicked_out() { msg_print("The owner kicks you out..."); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"The owner kicks you out...\00"
define void @kicked_out() {
%1 = call i32 @msg_print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"The owner kicks you out...\00"
define void @kicked_out() {
%1 = tail call i32 @msg_print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
void gtk_target_list_add_uri_targets() {}


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

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

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

LLVM IR (-O2):
define void @gtk_target_list_add_uri_targets() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test6_f(int **);
void test6_g() {
  int arr[10];
  test6_f(&arr);
}


x86 assembly (clang, -O0):
<test6_g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1030 <test6_f@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6_g>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <test6_f@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @test6_g() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i32**
%3 = call i32 @test6_f(i32** %2)
ret void
}

LLVM IR (-O2):
define void @test6_g() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = bitcast [10 x i32]* %1 to i32**
%4 = call i32 @test6_f(i32** %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_footer(int a) {
  printf("<script language=JavaScript>\n	"
         "document.forms[0].search.focus();\n	</script>\n");
  if (a)
    printf("<script language=JavaScript src=\"n.js\"></script>\n");
  printf("</body>\n</html>");
}


x86 assembly (clang, -O0):
<print_footer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
je     113d <print_footer+0x2d>
lea    0xf14(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_footer>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
je     113f <print_footer+0x1f>
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"<script language=JavaScript>\0A\09document.forms[0].search.focus();\0A\09</script>\0A\00"
@.str.1 = [50 x i8] c"<script language=JavaScript src=\22n.js\22></script>\0A\00"
@.str.2 = [16 x i8] c"</body>\0A</html>\00"
define void @print_footer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"</body>\0A</html>\00"
@str = [75 x i8] c"<script language=JavaScript>\0A\09document.forms[0].search.focus();\0A\09</script>\00"
@str.3 = [49 x i8] c"<script language=JavaScript src=\22n.js\22></script>\00"
define void @print_footer(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.3, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tavl_table {
  int dummy;
};

/* Variables and functions */
void **tavl_probe(struct tavl_table *, void *);
void *tavl_replace(struct tavl_table *table, void *item) {
  void **p = tavl_probe(table, item);
  if (p == NULL || *p == item)
    return NULL;
  else {
    void *r = *p;
    *p = item;
    return r;
  }
}


x86 assembly (clang, -O0):
<tavl_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <tavl_probe@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <tavl_replace+0x3d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    115a <tavl_replace+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    1178 <tavl_replace+0x68>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tavl_replace>:
push   %rbx
mov    %rsi,%rbx
call   1030 <tavl_probe@plt>
test   %rax,%rax
je     112e <tavl_replace+0x1e>
mov    %rax,%rcx
mov    (%rax),%rax
cmp    %rbx,%rax
je     112e <tavl_replace+0x1e>
mov    %rbx,(%rcx)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tavl_table = type { i32 }
define i8* @tavl_replace(%struct.tavl_table* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.tavl_table*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
store %struct.tavl_table* %0, %struct.tavl_table** %4
store i8* %1, i8** %5
%8 = load %struct.tavl_table*, %struct.tavl_table** %4
%9 = load i8*, i8** %5
%10 = call i8** @tavl_probe(%struct.tavl_table* %8, i8* %9)
store i8** %10, i8*** %6
%11 = load i8**, i8*** %6
%12 = icmp eq i8** %11, null
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = load i8*, i8** %5
%17 = icmp eq i8* %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13, %2
store i8* null, i8** %3
br label %25
19: ; preds = %13
%20 = load i8**, i8*** %6
%21 = load i8*, i8** %20
store i8* %21, i8** %7
%22 = load i8*, i8** %5
%23 = load i8**, i8*** %6
store i8* %22, i8** %23
%24 = load i8*, i8** %7
store i8* %24, i8** %3
br label %25
25: ; preds = %19, %18
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
%struct.tavl_table = type { i32 }
define i8* @tavl_replace(%struct.tavl_table* %0, i8* %1) {
%3 = tail call i8** @tavl_probe(%struct.tavl_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
br i1 %7, label %9, label %8
8: ; preds = %5
store i8* %1, i8** %3
br label %9
9: ; preds = %2, %5, %8
%10 = phi i8* [ %6, %8 ], [ null, %5 ], [ null, %2 ]
ret i8* %10
}
void sched_affinity_init(struct affinity *a) {}


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

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

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

LLVM IR (-O2):
%struct.affinity = type opaque
define void @sched_affinity_init(%struct.affinity* nocapture %0) {
ret void
}
/* Type definitions */
typedef void xfs_attr_sf_entry;

/* Variables and functions */
int xfs_attr_sf_entsize(void *);
struct xfs_attr_sf_entry *
xfs_attr_sf_nextentry(struct xfs_attr_sf_entry *sfep) {
  return (void *)sfep + xfs_attr_sf_entsize(sfep);
}


x86 assembly (clang, -O0):
<xfs_attr_sf_nextentry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xfs_attr_sf_entsize@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfs_attr_sf_nextentry>:
push   %rbx
mov    %rdi,%rbx
call   1030 <xfs_attr_sf_entsize@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.xfs_attr_sf_entry = type opaque
define %struct.xfs_attr_sf_entry* @xfs_attr_sf_nextentry(%struct.xfs_attr_sf_entry* %0) {
%2 = alloca %struct.xfs_attr_sf_entry*
store %struct.xfs_attr_sf_entry* %0, %struct.xfs_attr_sf_entry** %2
%3 = load %struct.xfs_attr_sf_entry*, %struct.xfs_attr_sf_entry** %2
%4 = bitcast %struct.xfs_attr_sf_entry* %3 to i8*
%5 = load %struct.xfs_attr_sf_entry*, %struct.xfs_attr_sf_entry** %2
%6 = bitcast %struct.xfs_attr_sf_entry* %5 to i8*
%7 = call i32 @xfs_attr_sf_entsize(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr i8, i8* %4, i64 %8
%10 = bitcast i8* %9 to %struct.xfs_attr_sf_entry*
ret %struct.xfs_attr_sf_entry* %10
}

LLVM IR (-O2):
%struct.xfs_attr_sf_entry = type opaque
define %struct.xfs_attr_sf_entry* @xfs_attr_sf_nextentry(%struct.xfs_attr_sf_entry* %0) {
%2 = bitcast %struct.xfs_attr_sf_entry* %0 to i8*
%3 = tail call i32 @xfs_attr_sf_entsize(i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr i8, i8* %2, i64 %4
%6 = bitcast i8* %5 to %struct.xfs_attr_sf_entry*
ret %struct.xfs_attr_sf_entry* %6
}
/* Type definitions */
struct Message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ player_attacks(struct Message *, int /*<<< orphan*/);
void cmd_melee(int pindex __attribute__((unused)), struct Message *msg) {
  player_attacks(msg, 0);
}


x86 assembly (clang, -O0):
<cmd_melee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <player_attacks@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_melee>:
mov    %rsi,%rdi
xor    %esi,%esi
jmp    1030 <player_attacks@plt>

LLVM IR (-O0):
%struct.Message = type { i32 }
define void @cmd_melee(i32 %0, %struct.Message* %1) {
%3 = alloca i32
%4 = alloca %struct.Message*
store i32 %0, i32* %3
store %struct.Message* %1, %struct.Message** %4
%5 = load %struct.Message*, %struct.Message** %4
%6 = call i32 @player_attacks(%struct.Message* %5, i32 0)
ret void
}

LLVM IR (-O2):
%struct.Message = type { i32 }
define void @cmd_melee(i32 %0, %struct.Message* %1) {
%3 = tail call i32 @player_attacks(%struct.Message* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
void fatal(char *str) {
  printf("FATAL: (%s)\n", str);
  while (1)
    sleep(10);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
jmp    113c <fatal+0x1c>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
jmp    1130 <fatal+0x10>

LLVM IR (-O0):
@.str = [13 x i8] c"FATAL: (%s)\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %1, %5
%6 = call i32 @sleep(i32 10)
br label %5
}

LLVM IR (-O2):
@.str = [13 x i8] c"FATAL: (%s)\0A\00"
define void @fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @sleep(i32 10)
br label %3
}
int myMax2(int *arr, int n) {}


x86 assembly (clang, -O0):
<myMax2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @myMax2(i32* nocapture readnone %0, i32 %1) {
ret i32 undef
}
int main(void) {
  int i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _printf_putll(long long, int, int, int /*<<< orphan*/, char,
                                 char *);
void putldec(long long i) {
  _printf_putll(i, 10, 1, 0, ' ', ((char *)0x3000000));
}


x86 assembly (clang, -O0):
<putldec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x20,%r8d
mov    $0x3000000,%r9d
call   1030 <_printf_putll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putldec>:
mov    $0x3000000,%r9d
mov    $0xa,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x20,%r8d
jmp    1030 <_printf_putll@plt>

LLVM IR (-O0):
define void @putldec(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_printf_putll(i64 %3, i32 10, i32 1, i32 0, i8 signext 32, i8* inttoptr (i64 50331648 to i8*))
ret void
}

LLVM IR (-O2):
define void @putldec(i64 %0) {
%2 = tail call i32 @_printf_putll(i64 %0, i32 10, i32 1, i32 0, i8 signext 32, i8* inttoptr (i64 50331648 to i8*))
ret void
}
/* Type definitions */
struct Deque {
  int dummy;
};

/* Variables and functions */
int deque_addFirst(struct Deque *, int, void *);
extern int deque_push(struct Deque *deque, int size, void *value) {
  return deque_addFirst(deque, size, value);
}


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

x86 assembly (clang, -O2):
<deque_push>:
jmp    1030 <deque_addFirst@plt>

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

LLVM IR (-O2):
%struct.Deque = type { i32 }
define i32 @deque_push(%struct.Deque* %0, i32 %1, i8* %2) {
%4 = tail call i32 @deque_addFirst(%struct.Deque* %0, i32 %1, i8* %2)
ret i32 %4
}
void build(const char *brstm_name, const char *dsp_names[], int dsp_count) {}


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

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

LLVM IR (-O0):
define void @build(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 @build(i8* nocapture %0, i8** nocapture %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void ecmgcw_set_cpnum(uint8_t *p_param, uint16_t i_cpnum) {
  p_param[0] = i_cpnum >> 8;
  p_param[1] = i_cpnum & 0xff;
}


x86 assembly (clang, -O0):
<ecmgcw_set_cpnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecmgcw_set_cpnum>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,(%rdi)
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @ecmgcw_set_cpnum(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = and i32 %9, 255
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @ecmgcw_set_cpnum(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = and i32 %1, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int __setxid(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setuid(uid_t uid) { return __setxid(23, uid, 0, 0); }


x86 assembly (clang, -O0):
<setuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x17,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <__setxid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setuid>:
mov    %edi,%esi
mov    $0x17,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <__setxid@plt>

LLVM IR (-O0):
define i32 @setuid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__setxid(i32 23, i32 %3, i32 0, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @setuid(i32 %0) {
%2 = tail call i32 @__setxid(i32 23, i32 %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ Malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *CloneString(char *str) {
  char *clone;
  if (str == NULL)
    return NULL;
  strcpy((clone = (char *)Malloc((strlen(str) + 1) * sizeof(char))), str);
  return clone;
}


x86 assembly (clang, -O0):
<CloneString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <CloneString+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1185 <CloneString+0x55>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <Malloc@plt>
mov    %rax,%rdi
mov    %rdi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CloneString>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1159 <CloneString+0x29>
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
call   1030 <Malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
jmp    115c <CloneString+0x2c>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @CloneString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i64 @Malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %4
%17 = load i8*, i8** %3
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %8, %7
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @CloneString(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @Malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ read(int, char *);
void get_input(char *c) { read(1, c); }


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

x86 assembly (clang, -O2):
<get_input>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define void @get_input(i8* %0) {
%2 = tail call i32 @read(i32 1, i8* %0)
ret void
}