xunge/DecIR huggingface dataset:
unsigned long myabs(long a) { return (a < 0) ? -a : a; }


x86 assembly (clang, -O0):
<myabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <myabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <myabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @myabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ lua_pushusertag(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ lua_setglobal(char *);
void setfile(FILE *f, char *name, int tag) {
  lua_pushusertag(f, tag);
  lua_setglobal(name);
}


x86 assembly (clang, -O0):
<setfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <lua_pushusertag@plt>
mov    -0x10(%rbp),%rdi
call   1040 <lua_setglobal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setfile>:
push   %rbx
mov    %rsi,%rbx
mov    %edx,%esi
call   1030 <lua_pushusertag@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <lua_setglobal@plt>

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

LLVM IR (-O2):
define void @setfile(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @lua_pushusertag(i32* %0, i32 %2)
%5 = tail call i32 @lua_setglobal(i8* %1)
ret void
}
/* Variables and functions */
int gbser_write(void *, char const *, unsigned int);
scalar_t__ strlen(char const *);
int gbser_print(void *handle, const char *str) {
  return gbser_write(handle, str, (unsigned)strlen(str));
}


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

x86 assembly (clang, -O2):
<gbser_print>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <gbser_write@plt>

LLVM IR (-O0):
define i32 @gbser_print(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 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = trunc i64 %8 to i32
%10 = call i32 @gbser_write(i8* %5, i8* %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @gbser_print(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @gbser_write(i8* %0, i8* %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_help() {
  fprintf(stderr,
          "Please type <port> <tcp/udp> <package_size_in_bytes> <delay>\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"Please type <port> <tcp/udp> <package_size_in_bytes> <delay>\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"Please type <port> <tcp/udp> <package_size_in_bytes> <delay>\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}
int open(const char *filename, int flags) {
  int r;
  __asm__ __volatile__("\tint $0x80\n"
                       : "=a"(r)
                       : "a"(5), "b"(filename), "c"(flags)
                       : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x14(%rbp),%ecx
mov    $0x5,%eax
int    $0x80
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    $0x0,%al
call   1030 <set_errno@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rbx
mov    $0x5,%eax
int    $0x80
mov    %eax,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 5, i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1) {
%3 = tail call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 5, i8* %0, i32 %1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int getAnswer(void) {
  char c;
  scanf(" %c", &c);
  return (c == 'y' || c == 'Y');
}


x86 assembly (clang, -O0):
<getAnswer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <scanf@plt>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x2(%rbp)
je     1147 <getAnswer+0x37>
movsbl -0x1(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAnswer>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x7(%rsp),%cl
and    $0xdf,%cl
xor    %eax,%eax
cmp    $0x59,%cl
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %c\00"
define i32 @getAnswer() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 121
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 89
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ true, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c" %c\00"
define i32 @getAnswer() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = and i8 %3, -33
%5 = icmp eq i8 %4, 89
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int _buffer_write(struct ac_buffer *, int /*<<< orphan*/ *, int);
int buffer_write_int(struct ac_buffer *buffer, int32_t value) {
  return _buffer_write(buffer, &value, sizeof(int));
}


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

x86 assembly (clang, -O2):
<buffer_write_int>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <_buffer_write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_write_int(%struct.ac_buffer* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @_buffer_write(%struct.ac_buffer* %0, i32* %3, i32 4)
ret i32 %4
}
void strcpy_rom(char *dest, const char *src) {
  unsigned char i;
  for (i = 0; (dest[i] = src[i]) != '\0'; i++)
    ;
}


x86 assembly (clang, -O0):
<strcpy_rom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movzbl -0x11(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movzbl -0x11(%rbp),%edx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1144 <strcpy_rom+0x44>
jmp    1137 <strcpy_rom+0x37>
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    1110 <strcpy_rom+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_rom>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %al,%eax
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%al
test   %cl,%cl
jne    1110 <strcpy_rom+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy_rom(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8 [ 0, %2 ], [ %10, %3 ]
%5 = zext i8 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %7, i8* %8
%9 = icmp eq i8 %7, 0
%10 = add i8 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(long *);
int /*<<< orphan*/ cpuid(int, long, long *, long *, long *, long *);
int qhypercall(long callno, long *ebx, long *ecx, long *edx) {
  long eax;
  assert(ebx);
  assert(ecx);
  assert(edx);
  cpuid(0x228CC0B2, callno, &eax, ebx, ecx, edx);
  return eax == 0x11981651;
}


x86 assembly (clang, -O0):
<qhypercall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    $0x228cc0b2,%edi
lea    -0x28(%rbp),%rdx
call   1040 <cpuid@plt>
cmpq   $0x11981651,-0x28(%rbp)
11
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qhypercall>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rsi,%rdi
call   1030 <assert@plt>
mov    %r15,%rdi
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    %rsp,%rdx
mov    $0x228cc0b2,%edi
mov    %r12,%rsi
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1040 <cpuid@plt>
xor    %eax,%eax
cmpq   $0x11981651,(%rsp)
11
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @qhypercall(i64 %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i64
store i64 %0, i64* %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%10 = load i64*, i64** %6
%11 = call i32 @assert(i64* %10)
%12 = load i64*, i64** %7
%13 = call i32 @assert(i64* %12)
%14 = load i64*, i64** %8
%15 = call i32 @assert(i64* %14)
%16 = load i64, i64* %5
%17 = load i64*, i64** %6
%18 = load i64*, i64** %7
%19 = load i64*, i64** %8
%20 = call i32 @cpuid(i32 579649714, i64 %16, i64* %9, i64* %17, i64* %18, i64* %19)
%21 = load i64, i64* %9
%22 = icmp eq i64 %21, 295179857
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @qhypercall(i64 %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
%7 = tail call i32 @assert(i64* %1)
%8 = tail call i32 @assert(i64* %2)
%9 = tail call i32 @assert(i64* %3)
%10 = call i32 @cpuid(i32 579649714, i64 %0, i64* %5, i64* %1, i64* %2, i64* %3)
%11 = load i64, i64* %5
%12 = icmp eq i64 %11, 295179857
%13 = zext i1 %12 to i32
ret i32 %13
}
void kegi_xwip_init() {}


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

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

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

LLVM IR (-O2):
define void @kegi_xwip_init() {
ret void
}
/* Type definitions */
typedef double GLfloat;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
void dispVertex(GLfloat vertex[]) {
  printf("(%f, %f, %f)\n", vertex[0], vertex[1], vertex[2]);
}


x86 assembly (clang, -O0):
<dispVertex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispVertex>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"(%f, %f, %f)\0A\00"
define void @dispVertex(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %5, double %8, double %11)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"(%f, %f, %f)\0A\00"
define void @dispVertex(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %2, double %4, double %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _a64_outb(int, int);
void i8259pic_send_eoi(int irq) {
  if (irq >= 8)
    _a64_outb(0xA0, 0x20);
  _a64_outb(0x20, 0x20);
}


x86 assembly (clang, -O0):
<i8259pic_send_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jl     1134 <i8259pic_send_eoi+0x24>
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <_a64_outb@plt>
mov    $0x20,%esi
mov    %esi,%edi
call   1030 <_a64_outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8259pic_send_eoi>:
cmp    $0x8,%edi
jl     1129 <i8259pic_send_eoi+0x19>
push   %rax
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <_a64_outb@plt>
add    $0x8,%rsp
mov    $0x20,%edi
mov    $0x20,%esi
jmp    1030 <_a64_outb@plt>

LLVM IR (-O0):
define void @i8259pic_send_eoi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 8
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @_a64_outb(i32 160, i32 32)
br label %7
7: ; preds = %5, %1
%8 = call i32 @_a64_outb(i32 32, i32 32)
ret void
}

LLVM IR (-O2):
define void @i8259pic_send_eoi(i32 %0) {
%2 = icmp sgt i32 %0, 7
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @_a64_outb(i32 160, i32 32)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @_a64_outb(i32 32, i32 32)
ret void
}
void delet2Darray_continuousMem(double **tmp, int a1, int a2) {
  free(tmp[0]);
  free(tmp);
}


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

x86 assembly (clang, -O2):
<delet2Darray_continuousMem>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @delet2Darray_continuousMem(double** %0, i32 %1, i32 %2) {
%4 = alloca double**
%5 = alloca i32
%6 = alloca i32
store double** %0, double*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double**, double*** %4
%8 = getelementptr inbounds double*, double** %7, i64 0
%9 = load double*, double** %8
%10 = bitcast double* %9 to i8*
%11 = load double**, double*** %4
%12 = bitcast double** %11 to i8*
ret void
}

LLVM IR (-O2):
define void @delet2Darray_continuousMem(double** nocapture %0, i32 %1, i32 %2) {
%4 = bitcast double** %0 to i8**
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast double** %0 to i8*
tail call void @free(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int play_more(void) {
  char yesno[50];
  printf("\nAnother roundup ? (y/n) ");
  scanf("%s", yesno);
  return (yesno[0] == 'y') ? 1 : 0;
}


x86 assembly (clang, -O0):
<play_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xedb(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x40(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x79,%edx
cmove  %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play_more>:
sub    $0x38,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpb   $0x79,(%rsp)
sete   %al
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0AAnother roundup ? (y/n) \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @play_more() {
%1 = alloca [50 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 121
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0AAnother roundup ? (y/n) \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @play_more() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 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), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 121
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ dsfmt_gv_fill_array_open_close(double *, int);
void s_fill_array_open_close(double array[], int size) {
  dsfmt_gv_fill_array_open_close(array, size);
}


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

x86 assembly (clang, -O2):
<s_fill_array_open_close>:
jmp    1030 <dsfmt_gv_fill_array_open_close@plt>

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

LLVM IR (-O2):
define void @s_fill_array_open_close(double* %0, i32 %1) {
%3 = tail call i32 @dsfmt_gv_fill_array_open_close(double* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ findSum(int *, int);
int main() {
  int array[] = {1, 2, 3, 1, 1, 4, 5, 6};
  int n = sizeof(array) / sizeof(int);
  findSum(array, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <findSum@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <findSum@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [8 x i32] [i32 1, i32 2, i32 3, i32 1, i32 1, i32 4, i32 5, i32 6]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @findSum(i32* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [8 x i32] [i32 1, i32 2, i32 3, i32 1, i32 1, i32 4, i32 5, i32 6]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @findSum(i32* %3, i32 8)
ret i32 0
}
double jed2jd(dj)
double dj;
{
  double dj0, dt;
  dj0 = dj;
  dt = utdt(dj);
  dj = dj0 - (dt / 86400.0);
  dt = utdt(dj);
  return (dj - (dt / 86400.0));
}


x86 assembly (clang, -O0):
<jed2jd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <utdt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xeb2(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <utdt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe7e(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jed2jd>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x1,%al
call   1030 <utdt@plt>
cvtsi2sd %eax,%xmm1
divsd  0xed7(%rip),%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    $0x1,%al
call   1030 <utdt@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  0xeb3(%rip),%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @jed2jd(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %3
%6 = load double, double* %2
%7 = call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %6)
%8 = sitofp i32 %7 to double
store double %8, double* %4
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fdiv double %10, 8.640000e+04
%12 = fsub double %9, %11
store double %12, double* %2
%13 = load double, double* %2
%14 = call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %13)
%15 = sitofp i32 %14 to double
store double %15, double* %4
%16 = load double, double* %2
%17 = load double, double* %4
%18 = fdiv double %17, 8.640000e+04
%19 = fsub double %16, %18
ret double %19
}

LLVM IR (-O2):
define double @jed2jd(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 8.640000e+04
%5 = fsub double %0, %4
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %5)
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 8.640000e+04
%9 = fsub double %5, %8
ret double %9
}
int membase_close(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @membase_close() {
ret i32 1
}

LLVM IR (-O2):
define i32 @membase_close() {
ret i32 1
}
/* Type definitions */
struct stat {
  scalar_t__ st_uid;
};

/* Variables and functions */
scalar_t__ geteuid();
scalar_t__ stat(char const *, struct stat *);
int /*<<< orphan*/ unlink(char const *);
int check_file_owner(const char *path) {
  struct stat stats;
  if (stat(path, &stats) == 0 && stats.st_uid == geteuid()) {
    return 1;
  }
  unlink(path);
  return 0;
}


x86 assembly (clang, -O0):
<check_file_owner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <stat@plt>
cmp    $0x0,%rax
jne    117e <check_file_owner+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jne    117e <check_file_owner+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    118e <check_file_owner+0x5e>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file_owner>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1050 <stat@plt>
test   %rax,%rax
jne    115c <check_file_owner+0x2c>
mov    (%rsp),%r14
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    %rcx,%r14
je     1166 <check_file_owner+0x36>
mov    %rbx,%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @check_file_owner(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i64, i64* %9
%11 = call i64 (...) @geteuid()
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %17
14: ; preds = %8, %1
%15 = load i8*, i8** %3
%16 = call i32 @unlink(i8* %15)
store i32 0, i32* %2
br label %17
17: ; preds = %14, %13
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @check_file_owner(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i64, i64* %7
%9 = call i64 (...) @geteuid()
%10 = icmp eq i64 %8, %9
br i1 %10, label %13, label %11
11: ; preds = %6, %1
%12 = call i32 @unlink(i8* %0)
br label %13
13: ; preds = %6, %11
%14 = phi i32 [ 0, %11 ], [ 1, %6 ]
ret i32 %14
}
int sgn(int x) { return ((x == 0) ? 0 : (x < 0) ? -1 : 1); }


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <sgn+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <sgn+0x31>
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
mov    %edi,%eax
sar    $0x1f,%eax
or     $0x1,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @sgn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 1
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 0, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @sgn(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp sgt i32 %0, -1
%4 = select i1 %3, i32 1, i32 -1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
unsigned int w5100_readSn_byte(unsigned int, int);
unsigned w5100_readSnTX_WR(unsigned sock) {
  unsigned res = w5100_readSn_byte(sock, 0x0024);
  res = (res << 8) + w5100_readSn_byte(sock, 0x0024 + 1);
  return res;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x24,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x25,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x24,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %ebx,%edi
mov    $0x25,%esi
call   1030 <w5100_readSn_byte@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @w5100_readSnTX_WR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @w5100_readSn_byte(i32 %4, i32 36)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 8
%8 = load i32, i32* %2
%9 = call i32 @w5100_readSn_byte(i32 %8, i32 37)
%10 = add i32 %7, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @w5100_readSnTX_WR(i32 %0) {
%2 = tail call i32 @w5100_readSn_byte(i32 %0, i32 36)
%3 = shl i32 %2, 8
%4 = tail call i32 @w5100_readSn_byte(i32 %0, i32 37)
%5 = add i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dsInit(int);
int /*<<< orphan*/ kradActivate();
int /*<<< orphan*/ kramResetChannels(int);
int /*<<< orphan*/ kramSetMasterVol(int);
int /*<<< orphan*/ krapInit();
void kragInit(int stereo) {
  kramSetMasterVol(128);
  dsInit(stereo);
  kramResetChannels(1);
  kradActivate();
  krapInit();
}


x86 assembly (clang, -O0):
<kragInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80,%edi
call   1060 <kramSetMasterVol@plt>
mov    -0x4(%rbp),%edi
call   1050 <dsInit@plt>
mov    $0x1,%edi
call   1040 <kramResetChannels@plt>
mov    $0x0,%al
call   1070 <kradActivate@plt>
mov    $0x0,%al
call   1030 <krapInit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kragInit>:
push   %rbx
mov    %edi,%ebx
mov    $0x80,%edi
call   1060 <kramSetMasterVol@plt>
mov    %ebx,%edi
call   1050 <dsInit@plt>
mov    $0x1,%edi
call   1040 <kramResetChannels@plt>
xor    %eax,%eax
call   1070 <kradActivate@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <krapInit@plt>

LLVM IR (-O0):
define void @kragInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @kramSetMasterVol(i32 128)
%4 = load i32, i32* %2
%5 = call i32 @dsInit(i32 %4)
%6 = call i32 @kramResetChannels(i32 1)
%7 = call i32 (...) @kradActivate()
%8 = call i32 (...) @krapInit()
ret void
}

LLVM IR (-O2):
define void @kragInit(i32 %0) {
%2 = tail call i32 @kramSetMasterVol(i32 128)
%3 = tail call i32 @dsInit(i32 %0)
%4 = tail call i32 @kramResetChannels(i32 1)
%5 = tail call i32 (...) @kradActivate()
%6 = tail call i32 (...) @krapInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c_test3() { printf("c_test3\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"c_test3\00"
define void @c_test3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned long long vertical_mirror(unsigned long long b) {
  b = ((b >> 8) & 0x00FF00FF00FF00FFULL) | ((b << 8) & 0xFF00FF00FF00FF00ULL);
  b = ((b >> 16) & 0x0000FFFF0000FFFFULL) | ((b << 16) & 0xFFFF0000FFFF0000ULL);
  b = ((b >> 32) & 0x00000000FFFFFFFFULL) | ((b << 32) & 0xFFFFFFFF00000000ULL);
  return b;
}


x86 assembly (clang, -O0):
<vertical_mirror>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
movabs $0xff00ff00ff00ff,%rcx
and    %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x8,%rcx
movabs $0xff00ff00ff00ff00,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
movabs $0xffff0000ffff,%rcx
and    %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x10,%rcx
movabs $0xffff0000ffff0000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x20,%rcx
movabs $0xffffffff00000000,%rdx
ff ff ff
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @vertical_mirror(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 8
%5 = and i64 %4, 71777214294589695
%6 = load i64, i64* %2
%7 = shl i64 %6, 8
%8 = and i64 %7, -71777214294589696
%9 = or i64 %5, %8
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = lshr i64 %10, 16
%12 = and i64 %11, 281470681808895
%13 = load i64, i64* %2
%14 = shl i64 %13, 16
%15 = and i64 %14, -281470681808896
%16 = or i64 %12, %15
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 32
%19 = and i64 %18, 4294967295
%20 = load i64, i64* %2
%21 = shl i64 %20, 32
%22 = and i64 %21, -4294967296
%23 = or i64 %19, %22
store i64 %23, i64* %2
%24 = load i64, i64* %2
ret i64 %24
}

LLVM IR (-O2):
define i64 @vertical_mirror(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void main() {
  char str1[15],
      str2[155] = "C language, this is the so much first time for me to learn";
  strcpy(str1, str2);
  puts(str1);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
lea    -0xb0(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0x9b,%edx
call   1060 <memcpy@plt>
lea    -0xf(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xf(%rbp),%rdi
call   1040 <puts@plt>
lea    0xf18(%rip),%rdi
call   1050 <printf@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xb8,%rsp
lea    0xeaf(%rip),%rsi
lea    0x10(%rsp),%r14
mov    $0x9b,%edx
mov    %r14,%rdi
call   1060 <memcpy@plt>
lea    0x1(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xb8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str2 = [155 x i8] c"C language, this is the so much first time for me to learn\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca [15 x i8]
%2 = alloca [155 x i8]
%3 = bitcast [155 x i8]* %2 to i8*
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [155 x i8], [155 x i8]* %2, i64 0, i64 0
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.main.str2 = [155 x i8] c"C language, this is the so much first time for me to learn\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @main() {
%1 = alloca [15 x i8]
%2 = alloca [155 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [155 x i8], [155 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %3, i8* %4)
%6 = call i32 @puts(i8* %3)
%7 = call i32 @putchar(i32 10)
ret void
}
float jc_if_truncate(float v) {
  return (v > 255.0f) ? 255.0f : ((v < 0) ? 0.0f : v);
}


x86 assembly (clang, -O0):
<jc_if_truncate>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1131 <jc_if_truncate+0x31>
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    115f <jc_if_truncate+0x5f>
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    114b <jc_if_truncate+0x4b>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1155 <jc_if_truncate+0x55>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jc_if_truncate>:
xorps  %xmm2,%xmm2
maxss  %xmm0,%xmm2
movss  0xef1(%rip),%xmm3
movaps %xmm3,%xmm1
cmpltss %xmm0,%xmm1
movaps %xmm1,%xmm0
andnps %xmm2,%xmm0
andps  %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @jc_if_truncate(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 2.550000e+02
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load float, float* %2
%8 = fcmp olt float %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load float, float* %2
br label %12
12: ; preds = %10, %9
%13 = phi float [ 0.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi float [ 2.550000e+02, %5 ], [ %13, %12 ]
ret float %15
}

LLVM IR (-O2):
define float @jc_if_truncate(float %0) {
%2 = fcmp ogt float %0, 2.550000e+02
%3 = fcmp olt float %0, 0.000000e+00
%4 = select i1 %3, float 0.000000e+00, float %0
%5 = select i1 %2, float 2.550000e+02, float %4
ret float %5
}
void exynos_report_trigger(struct thermal_sensor_conf *sensor_conf) { return; }


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

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

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

LLVM IR (-O2):
%struct.thermal_sensor_conf = type opaque
define void @exynos_report_trigger(%struct.thermal_sensor_conf* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
scalar_t__ setlocale(int /*<<< orphan*/, char const *);
int setchrset(const char *chrset) {
  if (chrset && setlocale(LC_CTYPE, chrset)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<setchrset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114f <setchrset+0x3f>
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <setlocale@plt>
cmp    $0x0,%rax
je     114f <setchrset+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <setchrset+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setchrset>:
test   %rdi,%rdi
je     113a <setchrset+0x2a>
push   %rax
mov    %rdi,%rsi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <setlocale@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
lea    0x8(%rsp),%rsp
je     113a <setchrset+0x2a>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@LC_CTYPE = global i32 0
define i32 @setchrset(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @LC_CTYPE
%5 = tail call i64 @setlocale(i32 %4, i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3, %1
br label %8
8: ; preds = %3, %7
%9 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %9
}
int foo6(int a, int b[a][a], int c[sizeof(*b)]) { return sizeof(c); }


x86 assembly (clang, -O0):
<foo6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo6(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 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = load i32*, i32** %5
%12 = mul nuw i64 4, %10
ret i32 8
}

LLVM IR (-O2):
define i32 @foo6(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void fib(int n) {
  int a = 0, b = 1;
  while (n--) {
    printf("%d ", a);
    b += a;
    a = b - a;
  }
  puts("");
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1173 <fib+0x53>
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <fib+0x19>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     115a <fib+0x3a>
mov    %edi,%ebx
xor    %ebp,%ebp
mov    $0x1,%eax
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %eax,%r15d
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
add    %r15d,%ebp
mov    %ebp,%eax
mov    %r15d,%ebp
add    $0xffffffff,%ebx
jne    1140 <fib+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @fib(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 1, %1 ]
%5 = phi i32 [ %4, %3 ], [ 0, %1 ]
%6 = phi i32 [ %7, %3 ], [ %0, %1 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%9 = add nsw i32 %4, %5
%10 = icmp eq i32 %7, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = tail call i32 @putchar(i32 10)
ret void
}
int is_digit(ch)
int ch;
{ return ((ch >= '0') && (ch <= '9')); }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_digit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *require_nvm(void *file_name, void *base_addr, size_t size) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @require_nvm(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* null
}