xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int streamtoaccept(int, int /*<<< orphan*/);
int unixtoaccept(int lsock, uint32_t msecto) {
  return streamtoaccept(lsock, msecto);
}


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

x86 assembly (clang, -O2):
<unixtoaccept>:
jmp    1030 <streamtoaccept@plt>

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

LLVM IR (-O2):
define i32 @unixtoaccept(i32 %0, i32 %1) {
%3 = tail call i32 @streamtoaccept(i32 %0, i32 %1)
ret i32 %3
}
char f2a(char **x) { return **x; }


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

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

LLVM IR (-O0):
define signext i8 @f2a(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @f2a(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
ret i8 %3
}
void tdefault_log_command(struct target_ops *self, const char *arg1) {}


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

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

LLVM IR (-O0):
%struct.target_ops = type opaque
define void @tdefault_log_command(%struct.target_ops* %0, i8* %1) {
%3 = alloca %struct.target_ops*
%4 = alloca i8*
store %struct.target_ops* %0, %struct.target_ops** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.target_ops = type opaque
define void @tdefault_log_command(%struct.target_ops* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
unsigned int executeHandleMessage(void *, char *, int);
unsigned int retractFact(void *handle, char *message) {
  return executeHandleMessage(handle, message, 7);
}


x86 assembly (clang, -O0):
<retractFact>:
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    $0x7,%edx
call   1030 <executeHandleMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retractFact>:
mov    $0x7,%edx
jmp    1030 <executeHandleMessage@plt>

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

LLVM IR (-O2):
define i32 @retractFact(i8* %0, i8* %1) {
%3 = tail call i32 @executeHandleMessage(i8* %0, i8* %1, i32 7)
ret i32 %3
}
/* Variables and functions */
int rand();
int get_random_number() {
  int random_number = rand() % 100 + 1;
  return random_number;
}


x86 assembly (clang, -O0):
<get_random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_number>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_random_number() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_random_number() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
int /*<<< orphan*/ is_asymmetric_signature(struct item *);
void check_is_asymmetric_signature(struct item *item) {
  if (!is_asymmetric_signature(item))
    abort_crypto_lib("Presented item is not an asymmetric signature item");
}


x86 assembly (clang, -O0):
<check_is_asymmetric_signature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_asymmetric_signature@plt>
cmp    $0x0,%eax
jne    114a <check_is_asymmetric_signature+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_is_asymmetric_signature>:
push   %rax
call   1030 <is_asymmetric_signature@plt>
test   %eax,%eax
je     112c <check_is_asymmetric_signature+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <abort_crypto_lib@plt>

LLVM IR (-O0):
%struct.item = type { i32 }
@.str = [51 x i8] c"Presented item is not an asymmetric signature item\00"
define void @check_is_asymmetric_signature(%struct.item* %0) {
%2 = alloca %struct.item*
store %struct.item* %0, %struct.item** %2
%3 = load %struct.item*, %struct.item** %2
%4 = call i32 @is_asymmetric_signature(%struct.item* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.item = type { i32 }
@.str = [51 x i8] c"Presented item is not an asymmetric signature item\00"
define void @check_is_asymmetric_signature(%struct.item* %0) {
%2 = tail call i32 @is_asymmetric_signature(%struct.item* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int kBuildProtectionDefaultDepth(void) { return 2; }


x86 assembly (clang, -O0):
<kBuildProtectionDefaultDepth>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @kBuildProtectionDefaultDepth() {
ret i32 2
}

LLVM IR (-O2):
define i32 @kBuildProtectionDefaultDepth() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ inicializarSemilla();
int rand();
int tirar(int caras) {
  inicializarSemilla();
  return ((rand() % caras) + 1);
}


x86 assembly (clang, -O0):
<tirar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <inicializarSemilla@plt>
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tirar>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <inicializarSemilla@plt>
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tirar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @inicializarSemilla()
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @tirar(i32 %0) {
%2 = tail call i32 (...) @inicializarSemilla()
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, %0
%5 = add nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[+] start\n");
  fun(1);
  printf("[+] end\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"[+] start\0A\00"
@.str.1 = [9 x i8] c"[+] end\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @fun(i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"[+] start\00"
@str.2 = [8 x i8] c"[+] end\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @fun(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
int startsWith(const char *str, const char *prefix) {
  size_t lenpre = strlen(prefix), lenstr = strlen(str);
  return lenstr < lenpre ? 0 : strncmp(prefix, str, lenpre) == 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <startsWith+0x42>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1182 <startsWith+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jb     1161 <startsWith+0x41>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = load i64, i64* %5
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
br label %22
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = load i64, i64* %5
%19 = call i64 @strncmp(i8* %16, i8* %17, i64 %18)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %15, %14
%23 = phi i32 [ 0, %14 ], [ %21, %15 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %1, i8* %0, i64 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ shmctl(long, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ shmdt(char *);
void detached_shm(long shmID, char *buffer) {
  shmdt(buffer);
  shmctl(shmID, IPC_RMID, 0);
}


x86 assembly (clang, -O0):
<detached_shm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <shmdt@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <shmctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detached_shm>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <shmdt@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1040 <shmctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define void @detached_shm(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @shmdt(i8* %5)
%7 = load i64, i64* %3
%8 = load i32, i32* @IPC_RMID
%9 = call i32 @shmctl(i64 %7, i32 %8, i32 0)
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define void @detached_shm(i64 %0, i8* %1) {
%3 = tail call i32 @shmdt(i8* %1)
%4 = load i32, i32* @IPC_RMID
%5 = tail call i32 @shmctl(i64 %0, i32 %4, i32 0)
ret void
}
void XcmsStoreColor() {}


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

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

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

LLVM IR (-O2):
define void @XcmsStoreColor() {
ret void
}
__attribute__((always_)) const long double xrintl(long double x) {
  return x < 0 ? (int)(x - 0.5) : (int)(x + 0.5);
}


x86 assembly (clang, -O0):
<xrintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    114d <xrintl+0x4d>
jmp    111e <xrintl+0x1e>
fldt   -0x10(%rbp)
flds   0xedd(%rip)
faddp  %st,%st(1)
fnstcw -0x1e(%rbp)
movzwl -0x1e(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x20(%rbp)
fldcw  -0x20(%rbp)
fistpl -0x18(%rbp)
fldcw  -0x1e(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    1177 <xrintl+0x77>
fldt   -0x10(%rbp)
flds   0xeaa(%rip)
faddp  %st,%st(1)
fnstcw -0x22(%rbp)
movzwl -0x22(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x24(%rbp)
fldcw  -0x24(%rbp)
fistpl -0x14(%rbp)
fldcw  -0x22(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x1c(%rbp)
fildl  -0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrintl>:
fldt   0x8(%rsp)
fldz
xor    %eax,%eax
fucomip %st(1),%st
seta   %al
shl    $0x4,%rax
lea    0xee8(%rip),%rcx
fldt   (%rax,%rcx,1)
faddp  %st,%st(1)
fnstcw -0xc(%rsp)
movzwl -0xc(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0xa(%rsp)
fldcw  -0xa(%rsp)
fistpl -0x8(%rsp)
fldcw  -0xc(%rsp)
mov    -0x8(%rsp),%eax
mov    %eax,-0x4(%rsp)
fildl  -0x4(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @xrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp olt x86_fp80 %3, 0xK00000000000000000000
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load x86_fp80, x86_fp80* %2
%7 = fsub x86_fp80 %6, 0xK3FFE8000000000000000
%8 = fptosi x86_fp80 %7 to i32
br label %13
9: ; preds = %1
%10 = load x86_fp80, x86_fp80* %2
%11 = fadd x86_fp80 %10, 0xK3FFE8000000000000000
%12 = fptosi x86_fp80 %11 to i32
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
%15 = sitofp i32 %14 to x86_fp80
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @xrintl(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%3 = select i1 %2, x86_fp80 0xKBFFE8000000000000000, x86_fp80 0xK3FFE8000000000000000
%4 = fadd x86_fp80 %3, %0
%5 = fptosi x86_fp80 %4 to i32
%6 = sitofp i32 %5 to x86_fp80
ret x86_fp80 %6
}
int open_descriptor_succeeded(int descriptor) { return descriptor >= 0; }


x86 assembly (clang, -O0):
<open_descriptor_succeeded>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_descriptor_succeeded>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @open_descriptor_succeeded(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @open_descriptor_succeeded(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__8__IO__clr();
void HplCC2420SpiP__SS__clr(void) { HplAtm128GeneralIOPinP__8__IO__clr(); }


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

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

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

LLVM IR (-O2):
define void @HplCC2420SpiP__SS__clr() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__8__IO__clr()
ret void
}
int bsr32(int x) {
  int b = -1;
  asm("bsrl %1,%0" : "+r"(b) : "rm"(x));
  return b + 1;
}


x86 assembly (clang, -O0):
<bsr32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    %ecx,-0xc(%rbp)
bsr    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsr32>:
mov    %edi,-0x4(%rsp)
mov    $0xffffffff,%eax
bsr    -0x4(%rsp),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bsr32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = call i32 asm "bsrl $1,$0", "=r,rm,0,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @bsr32(i32 %0) {
%2 = tail call i32 asm "bsrl $1,$0", "=r,rm,0,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 -1)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ perrordie(char *);
void safe_fgets(char *m, int size, FILE *f) {
  if (fgets(m, size, f) == NULL && !feof(f))
    perrordie("fgets");
}


x86 assembly (clang, -O0):
<safe_fgets>:
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 <fgets@plt>
cmp    $0x0,%rax
jne    117b <safe_fgets+0x4b>
mov    -0x18(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%eax
jne    117b <safe_fgets+0x4b>
lea    0xe8a(%rip),%rdi
call   1050 <perrordie@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fgets>:
push   %rbx
mov    %rdx,%rbx
call   1030 <fgets@plt>
test   %rax,%rax
jne    114a <safe_fgets+0x1a>
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %eax,%eax
je     114c <safe_fgets+0x1c>
pop    %rbx
ret
lea    0xead(%rip),%rdi
pop    %rbx
jmp    1050 <perrordie@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"fgets\00"
define void @safe_fgets(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i32 @feof(i32* %2)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @perrordie(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6, %3
ret void
}
void write_eam_punishments(double *force) {}


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

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

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

LLVM IR (-O2):
define void @write_eam_punishments(double* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int path[]) {
  for (int i = 0; i < 5; i++) {
    printf(" %d", path[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1152 <print+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee0(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x10(%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @print(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds i32, i32* %0, i64 4
%14 = load i32, i32* %13
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}
int res_query(const char *dname, int class, int type, unsigned char *answer,
              int anslen) {
  return -1;
}


x86 assembly (clang, -O0):
<res_query>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @res_query(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 -1
}

LLVM IR (-O2):
define i32 @res_query(i8* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
ret i32 -1
}
int absolute(int x) {
  if (x < 0)
    return -x;
  return x;
}


x86 assembly (clang, -O0):
<absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <absolute+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <absolute+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absolute(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void optimize_block_alpha_dxt3(unsigned char *bitstring,
                               unsigned char *alpha_values) {
  uint64_t alpha_pixels = 0;
  for (int i = 0; i < 16; i++) {
    unsigned int alpha_pixel = ((unsigned int)alpha_values[i] * 15 + 8) / 255;
    alpha_pixels |= (uint64_t)alpha_pixel << (i * 4);
  }
  *(uint64_t *)&bitstring[0] = alpha_pixels;
}


x86 assembly (clang, -O0):
<optimize_block_alpha_dxt3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x10,-0x18(%rbp)
jge    1161 <optimize_block_alpha_dxt3+0x61>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
imul   $0xf,%eax,%eax
add    $0x8,%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x2,%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111a <optimize_block_alpha_dxt3+0x1a>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @optimize_block_alpha_dxt3(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %27, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 16
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = mul i32 %17, 15
%19 = add i32 %18, 8
%20 = udiv i32 %19, 255
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = mul nsw i32 %22, 4
%24 = shl i32 %21, %23
%25 = load i32, i32* %5
%26 = or i32 %25, %24
store i32 %26, i32* %5
br label %27
27: ; preds = %11
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %8
30: ; preds = %8
%31 = load i32, i32* %5
%32 = load i8*, i8** %3
%33 = getelementptr inbounds i8, i8* %32, i64 0
%34 = bitcast i8* %33 to i32*
store i32 %31, i32* %34
ret void
}

LLVM IR (-O2):
define void @optimize_block_alpha_dxt3(i8* nocapture writeonly %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ mem_copy_vect2qword_big(int /*<<< orphan*/ *,
                                           unsigned char const *);
uint64_t arch_mem_copy_vect2qword_big(uint64_t *qword, const unsigned char *v) {
  return mem_copy_vect2qword_big(qword, v);
}


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

x86 assembly (clang, -O2):
<arch_mem_copy_vect2qword_big>:
jmp    1030 <mem_copy_vect2qword_big@plt>

LLVM IR (-O0):
define i32 @arch_mem_copy_vect2qword_big(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 @mem_copy_vect2qword_big(i32* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @arch_mem_copy_vect2qword_big(i32* %0, i8* %1) {
%3 = tail call i32 @mem_copy_vect2qword_big(i32* %0, i8* %1)
ret i32 %3
}
int test_imm_40int8_reg(signed char val) {
  return ((val) & (-0x40 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_40int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffc0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_40int8_reg>:
cmp    $0x40,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_40int8_reg(i8 signext %0) {
%2 = icmp ult i8 %0, 64
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  volatile int modified;
  char buffer[64];
  modified = 0;
  gets(buffer);
  if (modified != 0) {
    printf("you have changed the 'modified' variable\n");
  } else {
    printf("Try again?\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <gets@plt>
mov    -0x14(%rbp),%eax
cmp    $0x0,%eax
je     1163 <main+0x43>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x4f>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <gets@plt>
cmpl   $0x0,0xc(%rsp)
lea    0xebe(%rip),%rax
lea    0xec2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"you have changed the 'modified' variable\0A\00"
@.str.1 = [12 x i8] c"Try again?\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 0, i32* %6
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%9 = call i32 @gets(i8* %8)
%10 = load volatile i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [11 x i8] c"Try again?\00"
@str.2 = [41 x i8] c"you have changed the 'modified' variable\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [64 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
store volatile i32 0, i32* %3
%7 = call i32 @gets(i8* %6)
%8 = load volatile i32, i32* %3
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @str.2, i64 0, i64 0)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}
void idle_cpu(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<idle_cpu>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<idle_cpu>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.idle_cpu = [9 x i8] c"idle_cpu\00"
define void @idle_cpu() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.idle_cpu, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.idle_cpu = [9 x i8] c"idle_cpu\00"
define void @idle_cpu() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.idle_cpu, i64 0, i64 0))
ret void
}
int hsGetTopScore(char *level) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hsGetTopScore(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int _cordx(double);
int _cordy(double);
int /*<<< orphan*/ printf(char *, int, int);
void bound(double xl, double yl, double xh, double yh) {
  printf("\\%d %d\n", _cordx(xl), _cordy(yl));
  printf("Z%d %d\n", _cordx(xh), _cordy(yh));
}


x86 assembly (clang, -O0):
<bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <_cordx@plt>
mov    %eax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <_cordy@plt>
mov    -0x28(%rbp),%esi
mov    %eax,%edx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1040 <_cordx@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <_cordy@plt>
mov    -0x24(%rbp),%esi
mov    %eax,%edx
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1040 <_cordx@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1050 <_cordy@plt>
lea    0xea0(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
call   1040 <_cordx@plt>
mov    %eax,%ebx
movsd  0x18(%rsp),%xmm0
call   1050 <_cordy@plt>
lea    0xe80(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
add    $0x20,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\\%d %d\0A\00"
@.str.1 = [8 x i8] c"Z%d %d\0A\00"
define void @bound(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = call i32 @_cordx(double %9)
%11 = load double, double* %6
%12 = call i32 @_cordy(double %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
%14 = load double, double* %7
%15 = call i32 @_cordx(double %14)
%16 = load double, double* %8
%17 = call i32 @_cordy(double %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\\%d %d\0A\00"
@.str.1 = [8 x i8] c"Z%d %d\0A\00"
define void @bound(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @_cordx(double %0)
%6 = tail call i32 @_cordy(double %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = tail call i32 @_cordx(double %2)
%9 = tail call i32 @_cordy(double %3)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
unused() { echo("Delete me"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Delete me\00"
define i32 @unused() {
%1 = alloca i32
%2 = call i32 @echo(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [10 x i8] c"Delete me\00"
define i32 @unused() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
scalar_t__ atoi(char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, int /*<<< orphan*/ *);
char *strchr(int /*<<< orphan*/, char);
unsigned int get_codepage(void) {
  char *cp_string;
  if ((cp_string = strchr(setlocale(LC_CTYPE, NULL), '.')))
    return ((unsigned)atoi(cp_string + 1));
  return 0;
}


x86 assembly (clang, -O0):
<get_codepage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setlocale@plt>
mov    %eax,%edi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1179 <get_codepage+0x49>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1180 <get_codepage+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_codepage>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %esi,%esi
call   1040 <setlocale@plt>
mov    %eax,%edi
mov    $0x2e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1163 <get_codepage+0x33>
add    $0x1,%rax
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %rax,%rbx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LC_CTYPE = global i32 0
define i32 @get_codepage() {
%1 = alloca i32
%2 = alloca i8*
%3 = load i32, i32* @LC_CTYPE
%4 = call i32 @setlocale(i32 %3, i32* null)
%5 = call i8* @strchr(i32 %4, i8 signext 46)
store i8* %5, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = call i64 @atoi(i8* %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %1
br label %13
12: ; preds = %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@LC_CTYPE = global i32 0
define i32 @get_codepage() {
%1 = load i32, i32* @LC_CTYPE
%2 = tail call i32 @setlocale(i32 %1, i32* null)
%3 = tail call i8* @strchr(i32 %2, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i64 @atoi(i8* %6)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %0, %5
%10 = phi i32 [ %8, %5 ], [ 0, %0 ]
ret i32 %10
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void split_mountpoint(char *mountpoint, char *path, char *localpath) {
  int len = strlen(mountpoint);
  strncpy(localpath, path + len - 1, 256);
}


x86 assembly (clang, -O0):
<split_mountpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x1c(%rbp),%rax
add    %rax,%rsi
add    $0xffffffffffffffff,%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_mountpoint>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rsi
add    $0xffffffffffffffff,%rsi
mov    %r14,%rdi
mov    $0x100,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define void @split_mountpoint(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = tail call i32 @strncpy(i8* %2, i8* %7, i32 256)
ret void
}
char *decexp_shortdesc(void) { return "decrypt a FRITZ!OS export file"; }


x86 assembly (clang, -O0):
<decexp_shortdesc>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decexp_shortdesc>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [31 x i8] c"decrypt a FRITZ!OS export file\00"
define i8* @decexp_shortdesc() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [31 x i8] c"decrypt a FRITZ!OS export file\00"
define i8* @decexp_shortdesc() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
void init_str(char *s, int len) {
  int i;
  unsigned int c;
  for (i = 0; i < len; i++) {
    c = rand() & 0xf;
    sprintf(s + i, "%x", c);
  }
}


x86 assembly (clang, -O0):
<init_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <init_str+0x57>
mov    $0x0,%al
call   1040 <rand@plt>
and    $0xf,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
add    %rax,%rdi
mov    -0x14(%rbp),%edx
lea    0xe9c(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <init_str+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_str>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1161 <init_str+0x41>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
and    $0xf,%eax
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <sprintf@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
jne    1140 <init_str+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define void @init_str(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = tail call i32 (...) @rand()
%9 = and i32 %8, 15
%10 = getelementptr inbounds i8, i8* %0, i64 %7
%11 = tail call i32 @sprintf(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
int get_ssid(void *data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_ssid(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void gdefree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<gdefree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @gdefree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
const char *ls_costN_nm6_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm6_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <ls_costN_nm6_name_in+0x27>
jmp    1117 <ls_costN_nm6_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ls_costN_nm6_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm6_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm6_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm6_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ halloc(void *, int /*<<< orphan*/);
void h_free(void *ptr) { halloc(ptr, 0); }


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

x86 assembly (clang, -O2):
<h_free>:
xor    %esi,%esi
jmp    1030 <halloc@plt>

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

LLVM IR (-O2):
define void @h_free(i8* %0) {
%2 = tail call i32 @halloc(i8* %0, i32 0)
ret void
}
void b(int *y) { (*y)++; }


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @b(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}