xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char *packEx(unsigned char *, int, int, int, int *, int *);
unsigned char *pack(unsigned char *data, int inOffset, int size, int *outSize,
                    int *method) {
  return packEx(data, inOffset, size, 1, outSize, method);
}


x86 assembly (clang, -O0):
<pack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    $0x1,%ecx
call   1030 <packEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack>:
mov    %r8,%r9
mov    %rcx,%r8
mov    $0x1,%ecx
jmp    1030 <packEx@plt>

LLVM IR (-O0):
define i8* @pack(i8* %0, i32 %1, i32 %2, i32* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i8* @packEx(i8* %11, i32 %12, i32 %13, i32 1, i32* %14, i32* %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @pack(i8* %0, i32 %1, i32 %2, i32* %3, i32* %4) {
%6 = tail call i8* @packEx(i8* %0, i32 %1, i32 %2, i32 1, i32* %3, i32* %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void hubo_daemon_close() {
  remove("/var/lock/hubo-daemon");
  fclose(stdout);
  fclose(stderr);
  syslog(LOG_NOTICE, "Terminated gracefully");
  closelog();
}


x86 assembly (clang, -O0):
<hubo_daemon_close>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <remove@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <fclose@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <fclose@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1060 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hubo_daemon_close>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <remove@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <fclose@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <fclose@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1060 <syslog@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"/var/lock/hubo-daemon\00"
@stdout = global i32 0
@stderr = global i32 0
@LOG_NOTICE = global i32 0
@.str.1 = [22 x i8] c"Terminated gracefully\00"
define void @hubo_daemon_close() {
%1 = call i32 @remove(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fclose(i32 %2)
%4 = load i32, i32* @stderr
%5 = call i32 @fclose(i32 %4)
%6 = load i32, i32* @LOG_NOTICE
%7 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"/var/lock/hubo-daemon\00"
@stdout = global i32 0
@stderr = global i32 0
@LOG_NOTICE = global i32 0
@.str.1 = [22 x i8] c"Terminated gracefully\00"
define void @hubo_daemon_close() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fclose(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fclose(i32 %4)
%6 = load i32, i32* @LOG_NOTICE
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (...) @closelog()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int read_missingness(uint8_t ploidy_miss) { return ploidy_miss >> 7; }


x86 assembly (clang, -O0):
<read_missingness>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_missingness>:
mov    %edi,%eax
sar    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @read_missingness(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 7
ret i32 %4
}

LLVM IR (-O2):
define i32 @read_missingness(i32 %0) {
%2 = ashr i32 %0, 7
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int slk_attr_set(int /*<<< orphan*/ const, short, void *);
int __darwin_slk_attr_set(const uint32_t a, short s, void *p) {
  return slk_attr_set(a, s, p);
}


x86 assembly (clang, -O0):
<__darwin_slk_attr_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x6(%rbp),%ax
mov    -0x10(%rbp),%rdx
movswl %ax,%esi
call   1030 <slk_attr_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__darwin_slk_attr_set>:
jmp    1030 <slk_attr_set@plt>

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

LLVM IR (-O2):
define i32 @__darwin_slk_attr_set(i32 %0, i16 signext %1, i8* %2) {
%4 = tail call i32 @slk_attr_set(i32 %0, i16 signext %1, i8* %2)
ret i32 %4
}
int g(int x) { return x + 4; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = add nsw i32 %0, 4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(void *, void *);
int streq(void *key1, void *key2) { return !strcmp(key1, key2); }


x86 assembly (clang, -O0):
<streq>:
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 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streq(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 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @streq(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
short compareSection(int /*<<< orphan*/ *, int, int, char *);
short hasCorrectSignature(FILE *file) {
  return compareSection(file, 9, 5, "\x25\xE2\xE3\xCF\xD3");
}


x86 assembly (clang, -O0):
<hasCorrectSignature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
mov    $0x5,%edx
lea    0xecf(%rip),%rcx
call   1030 <compareSection@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasCorrectSignature>:
lea    0xee9(%rip),%rcx
mov    $0x9,%esi
mov    $0x5,%edx
jmp    1030 <compareSection@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%\E2\E3\CF\D3\00"
define signext i16 @hasCorrectSignature(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call signext i16 @compareSection(i32* %3, i32 9, i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i16 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"%\E2\E3\CF\D3\00"
define signext i16 @hasCorrectSignature(i32* %0) {
%2 = tail call signext i16 @compareSection(i32* %0, i32 9, i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i16 %2
}
long long bit16() { return 0x0000000000010000LL; }


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

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

LLVM IR (-O0):
define i64 @bit16() {
ret i64 65536
}

LLVM IR (-O2):
define i64 @bit16() {
ret i64 65536
}
double __attribute__((const)) lw6sys_dmin(double a, double b) {
  return (a < b) ? a : b;
}


x86 assembly (clang, -O0):
<lw6sys_dmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <lw6sys_dmin+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <lw6sys_dmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw6sys_dmin>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lw6sys_dmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @lw6sys_dmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int kms_crypto_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kms_crypto_init() {
ret i32 0
}
/* Variables and functions */
int rand();
double dither(void) { return (double)(rand() % 32768) / 32768.0 - 0.5; }


x86 assembly (clang, -O0):
<dither>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x8000,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xed9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dither>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7fff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff8000,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xec9(%rip),%xmm0
addsd  0xec9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dither() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 32768
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 3.276800e+04
%5 = fsub double %4, 5.000000e-01
ret double %5
}

LLVM IR (-O2):
define double @dither() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 32768
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3F00000000000000
%5 = fadd double %4, -5.000000e-01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __xfree(void *ptr) {
  if (ptr) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<__xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <__xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xfree>:
test   %rdi,%rdi
je     111a <__xfree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @__xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
unsigned long WaitKey263(unsigned long);
unsigned long waitkey(unsigned long k) { return WaitKey263(k); }


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

x86 assembly (clang, -O2):
<waitkey>:
jmp    1030 <WaitKey263@plt>

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

LLVM IR (-O2):
define i64 @waitkey(i64 %0) {
%2 = tail call i64 @WaitKey263(i64 %0)
ret i64 %2
}
int reg_storage_buddy_system(char *buddy_name, char order_array[],
                             int order_num) {
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @reg_storage_buddy_system(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ A();
int main(int argc, char **argv) {
  A();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <A@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @A()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @A()
ret i32 0
}
void handle_58(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_58(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ data;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void *get_XImage_data(void *_p) { return (void *)((XImage *)_p)->data; }


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

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

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

LLVM IR (-O2):
define i8* @get_XImage_data(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int flat3_restorefs(int, int /*<<< orphan*/);
int flat3_checkfs(void) {
  int rc;
  if ((rc = flat3_restorefs(3, 0)) < 0)
    return rc;
  return 0;
}


x86 assembly (clang, -O0):
<flat3_checkfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <flat3_restorefs@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    113b <flat3_checkfs+0x2b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <flat3_checkfs+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flat3_checkfs>:
push   %rax
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <flat3_restorefs@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @flat3_checkfs() {
%1 = tail call i32 @flat3_restorefs(i32 3, i32 0)
%2 = icmp slt i32 %1, 0
%3 = select i1 %2, i32 %1, i32 0
ret i32 %3
}
unsigned xrop3_94_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~D;
  stk3 = S & stk4;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_94_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_94_0_0>:
shl    $0x8,%edi
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_94_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %5
%25 = xor i32 %24, -1
store i32 %25, i32* %11
%26 = load i32, i32* %6
%27 = load i32, i32* %11
%28 = and i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %7
%30 = load i32, i32* %10
%31 = or i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %5
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_94_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, 255
ret i32 %8
}
char jugadorRival(char jugador) {
  if (jugador == 'o')
    return 'x';
  return 'o';
}


x86 assembly (clang, -O0):
<jugadorRival>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x6f,%eax
jne    1120 <jugadorRival+0x20>
movb   $0x78,-0x1(%rbp)
jmp    1124 <jugadorRival+0x24>
movb   $0x6f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jugadorRival>:
xor    %eax,%eax
cmp    $0x6f,%dil
sete   %al
lea    (%rax,%rax,8),%eax
add    $0x6f,%eax
ret

LLVM IR (-O0):
define signext i8 @jugadorRival(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 111
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 120, i8* %2
br label %9
8: ; preds = %1
store i8 111, i8* %2
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @jugadorRival(i8 signext %0) {
%2 = icmp eq i8 %0, 111
%3 = select i1 %2, i8 120, i8 111
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, "Fatal Error: %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Fatal Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Fatal Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __poet_fail();
int nondet(int, int);
int main(void) {
  int x = nondet(1, 10);
  if (x <= 0)
    __poet_fail();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
call   1040 <nondet@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1152 <main+0x32>
mov    $0x0,%al
call   1030 <__poet_fail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0xa,%esi
call   1040 <nondet@plt>
test   %eax,%eax
jg     113b <main+0x1b>
xor    %eax,%eax
call   1030 <__poet_fail@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @nondet(i32 1, i32 10)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @__poet_fail()
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @nondet(i32 1, i32 10)
%2 = icmp slt i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__poet_fail()
br label %5
5: ; preds = %3, %0
ret i32 0
}
int test_imm_5Aint64_midword_reg(long long val) {
  return ((val >> 16) & (0x5A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Aint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x5a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Aint64_midword_reg>:
test   $0x5a0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Aint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 90
%6 = icmp ne i64 %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_5Aint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5898240
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
void unintialized_use() {
  int i;
  printf("%d\n", i);
  int *num = (int *)malloc(sizeof(int));
  printf("*num = %d \r\n", *num);
  free(num);
}


x86 assembly (clang, -O0):
<unintialized_use>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unintialized_use>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"*num = %d \0D\0A\00"
define void @unintialized_use() {
%1 = alloca i32
%2 = alloca i32*
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %2
%11 = call i32 @free(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"*num = %d \0D\0A\00"
define void @unintialized_use() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @free(i32* %3)
ret void
}
/* Variables and functions */
int log_dbg_write_free(char *, scalar_t__);
scalar_t__ strlen(char *);
int log_dbg_print_free(char *s) { return log_dbg_write_free(s, strlen(s) + 1); }


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

x86 assembly (clang, -O2):
<log_dbg_print_free>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <log_dbg_write_free@plt>

LLVM IR (-O0):
define i32 @log_dbg_print_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i32 @log_dbg_write_free(i8* %3, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @log_dbg_print_free(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @log_dbg_write_free(i8* %0, i64 %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ music_is_playing();
float f_music_is_playing() { return music_is_playing() ? 1.0f : 0.0f; }


x86 assembly (clang, -O0):
<f_music_is_playing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <music_is_playing@plt>
movss  0xed9(%rip),%xmm0
xorps  %xmm1,%xmm1
movss  %xmm1,-0x8(%rbp)
cmp    $0x0,%rax
movss  %xmm0,-0x4(%rbp)
jne    1148 <f_music_is_playing+0x38>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_music_is_playing>:
push   %rax
xor    %eax,%eax
call   1030 <music_is_playing@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
je     1128 <f_music_is_playing+0x18>
movss  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f_music_is_playing() {
%1 = call i64 (...) @music_is_playing()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, float 1.000000e+00, float 0.000000e+00
ret float %4
}

LLVM IR (-O2):
define float @f_music_is_playing() {
%1 = tail call i64 (...) @music_is_playing()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, float 0.000000e+00, float 1.000000e+00
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int file_close(FILE *stream) { return fclose(stream); }


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

x86 assembly (clang, -O2):
<file_close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define i32 @file_close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret i32 %2
}
/* Variables and functions */
long strtol(char const *, char **, int /*<<< orphan*/);
int convert_number(const char *string, long *numberp) {
  char *cp;
  *numberp = strtol(string, &cp, 0);
  return (string == cp) ? (*cp != 0) : 0;
}


x86 assembly (clang, -O0):
<convert_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1161 <convert_number+0x51>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    116b <convert_number+0x5b>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    116b <convert_number+0x5b>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_number>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,(%r14)
cmp    %rbx,0x8(%rsp)
jne    113f <convert_number+0x2f>
xor    %ebp,%ebp
cmpb   $0x0,(%rbx)
setne  %bpl
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @convert_number(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtol(i8* %0, i8** %3, i32 0)
store i64 %5, i64* %1
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %0
%10 = icmp ne i8 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %2, %8
%13 = phi i32 [ %11, %8 ], [ 0, %2 ]
ret i32 %13
}
unsigned long rdtsc(void) {
  unsigned int edx, eax;
  asm volatile("mfence\nrdtsc\n" : "=d"(edx), "=a"(eax) : : "ebx", "ecx");
  return (((unsigned long)edx) << 32) | eax;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mfence
rdtsc
mov    %edx,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x20,%rax
mov    -0x10(%rbp),%ecx
or     %rcx,%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
push   %rbx
mfence
rdtsc
shl    $0x20,%rdx
mov    %eax,%eax
or     %rdx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "mfence\0Ardtsc\0A", "={dx},={ax},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = shl i64 %7, 32
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = or i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i32, i32 } asm sideeffect "mfence\0Ardtsc\0A", "={dx},={ax},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = shl nuw i64 %4, 32
%6 = zext i32 %3 to i64
%7 = or i64 %5, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void say_hello(char const *name, char const *weather) {
  printf("Hello, %s. You are facing a %s day\n", name, weather);
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Hello, %s. You are facing a %s day\0A\00"
define void @say_hello(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 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Hello, %s. You are facing a %s day\0A\00"
define void @say_hello(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bounce_south();
int /*<<< orphan*/ bounce_west();
scalar_t__ get_east_penetration();
scalar_t__ get_north_penetration();
void do_north_east(void) {
  if (get_north_penetration() < get_east_penetration())
    bounce_south();
  else
    bounce_west();
}


x86 assembly (clang, -O0):
<do_north_east>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <get_north_penetration@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <get_east_penetration@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
cmp    %rcx,%rax
jge    1176 <do_north_east+0x36>
mov    $0x0,%al
call   1030 <bounce_south@plt>
jmp    117d <do_north_east+0x3d>
mov    $0x0,%al
call   1040 <bounce_west@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_north_east>:
push   %rbx
xor    %eax,%eax
call   1060 <get_north_penetration@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <get_east_penetration@plt>
cmp    %rax,%rbx
jge    115f <do_north_east+0x1f>
xor    %eax,%eax
pop    %rbx
jmp    1030 <bounce_south@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <bounce_west@plt>

LLVM IR (-O0):
define void @do_north_east() {
%1 = call i64 (...) @get_north_penetration()
%2 = call i64 (...) @get_east_penetration()
%3 = icmp slt i64 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @bounce_south()
br label %8
6: ; preds = %0
%7 = call i32 (...) @bounce_west()
br label %8
8: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
define void @do_north_east() {
%1 = tail call i64 (...) @get_north_penetration()
%2 = tail call i64 (...) @get_east_penetration()
%3 = icmp slt i64 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @bounce_south()
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @bounce_west()
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
size_t b64_encoded_buffer_length(size_t input_length) {
  return 4 * ((input_length + 2) / 3);
}


x86 assembly (clang, -O0):
<b64_encoded_buffer_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_encoded_buffer_length>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
lea    (%rdx,%rdx,1),%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @b64_encoded_buffer_length(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2
%5 = udiv i64 %4, 3
%6 = mul i64 4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @b64_encoded_buffer_length(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
scalar_t__ MALLOC(int);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *time_stamp_dir(void) {
  time_t t;
  char *t_stamp;
  t_stamp = (char *)MALLOC(25 * sizeof(char));
  t = time(NULL);
  strftime(t_stamp, 21, "%d-%b-%Y_%H-%M-%S", localtime(&t));
  return t_stamp;
}


x86 assembly (clang, -O0):
<time_stamp_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x19,%edi
call   1050 <MALLOC@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x15,%esi
lea    0xe7b(%rip),%rdx
call   1060 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_stamp_dir>:
push   %rbx
sub    $0x10,%rsp
mov    $0x19,%edi
call   1050 <MALLOC@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe92(%rip),%rdx
mov    %rbx,%rdi
mov    $0x15,%esi
mov    %eax,%ecx
call   1060 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%d-%b-%Y_%H-%M-%S\00"
define i8* @time_stamp_dir() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i64 @MALLOC(i32 25)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %1
%6 = load i8*, i8** %2
%7 = call i32 @localtime(i32* %1)
%8 = call i32 @strftime(i8* %6, i32 21, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d-%b-%Y_%H-%M-%S\00"
define i8* @time_stamp_dir() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i64 @MALLOC(i32 25)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %1
%6 = call i32 @localtime(i32* %1)
%7 = call i32 @strftime(i8* %4, i32 21, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  printf(" enter the number");
  scanf(" %d", &i);
  printf(" %d", i);
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c" enter the number\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void waitm(void) {
  asm volatile(".long (0x7c00007c | (((0) & 0x3) << (31 - 10)))");
}


x86 assembly (clang, -O0):
<waitm>:
push   %rbp
mov    %rsp,%rbp
jl     1106 <waitm+0x6>
add    %bh,-0x3d(%rbp,%rbx,2)

x86 assembly (clang, -O2):
<waitm>:
jl     1102 <waitm+0x2>
.byte 0x0
jl     10c8 <__do_global_dtors_aux+0x18>

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

LLVM IR (-O2):
define void @waitm() {
tail call void asm sideeffect ".long (0x7c00007c | (((0) & 0x3) << (31 - 10)))", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void lvds_free_irq(unsigned int irq, void *dev_id) {}


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

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

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

LLVM IR (-O2):
define void @lvds_free_irq(i32 %0, i8* nocapture %1) {
ret void
}
int function_1(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<function_1>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @function_1(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @function_1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void OpenMP_status(void) { printf("OpenMP: not supported by this binary\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"OpenMP: not supported by this binary\0A\00"
define void @OpenMP_status() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"OpenMP: not supported by this binary\00"
define void @OpenMP_status() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double _normal_01_bili();
double rand_normal(double avg, double sigma) {
  return _normal_01_bili() * sigma + avg;
}


x86 assembly (clang, -O0):
<rand_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <_normal_01_bili@plt>
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_normal>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <_normal_01_bili@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rand_normal(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @_normal_01_bili()
%6 = load double, double* %4
%7 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double %5, double %6, double %7)
ret double %8
}

LLVM IR (-O2):
define double @rand_normal(double %0, double %1) {
%3 = tail call double (...) @_normal_01_bili()
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %0)
ret double %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRB5_set(void) { return U_WMRCORENONE_set("U_WMRB5"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRB5\00"
define i8* @U_WMRB5_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRB5\00"
define i8* @U_WMRB5_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
struct fieldnode *AppendField(struct fieldnode *fields, int fieldno, char *text,
                              struct type *type, int *arraydims) {}


x86 assembly (clang, -O0):
<AppendField>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fieldnode = type opaque
%struct.type = type opaque
define %struct.fieldnode* @AppendField(%struct.fieldnode* %0, i32 %1, i8* %2, %struct.type* %3, i32* %4) {
%6 = alloca %struct.fieldnode*
%7 = alloca %struct.fieldnode*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca %struct.type*
%11 = alloca i32*
store %struct.fieldnode* %0, %struct.fieldnode** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store %struct.type* %3, %struct.type** %10
store i32* %4, i32** %11
%12 = load %struct.fieldnode*, %struct.fieldnode** %6
ret %struct.fieldnode* %12
}

LLVM IR (-O2):
%struct.fieldnode = type opaque
%struct.type = type opaque
define noalias %struct.fieldnode* @AppendField(%struct.fieldnode* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, %struct.type* nocapture readnone %3, i32* nocapture readnone %4) {
ret %struct.fieldnode* undef
}