xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ istty();
char *rdz_rd() { return istty() ? "[0;31m" : ""; }


x86 assembly (clang, -O0):
<rdz_rd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <istty@plt>
mov    %rax,%rdx
lea    0xee2(%rip),%rax
lea    0xed4(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdz_rd>:
push   %rax
xor    %eax,%eax
call   1030 <istty@plt>
test   %rax,%rax
lea    0xee5(%rip),%rcx
lea    0xed7(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;31m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @rdz_rd() {
%1 = call i64 (...) @istty()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;31m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @rdz_rd() {
%1 = tail call i64 (...) @istty()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
void _glfwPlatformEnableSystemKeys(void) {}


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

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

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

LLVM IR (-O2):
define void @_glfwPlatformEnableSystemKeys() {
ret void
}
void invalidate_page(void *va) {
  __asm__ volatile("invlpg (%0)" : : "r"(va) : "memory");
}


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

x86 assembly (clang, -O2):
<invalidate_page>:
invlpg (%rdi)
ret

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

LLVM IR (-O2):
define void @invalidate_page(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
void handle_LOST(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_LOST(i32 %0) {
ret void
}
void ff_hevc_put_hevc_uni_w_epel_h48_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h48_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atomic_cmpnswap(long volatile *, long, long);
long atomic_add(long volatile *ptr, long value) {
  long old = *ptr;
  while (!atomic_cmpnswap(ptr, old, old + value))
    old = *ptr;
  return old;
}


x86 assembly (clang, -O0):
<atomic_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x10(%rbp),%rdx
call   1030 <atomic_cmpnswap@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1155 <atomic_add+0x45>
jmp    1165 <atomic_add+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    112b <atomic_add+0x1b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    (%r15),%rbx
lea    (%rbx,%r14,1),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <atomic_cmpnswap@plt>
test   %eax,%eax
je     1120 <atomic_add+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @atomic_add(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i64, i64* %0
%5 = add nsw i64 %4, %1
%6 = tail call i32 @atomic_cmpnswap(i64* %0, i64 %4, i64 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %3
ret i64 %4
}
/* Type definitions */
typedef scalar_t__ uid_t;
struct passwd {
  scalar_t__ pw_uid;
};

/* Variables and functions */
int /*<<< orphan*/ endpwent();
struct passwd *getpwent();
struct passwd *getpwuid(uid_t uid) {
  struct passwd *pw;
  endpwent();
  while ((pw = getpwent()) != NULL && pw->pw_uid != uid) {
  }
  endpwent();
  return pw;
}


x86 assembly (clang, -O0):
<getpwuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <endpwent@plt>
mov    $0x0,%al
call   1030 <getpwent@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1161 <getpwuid+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1171 <getpwuid+0x51>
jmp    1176 <getpwuid+0x56>
jmp    1133 <getpwuid+0x13>
mov    $0x0,%al
call   1040 <endpwent@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpwuid>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <endpwent@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getpwent@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1144 <getpwuid+0x24>
cmp    %r14,(%rbx)
jne    1130 <getpwuid+0x10>
xor    %eax,%eax
call   1040 <endpwent@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.passwd = type { i64 }
define %struct.passwd* @getpwuid(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.passwd*
store i64 %0, i64* %2
%4 = call i32 (...) @endpwent()
br label %5
5: ; preds = %16, %1
%6 = call %struct.passwd* (...) @getpwent()
store %struct.passwd* %6, %struct.passwd** %3
%7 = icmp ne %struct.passwd* %6, null
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load %struct.passwd*, %struct.passwd** %3
%10 = getelementptr inbounds %struct.passwd, %struct.passwd* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = load i64, i64* %2
%13 = icmp ne i64 %11, %12
br label %14
14: ; preds = %8, %5
%15 = phi i1 [ false, %5 ], [ %13, %8 ]
br i1 %15, label %16, label %17
16: ; preds = %14
br label %5
17: ; preds = %14
%18 = call i32 (...) @endpwent()
%19 = load %struct.passwd*, %struct.passwd** %3
ret %struct.passwd* %19
}

LLVM IR (-O2):
%struct.passwd = type { i64 }
define %struct.passwd* @getpwuid(i64 %0) {
%2 = tail call i32 (...) @endpwent()
br label %3
3: ; preds = %6, %1
%4 = tail call %struct.passwd* (...) @getpwent()
%5 = icmp eq %struct.passwd* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %4, i64 0, i32 0
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %6
%11 = tail call i32 (...) @endpwent()
ret %struct.passwd* %4
}
/* Variables and functions */
int is_mnemonic_name(char *);
int is_operand_string(char *s) { return is_mnemonic_name(s); }


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

x86 assembly (clang, -O2):
<is_operand_string>:
jmp    1030 <is_mnemonic_name@plt>

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

LLVM IR (-O2):
define i32 @is_operand_string(i8* %0) {
%2 = tail call i32 @is_mnemonic_name(i8* %0)
ret i32 %2
}
void BN_add(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_add() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int titleToNumber(char *);
int main() {
  char a[100];
  scanf("%s", a);
  printf("%d\n", titleToNumber(a));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <titleToNumber@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @titleToNumber(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g();
int /*<<< orphan*/ printf(char *);
void f(void) {
  printf("f\n");
  g();
}


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"f\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @g()
ret void
}
void foo246() {}


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

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

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

LLVM IR (-O2):
define void @foo246() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef unsigned long long uint16_t;

/* Variables and functions */
uint16_t le_sget(const uint8_t *addr) {
  uint16_t val = 0;
  val += ((unsigned long long)(addr[1]) << ((1) * 8));
  val += ((unsigned long long)(addr[0]) << ((0) * 8));
  return val;
}


x86 assembly (clang, -O0):
<le_sget>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x8,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x0,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_sget>:
mov    0x8(%rdi),%rax
shl    $0x8,%rax
add    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @le_sget(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
store i64 0, i64* %3
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 1
%6 = load i64, i64* %5
%7 = shl i64 %6, 8
%8 = load i64, i64* %3
%9 = add i64 %8, %7
store i64 %9, i64* %3
%10 = load i64*, i64** %2
%11 = getelementptr inbounds i64, i64* %10, i64 0
%12 = load i64, i64* %11
%13 = shl i64 %12, 0
%14 = load i64, i64* %3
%15 = add i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @le_sget(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %2
%4 = shl i64 %3, 8
%5 = load i64, i64* %0
%6 = add i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  double account = 1000000.0;
  double rate = 0.08;
  double withdraw = 100000.0;
  int count = 0;
  while (account > 0) {
    account *= (1.0 + rate);
    account -= withdraw;
    count++;
  }
  printf("After %d years, Chuckie will empty his account.\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1197 <main+0x87>
movsd  0xeb1(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114d <main+0x3d>
mov    -0x24(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [49 x i8] c"After %d years, Chuckie will empty his account.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
store double 1.000000e+06, double* %2
store double 8.000000e-02, double* %3
store double 1.000000e+05, double* %4
store i32 0, i32* %5
br label %6
6: ; preds = %9, %0
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load double, double* %3
%11 = fadd double 1.000000e+00, %10
%12 = load double, double* %2
%13 = fmul double %12, %11
store double %13, double* %2
%14 = load double, double* %4
%15 = load double, double* %2
%16 = fsub double %15, %14
store double %16, double* %2
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load i32, i32* %5
%21 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"After %d years, Chuckie will empty his account.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 21)
ret i32 0
}
int campelo(int x) { return x + 13; }


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

x86 assembly (clang, -O2):
<campelo>:
lea    0xd(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @campelo(i32 %0) {
%2 = add nsw i32 %0, 13
ret i32 %2
}
/* Variables and functions */
float sin(float);
float foo(float x) { return sin(x); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define float @foo(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sin(float %3)
ret float %4
}

LLVM IR (-O2):
define float @foo(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
/* Variables and functions */
int EXIT_SUCCESS;
char *join(char const, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int join_wrapper(char **av) {
  const char sep = av[2][0];
  char *base = av[3];
  char *suffix = av[4];
  char *output;
  output = join(sep, base, suffix);
  printf("%s\n", output);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<join_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movsbl %al,%edi
call   1040 <join@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_wrapper>:
push   %rax
mov    0x10(%rdi),%rax
mov    0x18(%rdi),%rsi
movsbl (%rax),%eax
mov    0x20(%rdi),%rdx
mov    %eax,%edi
call   1040 <join@plt>
lea    0xec2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @join_wrapper(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %2
%7 = load i8**, i8*** %2
%8 = getelementptr inbounds i8*, i8** %7, i64 2
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
store i8 %11, i8* %3
%12 = load i8**, i8*** %2
%13 = getelementptr inbounds i8*, i8** %12, i64 3
%14 = load i8*, i8** %13
store i8* %14, i8** %4
%15 = load i8**, i8*** %2
%16 = getelementptr inbounds i8*, i8** %15, i64 4
%17 = load i8*, i8** %16
store i8* %17, i8** %5
%18 = load i8, i8* %3
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = call i8* @join(i8 signext %18, i8* %19, i8* %20)
store i8* %21, i8** %6
%22 = load i8*, i8** %6
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load i32, i32* @EXIT_SUCCESS
ret i32 %24
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @join_wrapper(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8*, i8** %0, i64 3
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %0, i64 4
%8 = load i8*, i8** %7
%9 = tail call i8* @join(i8 signext %4, i8* %6, i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Type definitions */
struct Hero {
  int dummy;
};
struct Ability {
  int dummy;
};

/* Variables and functions */
int Hero_checkAbilityRandom(struct Hero *, int);
int LaoAi_XieWuShi_check(struct Ability *self, struct Hero *attacker) {
  return (Hero_checkAbilityRandom(attacker, 25));
}


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

x86 assembly (clang, -O2):
<LaoAi_XieWuShi_check>:
mov    %rsi,%rdi
mov    $0x19,%esi
jmp    1030 <Hero_checkAbilityRandom@plt>

LLVM IR (-O0):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define i32 @LaoAi_XieWuShi_check(%struct.Ability* %0, %struct.Hero* %1) {
%3 = alloca %struct.Ability*
%4 = alloca %struct.Hero*
store %struct.Ability* %0, %struct.Ability** %3
store %struct.Hero* %1, %struct.Hero** %4
%5 = load %struct.Hero*, %struct.Hero** %4
%6 = call i32 @Hero_checkAbilityRandom(%struct.Hero* %5, i32 25)
ret i32 %6
}

LLVM IR (-O2):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define i32 @LaoAi_XieWuShi_check(%struct.Ability* nocapture readnone %0, %struct.Hero* %1) {
%3 = tail call i32 @Hero_checkAbilityRandom(%struct.Hero* %1, i32 25)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopenTex(char *, char *);
char isTexFileExists(char *file) {
  FILE *fl;
  fl = fopenTex(file, "rt");
  if (fl != NULL) {
    fclose(fl);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isTexFileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopenTex@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115d <isTexFileExists+0x3d>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movb   $0x1,-0x1(%rbp)
jmp    1161 <isTexFileExists+0x41>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isTexFileExists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopenTex@plt>
test   %rax,%rax
je     113e <isTexFileExists+0x1e>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rt\00"
define signext i8 @isTexFileExists(i8* %0) {
%2 = tail call i32* @fopenTex(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8 [ 1, %4 ], [ 0, %1 ]
ret i8 %7
}
void units_set_mode(unsigned *units, unsigned mode) {
  unsigned base = *units & ((1U << (8)) - 1);
  *units = base | mode;
}


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

x86 assembly (clang, -O2):
<units_set_mode>:
movzbl (%rdi),%eax
or     %esi,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @units_set_mode(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 255
%5 = or i32 %4, %1
store i32 %5, i32* %0
ret void
}
int mystrlen(const char *src) {
  int length = 0;
  while (*src) {
    ++length;
    ++src;
  }
  return length;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <mystrlen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <mystrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
cmpb   $0x0,(%rdi)
je     111c <mystrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mystrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Type definitions */
struct feed_prompt {
  int dummy;
};

/* Variables and functions */
char feed_prompt_set(struct feed_prompt *const, unsigned char const *const,
                     unsigned long const, unsigned int);
char feed_prompt_set1(struct feed_prompt *const p_prompt,
                      unsigned char const *const p_data,
                      unsigned long int const i_data_length) {
  return feed_prompt_set(p_prompt, p_data, i_data_length, 0u);
}


x86 assembly (clang, -O0):
<feed_prompt_set1>:
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 <feed_prompt_set@plt>
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.feed_prompt = type { i32 }
define signext i8 @feed_prompt_set1(%struct.feed_prompt* %0, i8* %1, i64 %2) {
%4 = tail call signext i8 @feed_prompt_set(%struct.feed_prompt* %0, i8* %1, i64 %2, i32 0)
ret i8 %4
}
/* Variables and functions */
double *calloc(size_t, int);
int /*<<< orphan*/ check_allocated_or_abort(double *);
double *allocate_real_vector(size_t n) {
  double *vector = calloc(n, sizeof(double));
  check_allocated_or_abort(vector);
  return vector;
}


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

x86 assembly (clang, -O2):
<allocate_real_vector>:
push   %rbx
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <check_allocated_or_abort@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define double* @allocate_real_vector(i64 %0) {
%2 = alloca i64
%3 = alloca double*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call double* @calloc(i64 %4, i32 8)
store double* %5, double** %3
%6 = load double*, double** %3
%7 = call i32 @check_allocated_or_abort(double* %6)
%8 = load double*, double** %3
ret double* %8
}

LLVM IR (-O2):
define double* @allocate_real_vector(i64 %0) {
%2 = tail call double* @calloc(i64 %0, i32 8)
%3 = tail call i32 @check_allocated_or_abort(double* %2)
ret double* %2
}
void wacom_i2c_init_firm_data(void) {}


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

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

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

LLVM IR (-O2):
define void @wacom_i2c_init_firm_data() {
ret void
}
void tor_strclear(char *s) {
  while (*s) {
    *s++ = '\0';
  }
}


x86 assembly (clang, -O0):
<tor_strclear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112c <tor_strclear+0x2c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    1108 <tor_strclear+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor_strclear>:
cmpb   $0x0,(%rdi)
je     111d <tor_strclear+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <tor_strclear+0x10>
ret

LLVM IR (-O0):
define void @tor_strclear(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
store i8 0, i8* %8
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @tor_strclear(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
int lower_one_mask(int n) {
  unsigned mask = ~0;
  int bits_of_int = sizeof(int) << 3;
  int right_shift = bits_of_int - n;
  mask = mask >> right_shift;
  return (int)mask;
}


x86 assembly (clang, -O0):
<lower_one_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_one_mask>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @lower_one_mask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
store i32 32, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = lshr i32 %9, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @lower_one_mask(i32 %0) {
%2 = sub nsw i32 32, %0
%3 = lshr i32 -1, %2
ret i32 %3
}
int get_len(unsigned char *c) {
  int len = 0;
  while (c[len] != '\0')
    len++;
  return len;
}


x86 assembly (clang, -O0):
<get_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <get_len+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <get_len+0x10>
ret

LLVM IR (-O0):
define i32 @get_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
double ft_atoi(char const *);
scalar_t__ ft_extract_decimal(char const *);
double ft_atod(const char *s) {
  double value;
  value = ft_atoi(s);
  value += ft_extract_decimal(s);
  return (value);
}


x86 assembly (clang, -O0):
<ft_atod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_atoi@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ft_extract_decimal@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_atod>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <ft_atoi@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <ft_extract_decimal@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ft_atod(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call double @ft_atoi(i8* %4)
store double %5, double* %3
%6 = load i8*, i8** %2
%7 = call i64 @ft_extract_decimal(i8* %6)
%8 = sitofp i64 %7 to double
%9 = load double, double* %3
%10 = fadd double %9, %8
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @ft_atod(i8* %0) {
%2 = tail call double @ft_atoi(i8* %0)
%3 = tail call i64 @ft_extract_decimal(i8* %0)
%4 = sitofp i64 %3 to double
%5 = fadd double %2, %4
ret double %5
}
__attribute__((optimize(3))) void __portable_avr_delay_cycles(unsigned long n) {
  do {
    asm volatile("" ::: "memory");
  } while (--n);
}


x86 assembly (clang, -O0):
<__portable_avr_delay_cycles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1108 <__portable_avr_delay_cycles+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__portable_avr_delay_cycles>:
add    $0xffffffffffffffff,%rdi
jne    1100 <__portable_avr_delay_cycles>
ret

LLVM IR (-O0):
define void @__portable_avr_delay_cycles(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %4, %1
br label %4
4: ; preds = %3
%5 = load i64, i64* %2
%6 = add i64 %5, -1
store i64 %6, i64* %2
%7 = icmp ne i64 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @__portable_avr_delay_cycles(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %4, %2 ]
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%4 = add i64 %3, -1
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
void ARGBShadeRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBShadeRow_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_draw_string() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_draw_string>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_draw_string>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_draw_string() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_draw_string() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct timeval *, int /*<<< orphan*/, int);
void iscsi_timer_clear(struct timeval *timer) {
  memset(timer, 0, sizeof(*timer));
}


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

x86 assembly (clang, -O2):
<iscsi_timer_clear>:
xor    %esi,%esi
mov    $0x4,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @iscsi_timer_clear(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @memset(%struct.timeval* %3, i32 0, i32 4)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @iscsi_timer_clear(%struct.timeval* %0) {
%2 = tail call i32 @memset(%struct.timeval* %0, i32 0, i32 4)
ret void
}
void fn_default_end(void) {}


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

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

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

LLVM IR (-O2):
define void @fn_default_end() {
ret void
}
/* Variables and functions */
int caps_flags();
int has_caps(int caps) { return caps == (caps_flags() & caps); }


x86 assembly (clang, -O0):
<has_caps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <caps_flags@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_caps>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <caps_flags@plt>
not    %eax
xor    %ecx,%ecx
test   %eax,%ebx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @has_caps(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @caps_flags()
%5 = load i32, i32* %2
%6 = and i32 %4, %5
%7 = icmp eq i32 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @has_caps(i32 %0) {
%2 = tail call i32 (...) @caps_flags()
%3 = and i32 %2, %0
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateIntClear(uint32_t ui32IntFlags) {

  ;
  (*((volatile uint32_t *)(0x400FC020))) |= ui32IntFlags;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x400fc020,%ecx
mov    (%rcx),%ecx
or     %eax,%ecx
mov    $0x400fc020,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntClear>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
or     %eax,0x400fc020
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateIntClear(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1074774048 to i32*)
%5 = or i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 1074774048 to i32*)
%6 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateIntClear(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1074774048 to i32*)
%5 = or i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 1074774048 to i32*)
%6 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int __is_protected_atpath(int, char const *, int /*<<< orphan*/);
int __is_protected_atentry(int dirfd, const char *path) {
  return __is_protected_atpath(dirfd, path, 0);
}


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

x86 assembly (clang, -O2):
<__is_protected_atentry>:
xor    %edx,%edx
jmp    1030 <__is_protected_atpath@plt>

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

LLVM IR (-O2):
define i32 @__is_protected_atentry(i32 %0, i8* %1) {
%3 = tail call i32 @__is_protected_atpath(i32 %0, i8* %1, i32 0)
ret i32 %3
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ charge_generic(struct battle_char *, struct battle_char *,
                                  int);
void charge3(struct battle_char *origin, struct battle_char *target) {
  charge_generic(origin, target, 3);
}


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

x86 assembly (clang, -O2):
<charge3>:
mov    $0x3,%edx
jmp    1030 <charge_generic@plt>

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

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @charge3(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i32 @charge_generic(%struct.battle_char* %0, %struct.battle_char* %1, i32 3)
ret void
}
void outportb(unsigned int port, unsigned char value) {
  __asm__ __volatile__("outb %%al,%%dx" ::"d"(port), "a"(value));
}


x86 assembly (clang, -O0):
<outportb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x5(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outportb(i32 %0, i8 zeroext %1) {
tail call void asm sideeffect "outb %al,%dx", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8 %1)
ret void
}
int Diff(int *P, int *Q) { return P - Q; }


x86 assembly (clang, -O0):
<Diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Diff>:
mov    %rdi,%rax
sub    %rsi,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i32 @Diff(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = ptrtoint i32* %5 to i64
%8 = ptrtoint i32* %6 to i64
%9 = sub i64 %7, %8
%10 = sdiv exact i64 %9, 4
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @Diff(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = sub i64 %3, %4
%6 = lshr exact i64 %5, 2
%7 = trunc i64 %6 to i32
ret i32 %7
}
void end() {}


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

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

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

LLVM IR (-O2):
define void @end() {
ret void
}
void __limat_vtxops_v3_interpolate(const void *self, const void *other,
                                   float blend, void *result) {}


x86 assembly (clang, -O0):
<__limat_vtxops_v3_interpolate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__limat_vtxops_v3_interpolate(i8* nocapture %0, i8* nocapture %1, float %2, i8* nocapture %3) {
ret void
}
void unused_internal_func1(void) {}


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

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

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

LLVM IR (-O2):
define void @unused_internal_func1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test4_g();
void test4_h(void) { test4_g(); }


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

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

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

LLVM IR (-O2):
define void @test4_h() {
%1 = tail call i32 (...) @test4_g()
ret void
}
const void void_fn2(void) {}


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

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

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

LLVM IR (-O2):
define void @void_fn2() {
ret void
}
/* Variables and functions */
int strlen(char *);
void strAppendChar(char *s, char c) {
  int len = strlen(s);
  s[len] = c;
  s[len + 1] = '\0';
}


x86 assembly (clang, -O0):
<strAppendChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strAppendChar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @strAppendChar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @strAppendChar(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %5
%6 = add nsw i32 %3, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
void scribe_forbid_uaccess(void) {}


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

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

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

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