xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ rt_term();
__attribute__((destructor)) void finalizer() { rt_term(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @finalizer, i8* null }]
define void @finalizer() {
%1 = call i32 (...) @rt_term()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @finalizer, i8* null }]
define void @finalizer() {
%1 = tail call i32 (...) @rt_term()
ret void
}
/* Variables and functions */
int RSA2048_execute(int, char *);
int /*<<< orphan*/ printf(char *);
int RSA2048_Decrypt_CRT(int fd) {
  int ret;
  ret = RSA2048_execute(fd, "BF12C08000");
  if (ret != 0) {
    printf("ERR:RSA2048_Decrypt_CRT failed!\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<RSA2048_Decrypt_CRT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <RSA2048_execute@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115a <RSA2048_Decrypt_CRT+0x3a>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA2048_Decrypt_CRT>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <RSA2048_execute@plt>
test   %eax,%eax
je     113d <RSA2048_Decrypt_CRT+0x1d>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"BF12C08000\00"
@.str.1 = [33 x i8] c"ERR:RSA2048_Decrypt_CRT failed!\0A\00"
define i32 @RSA2048_Decrypt_CRT(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @RSA2048_execute(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"BF12C08000\00"
@str = [32 x i8] c"ERR:RSA2048_Decrypt_CRT failed!\00"
define i32 @RSA2048_Decrypt_CRT(i32 %0) {
%2 = tail call i32 @RSA2048_execute(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i32 1
}
int main() {
  int a;
  a = 1;
  while (a < 100) {
    a = 10;
    a = a + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1131 <main+0x31>
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %9
6: ; preds = %3
store i32 10, i32* %2
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t cichlid_rotate_left_64(uint64_t x, int n) {
  return (x << n) | (x >> (64 - n));
}


x86 assembly (clang, -O0):
<cichlid_rotate_left_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cichlid_rotate_left_64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @cichlid_rotate_left_64(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @cichlid_rotate_left_64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void ev_callback(int32_t fd, int16_t ev, void *arg) {}


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

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

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

LLVM IR (-O2):
define void @ev_callback(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
void I210ToAR30Row_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I210ToAR30Row_SSSE3() {
ret void
}
/* Type definitions */
struct string {
  int dummy;
};

/* Variables and functions */
struct string *string_insert(struct string *, int /*<<< orphan*/, char *,
                             size_t);
struct string *string_prepend(struct string *string, char *p, size_t len) {
  return string_insert(string, 0, p, len);
}


x86 assembly (clang, -O0):
<string_prepend>:
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),%rdx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <string_insert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_prepend>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <string_insert@plt>

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

LLVM IR (-O2):
%struct.string = type { i32 }
define %struct.string* @string_prepend(%struct.string* %0, i8* %1, i64 %2) {
%4 = tail call %struct.string* @string_insert(%struct.string* %0, i32 0, i8* %1, i64 %2)
ret %struct.string* %4
}
/* Variables and functions */
float sinf(float);
__attribute__((__weak__, __always___)) float softboundmpx_sinf(float x) {
  return sinf(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_sinf>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define weak float @softboundmpx_sinf(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
void foo038() {}


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

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

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

LLVM IR (-O2):
define void @foo038() {
ret void
}
/* Type definitions */
struct ptr_ring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __ptr_ring_discard_one(struct ptr_ring *);
void *__ptr_ring_peek(struct ptr_ring *);
void *__ptr_ring_consume(struct ptr_ring *r) {
  void *ptr;
  ptr = __ptr_ring_peek(r);
  if (ptr)
    __ptr_ring_discard_one(r);
  return ptr;
}


x86 assembly (clang, -O0):
<__ptr_ring_consume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__ptr_ring_peek@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <__ptr_ring_consume+0x2d>
mov    -0x8(%rbp),%rdi
call   1040 <__ptr_ring_discard_one@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ptr_ring_consume>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <__ptr_ring_peek@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113c <__ptr_ring_consume+0x1c>
mov    %r14,%rdi
call   1040 <__ptr_ring_discard_one@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ptr_ring = type { i32 }
define i8* @__ptr_ring_consume(%struct.ptr_ring* %0) {
%2 = alloca %struct.ptr_ring*
%3 = alloca i8*
store %struct.ptr_ring* %0, %struct.ptr_ring** %2
%4 = load %struct.ptr_ring*, %struct.ptr_ring** %2
%5 = call i8* @__ptr_ring_peek(%struct.ptr_ring* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.ptr_ring*, %struct.ptr_ring** %2
%10 = call i32 @__ptr_ring_discard_one(%struct.ptr_ring* %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
%struct.ptr_ring = type { i32 }
define i8* @__ptr_ring_consume(%struct.ptr_ring* %0) {
%2 = tail call i8* @__ptr_ring_peek(%struct.ptr_ring* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__ptr_ring_discard_one(%struct.ptr_ring* %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
float sinf(float x) {
  __asm__ __volatile__("flds %0;"
                       "fsin;"
                       "fstps %0"
                       : "+m"(x));
  return x;
}


x86 assembly (clang, -O0):
<sinf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
flds   -0x4(%rbp)
fsin
fstps  -0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinf>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
fsin
fstps  -0x4(%rsp)
movss  -0x4(%rsp),%xmm0
ret

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

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *start_routine(void *arg) {
  while (*(int *)arg == 1) {
    printf(".");
    sleep(1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<start_routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1154 <start_routine+0x34>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112c <start_routine+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_routine>:
push   %rbx
cmpl   $0x1,(%rdi)
jne    1149 <start_routine+0x29>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
cmpl   $0x1,(%rbx)
je     1130 <start_routine+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i8* @start_routine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @sleep(i32 1)
br label %3
11: ; preds = %3
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @start_routine(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = tail call i32 @putchar(i32 46)
%7 = tail call i32 @sleep(i32 1)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ PRCMHIBRegWrite(int, unsigned long);
void RTCU32SecRegWrite(unsigned long u32Msec) {
  PRCMHIBRegWrite((0x4402F800 + 0x00000424), u32Msec);
}


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

x86 assembly (clang, -O2):
<RTCU32SecRegWrite>:
mov    %rdi,%rsi
mov    $0x4402fc24,%edi
jmp    1030 <PRCMHIBRegWrite@plt>

LLVM IR (-O0):
define void @RTCU32SecRegWrite(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @PRCMHIBRegWrite(i32 1141046308, i64 %3)
ret void
}

LLVM IR (-O2):
define void @RTCU32SecRegWrite(i64 %0) {
%2 = tail call i32 @PRCMHIBRegWrite(i32 1141046308, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pressione_enter() {
  printf("\n\nPressione enter para voltar ao menu.\n");
  getchar();
  getchar();
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"\0A\0APressione enter para voltar ao menu.\0A\00"
define void @pressione_enter() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
%3 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"\0A\0APressione enter para voltar ao menu.\00"
define void @pressione_enter() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 (...) @getchar()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
FILE *apriFile(char *nome, char *modo) {
  FILE *fp;
  fp = fopen(nome, modo);
  if (fp == NULL) {
    printf("Errore! Impossibile aprire il file \"%s\"!\n", nome);
    exit(1);
  } else {
    return fp;
  }
}


x86 assembly (clang, -O0):
<apriFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <apriFile+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apriFile>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <apriFile+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Errore! Impossibile aprire il file \22%s\22!\0A\00"
define i32* @apriFile(i8* %0, i8* %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 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [42 x i8] c"Errore! Impossibile aprire il file \22%s\22!\0A\00"
define noalias i32* @apriFile(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32* %3
}
void got_construct() {}


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

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

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

LLVM IR (-O2):
define void @got_construct() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int raise(int signum __attribute__((__unused__))) {
  printf("Divide by zero!\n");
  exit(64);
  return 0;
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x40,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<raise>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x40,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Divide by zero!\0A\00"
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 64)
unreachable
}

LLVM IR (-O2):
@str = [16 x i8] c"Divide by zero!\00"
define i32 @raise(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 64)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ tgt;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ use_buf(char *);
void use_memset() {
  char tgt[100];
  memset(tgt, 0, sizeof(tgt));
  use_buf(tgt);
}


x86 assembly (clang, -O0):
<use_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1030 <memset@plt>
lea    -0x70(%rbp),%rdi
call   1040 <use_buf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_memset>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
call   1040 <use_buf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @use_memset() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 100)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @use_buf(i8* %4)
ret void
}

LLVM IR (-O2):
define void @use_memset() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 100)
%4 = call i32 @use_buf(i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
scalar_t__ write(int, char *, scalar_t__);
int cli_send_cmd(int fd, char *cmd) {
  if (write(fd, cmd, strlen(cmd) + 1) != strlen(cmd) + 1)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<cli_send_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1030 <write@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    $0x1,%rcx
cmp    %rcx,%rax
je     1186 <cli_send_cmd+0x66>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <cli_send_cmd+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_send_cmd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <write@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
xor    %ecx,%ecx
cmp    %rax,%rbp
setne  %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @cli_send_cmd(i32 %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i64 @write(i32 %0, i8* %1, i64 %4)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%7 = add nsw i64 %6, 1
%8 = icmp ne i64 %5, %7
%9 = sext i1 %8 to i32
ret i32 %9
}
double ho_recognize_font_1_zero(const double *array_in) {
  double return_value = 0.0;
  return return_value;
}


x86 assembly (clang, -O0):
<ho_recognize_font_1_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_recognize_font_1_zero>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ho_recognize_font_1_zero(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @ho_recognize_font_1_zero(double* nocapture readnone %0) {
ret double 0.000000e+00
}
int slp_sockstartup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @slp_sockstartup() {
ret i32 0
}
/* Variables and functions */
double alea();
double c2(void) { return 0.9 + 0.1 * (alea() + alea()); }


x86 assembly (clang, -O0):
<c2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <alea@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <alea@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xec1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2>:
push   %rax
xor    %eax,%eax
call   1030 <alea@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <alea@plt>
addsd  (%rsp),%xmm0
mulsd  0xecf(%rip),%xmm0
addsd  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @c2() {
%1 = call double (...) @alea()
%2 = call double (...) @alea()
%3 = fadd double %1, %2
%4 = call double @llvm.fmuladd.f64(double 1.000000e-01, double %3, double 9.000000e-01)
ret double %4
}

LLVM IR (-O2):
define double @c2() {
%1 = tail call double (...) @alea()
%2 = tail call double (...) @alea()
%3 = fadd double %1, %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double 1.000000e-01, double 9.000000e-01)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void mem_clean(volatile void *v, size_t len) {
  if (len) {
    memset((void *)v, 0, len);
    (void)*((volatile uint8_t *)v);
  }
}


x86 assembly (clang, -O0):
<mem_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <mem_clean+0x30>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_clean>:
test   %rsi,%rsi
je     1126 <mem_clean+0x16>
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <memset@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define void @mem_clean(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @memset(i8* %8, i32 0, i64 %9)
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to i32*
%13 = load volatile i32, i32* %12
br label %14
14: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @mem_clean(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
%6 = bitcast i8* %0 to i32*
%7 = load volatile i32, i32* %6
br label %8
8: ; preds = %4, %2
ret void
}
int _times() { return 0; }


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

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

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

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

/* Variables and functions */
int SQLITE_OK;
int scmAccess(sqlite3_vfs *pVfs, const char *zPath, int flags, int *pResOut) {
  *pResOut = 0;
  return SQLITE_OK;
}


x86 assembly (clang, -O0):
<scmAccess>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scmAccess>:
movl   $0x0,(%rcx)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @scmAccess(i32* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32* nocapture writeonly %3) {
store i32 0, i32* %3
%5 = load i32, i32* @SQLITE_OK
ret i32 %5
}
void out_str3(fmt, s1, s2, s3) const char fmt[], s1[], s2[], s3[];
{
  printf(fmt, s1, s2, s3);
  out_line_count(fmt);
  out_line_count(s1);
  out_line_count(s2);
  out_line_count(s3);
}


x86 assembly (clang, -O0):
<out_str3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <out_line_count@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <out_line_count@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <out_line_count@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <out_line_count@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_str3>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <out_line_count@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <out_line_count@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <out_line_count@plt>
mov    %r14,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <out_line_count@plt>

LLVM IR (-O0):
define void @out_str3(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 (i8*, ...) @printf(i8* %9, i8* %10, i8* %11, i8* %12)
%14 = load i8*, i8** %5
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %14)
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %16)
%18 = load i8*, i8** %7
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %18)
%20 = load i8*, i8** %8
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %20)
ret void
}

LLVM IR (-O2):
define void @out_str3(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i8* %1, i8* %2, i8* %3)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %0)
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %1)
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %2)
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Variables and functions */
int socket(int, int, int);
int txc_libc_socket(int domain, int type, int protocol) {
  return socket(domain, type, protocol);
}


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

x86 assembly (clang, -O2):
<txc_libc_socket>:
jmp    1030 <socket@plt>

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

LLVM IR (-O2):
define i32 @txc_libc_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_LITTLE_GUY_RESET_PIN() { clear_io_bit(0x70, 6); }


x86 assembly (clang, -O0):
<TOSH_CLR_LITTLE_GUY_RESET_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
mov    $0x6,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_LITTLE_GUY_RESET_PIN>:
mov    $0x70,%edi
mov    $0x6,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_LITTLE_GUY_RESET_PIN() {
%1 = call i32 @clear_io_bit(i32 112, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_LITTLE_GUY_RESET_PIN() {
%1 = tail call i32 @clear_io_bit(i32 112, i32 6)
ret void
}
adr0regx1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*((unsigned short *)10000000)) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movzwl (%rax),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1147 <adr0regx1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <adr0regx1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0regx1>:
movzwl 0x989680,%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,2),%dx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adr0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 10000000 to i16*)
%17 = zext i16 %16 to i32
%18 = load i16*, i16** %13
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i16, i16* %18, i64 %20
%22 = load i16, i16* %21
%23 = zext i16 %22 to i32
%24 = icmp sle i32 %17, %23
br i1 %24, label %25, label %26
25: ; preds = %6
store i32 1, i32* %7
br label %27
26: ; preds = %6
store i32 0, i32* %7
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @adr0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i16, i16* %5, i64 %8
%10 = load i16, i16* %9
%11 = icmp ule i16 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int ya_getopt_internal(int, char *const *, char const *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/);
int ya_getopt(int argc, char *const argv[], const char *optstring) {
  return ya_getopt_internal(argc, argv, optstring, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<ya_getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <ya_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ya_getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <ya_getopt_internal@plt>

LLVM IR (-O0):
define i32 @ya_getopt(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 @ya_getopt_internal(i32 %7, i8** %8, i8* %9, i32* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ya_getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @ya_getopt_internal(i32 %0, i8** %1, i8* %2, i32* null, i32* null, i32 0)
ret i32 %4
}
/* Variables and functions */
bool fspath_resolve(const char path[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_resolve(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *);
main() {
  int c;
  printf("Nhap: ");
  c = getchar();
  if (c == 65)
    printf("B\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jne    115b <main+0x3b>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x41,%eax
jne    1155 <main+0x25>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Nhap: \00"
@.str.1 = [3 x i8] c"B\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 65
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [7 x i8] c"Nhap: \00"
@str = [2 x i8] c"B\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 65
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}
void I210ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @I210ToABGR() {
ret void
}
/* Type definitions */
struct gang {
  int dummy;
};

/* Variables and functions */
void *gang_alloc(struct gang *, size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *gang_alloc0(struct gang *m, size_t sz) {
  void *ret;
  ret = gang_alloc(m, sz);
  if (ret != NULL)
    memset(ret, 0, sz);
  return ret;
}


x86 assembly (clang, -O0):
<gang_alloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gang_alloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115b <gang_alloc0+0x3b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gang_alloc0>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <gang_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <gang_alloc0+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.gang = type { i32 }
define i8* @gang_alloc0(%struct.gang* %0, i64 %1) {
%3 = alloca %struct.gang*
%4 = alloca i64
%5 = alloca i8*
store %struct.gang* %0, %struct.gang** %3
store i64 %1, i64* %4
%6 = load %struct.gang*, %struct.gang** %3
%7 = load i64, i64* %4
%8 = call i8* @gang_alloc(%struct.gang* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i64, i64* %4
%14 = call i32 @memset(i8* %12, i32 0, i64 %13)
br label %15
15: ; preds = %11, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
%struct.gang = type { i32 }
define i8* @gang_alloc0(%struct.gang* %0, i64 %1) {
%3 = tail call i8* @gang_alloc(%struct.gang* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memset(i8* %3, i32 0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
int dpopcount(unsigned long x) {
  if (__builtin_popcountl(x))
    return x;
  return -1;
}


x86 assembly (clang, -O0):
<dpopcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rcx,%rax
and    %rdx,%rax
shr    $0x2,%rcx
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
cmp    $0x0,%eax
je     117a <dpopcount+0x7a>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1181 <dpopcount+0x81>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpopcount>:
cmp    $0x1,%rdi
sbb    %eax,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @dpopcount(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i64 @llvm.ctpop.i64(i64 %4)
%6 = trunc i64 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @dpopcount(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = trunc i64 %0 to i32
%4 = select i1 %2, i32 -1, i32 %3
ret i32 %4
}
int spi_bulkread(void *hDevice, unsigned short addr, unsigned char command,
                 unsigned char *data, unsigned short length) {
  return 0;
}


x86 assembly (clang, -O0):
<spi_bulkread>:
push   %rbp
mov    %rsp,%rbp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %si,-0xa(%rbp)
mov    %dl,-0xb(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @spi_bulkread(i8* nocapture readnone %0, i16 zeroext %1, i8 zeroext %2, i8* nocapture readnone %3, i16 zeroext %4) {
ret i32 0
}
void XCreateGlyphCursor() {}


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

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

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

LLVM IR (-O2):
define void @XCreateGlyphCursor() {
ret void
}
char *strrchr(const char *string, int c_) {
  char c = c_;
  const char *p = ((void *)0);
  for (; *string != '\0'; string++) {
    if (*string == c)
      p = string;
  }
  return (char *)p;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <strrchr+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <strrchr+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <strrchr+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1119 <strrchr+0x19>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strrchr+0x26>
movsbl %sil,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %8
%9 = phi i8 [ %3, %5 ], [ %16, %8 ]
%10 = phi i8* [ null, %5 ], [ %14, %8 ]
%11 = phi i8* [ %0, %5 ], [ %15, %8 ]
%12 = sext i8 %9 to i32
%13 = icmp eq i32 %7, %12
%14 = select i1 %13, i8* %11, i8* %10
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8* [ null, %2 ], [ %14, %8 ]
ret i8* %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int chiedi_primo_fattore() {
  int x;
  printf("Inserisci il primo fattore\n> ");
  scanf("%d", &x);
  return x;
}


x86 assembly (clang, -O0):
<chiedi_primo_fattore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chiedi_primo_fattore>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Inserisci il primo fattore\0A> \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @chiedi_primo_fattore() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [30 x i8] c"Inserisci il primo fattore\0A> \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @chiedi_primo_fattore() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
int inflate(struct z_stream_s *strm, int flush) { return -2; }


x86 assembly (clang, -O0):
<inflate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xfffffffe,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.z_stream_s = type opaque
define i32 @inflate(%struct.z_stream_s* %0, i32 %1) {
%3 = alloca %struct.z_stream_s*
%4 = alloca i32
store %struct.z_stream_s* %0, %struct.z_stream_s** %3
store i32 %1, i32* %4
ret i32 -2
}

LLVM IR (-O2):
%struct.z_stream_s = type opaque
define i32 @inflate(%struct.z_stream_s* nocapture readnone %0, i32 %1) {
ret i32 -2
}
/* Type definitions */
typedef int /*<<< orphan*/ string;

/* Variables and functions */
int sceRegMgrGetKeyStr(char const *, char const *, char *, int);
char *getString(const char *reg, const char *key) {
  int ret = 0;
  static char string[128];
  ret = sceRegMgrGetKeyStr(reg, key, string, sizeof(string));
  return string;
}


x86 assembly (clang, -O0):
<getString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x2f0a(%rip),%rdx
mov    $0x80,%ecx
call   1030 <sceRegMgrGetKeyStr@plt>
mov    %eax,-0x14(%rbp)
lea    0x2ef6(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getString>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdx
mov    $0x80,%ecx
call   1030 <sceRegMgrGetKeyStr@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@getString.string = internal global [128 x i8] zeroinitializer
define i8* @getString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @sceRegMgrGetKeyStr(i8* %6, i8* %7, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @getString.string, i64 0, i64 0), i32 128)
store i32 %8, i32* %5
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @getString.string, i64 0, i64 0)
}

LLVM IR (-O2):
@getString.string = internal global [128 x i8] zeroinitializer
define i8* @getString(i8* %0, i8* %1) {
%3 = tail call i32 @sceRegMgrGetKeyStr(i8* %0, i8* %1, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @getString.string, i64 0, i64 0), i32 128)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @getString.string, i64 0, i64 0)
}