xunge/DecIR huggingface dataset:
void nmea_unload_parsers() {}


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

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

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

LLVM IR (-O2):
define void @nmea_unload_parsers() {
ret void
}
/* Variables and functions */
unsigned long long strtoull(char const *, int /*<<< orphan*/ *, int);
unsigned long long libconfig_parse_hex64(const char *s) {
  return (strtoull(s, NULL, 16));
}


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

x86 assembly (clang, -O2):
<libconfig_parse_hex64>:
xor    %esi,%esi
mov    $0x10,%edx
jmp    1030 <strtoull@plt>

LLVM IR (-O0):
define i64 @libconfig_parse_hex64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtoull(i8* %3, i32* null, i32 16)
ret i64 %4
}

LLVM IR (-O2):
define i64 @libconfig_parse_hex64(i8* nocapture %0) {
%2 = tail call i64 @strtoull(i8* nocapture %0, i32* null, i32 16)
ret i64 %2
}
void get_ebp(unsigned long *ebp) {
  __asm__ __volatile__("mov %%ebp, %0 \r\n" : "=m"(*ebp)::"memory");
}


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

x86 assembly (clang, -O2):
<get_ebp>:
mov    %ebp,(%rdi)
ret

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

LLVM IR (-O2):
define void @get_ebp(i64* %0) {
tail call void asm sideeffect "mov %ebp, $0 \0D\0A", "=*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0)
ret void
}
/* Type definitions */
struct solver {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printCore(struct solver *);
int /*<<< orphan*/ printProof(struct solver *);
int /*<<< orphan*/ printTrace(struct solver *);
void postprocess(struct solver *S) {
  printCore(S);
  printProof(S);
  printTrace(S);
}


x86 assembly (clang, -O0):
<postprocess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printCore@plt>
mov    -0x8(%rbp),%rdi
call   1040 <printProof@plt>
mov    -0x8(%rbp),%rdi
call   1050 <printTrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<postprocess>:
push   %rbx
mov    %rdi,%rbx
call   1030 <printCore@plt>
mov    %rbx,%rdi
call   1040 <printProof@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <printTrace@plt>

LLVM IR (-O0):
%struct.solver = type { i32 }
define void @postprocess(%struct.solver* %0) {
%2 = alloca %struct.solver*
store %struct.solver* %0, %struct.solver** %2
%3 = load %struct.solver*, %struct.solver** %2
%4 = call i32 @printCore(%struct.solver* %3)
%5 = load %struct.solver*, %struct.solver** %2
%6 = call i32 @printProof(%struct.solver* %5)
%7 = load %struct.solver*, %struct.solver** %2
%8 = call i32 @printTrace(%struct.solver* %7)
ret void
}

LLVM IR (-O2):
%struct.solver = type { i32 }
define void @postprocess(%struct.solver* %0) {
%2 = tail call i32 @printCore(%struct.solver* %0)
%3 = tail call i32 @printProof(%struct.solver* %0)
%4 = tail call i32 @printTrace(%struct.solver* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _delay_ms(int);
int /*<<< orphan*/ clearCube();
int /*<<< orphan*/ fullCube();
void flashCube() {
  fullCube();
  _delay_ms(500);
  clearCube();
  _delay_ms(500);
}


x86 assembly (clang, -O0):
<flashCube>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fullCube@plt>
mov    $0x1f4,%edi
call   1050 <_delay_ms@plt>
mov    $0x0,%al
call   1040 <clearCube@plt>
mov    $0x1f4,%edi
call   1050 <_delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flashCube>:
push   %rax
xor    %eax,%eax
call   1030 <fullCube@plt>
mov    $0x1f4,%edi
call   1050 <_delay_ms@plt>
xor    %eax,%eax
call   1040 <clearCube@plt>
mov    $0x1f4,%edi
pop    %rax
jmp    1050 <_delay_ms@plt>

LLVM IR (-O0):
define void @flashCube() {
%1 = call i32 (...) @fullCube()
%2 = call i32 @_delay_ms(i32 500)
%3 = call i32 (...) @clearCube()
%4 = call i32 @_delay_ms(i32 500)
ret void
}

LLVM IR (-O2):
define void @flashCube() {
%1 = tail call i32 (...) @fullCube()
%2 = tail call i32 @_delay_ms(i32 500)
%3 = tail call i32 (...) @clearCube()
%4 = tail call i32 @_delay_ms(i32 500)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_message(char *, char *);
void yyerror(char *s) { error_message("%s\n", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <error_message@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error_message(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @error_message(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ foo();
int main(void) {
  if (foo())
    exit(0);
  else
    abort();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1157 <main+0x27>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
test   %rax,%rax
jne    1144 <main+0x14>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) void BEUnpackInt32(int32_t *data,
                                            const uint8_t container[4]) {
  *data = (int32_t)container[3] | ((int32_t)container[2] << 8) |
          ((int32_t)container[1] << 16) | ((int32_t)container[0] << 24);
}


x86 assembly (clang, -O0):
<BEUnpackInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEUnpackInt32>:
mov    0x10(%rsi),%eax
shl    $0x8,%eax
or     0x18(%rsi),%eax
mov    (%rsi),%ecx
mov    0x8(%rsi),%edx
shl    $0x10,%edx
shl    $0x18,%ecx
or     %edx,%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @BEUnpackInt32(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
store i32* %0, i32** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 3
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = load i64*, i64** %4
%10 = getelementptr inbounds i64, i64* %9, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = load i64*, i64** %4
%16 = getelementptr inbounds i64, i64* %15, i64 1
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = shl i32 %18, 16
%20 = or i32 %14, %19
%21 = load i64*, i64** %4
%22 = getelementptr inbounds i64, i64* %21, i64 0
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i32
%25 = shl i32 %24, 24
%26 = or i32 %20, %25
%27 = load i32*, i32** %3
store i32 %26, i32* %27
ret void
}

LLVM IR (-O2):
define void @BEUnpackInt32(i32* nocapture writeonly %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 3
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds i64, i64* %1, i64 2
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %9, %5
%11 = getelementptr inbounds i64, i64* %1, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
%16 = load i64, i64* %1
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 24
%19 = or i32 %15, %18
store i32 %19, i32* %0
ret void
}
/* Variables and functions */
double sin(double);
double hw1(double r1, double r2) {
  double s;
  s = sin(r1 + r2);
  return s;
}


x86 assembly (clang, -O0):
<hw1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hw1>:
addsd  %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @hw1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = call double @sin(double %8)
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @hw1(double %0, double %1) {
%3 = fadd double %0, %1
%4 = tail call double @sin(double %3)
ret double %4
}
/* Variables and functions */
int syscall(int, char const *, char const *, void const *, size_t, int);
int setxattr(const char *path, const char *name, const void *value, size_t size,
             int flags) {
  return syscall(226, path, name, value, size, flags);
}


x86 assembly (clang, -O0):
<setxattr>:
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    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0xe2,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setxattr>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xe2,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @setxattr(i8* %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = tail call i32 @syscall(i32 226, i8* %0, i8* %1, i8* %2, i64 %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ io_program_out(int, int);
void pic14_increment_address(void) { io_program_out(0x06, 6); }


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

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

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

LLVM IR (-O2):
define void @pic14_increment_address() {
%1 = tail call i32 @io_program_out(i32 6, i32 6)
ret void
}
void *emitToBuffer(void *bufptr, char c) {
  *(char *)bufptr = c;
  return (char *)bufptr + 1;
}


x86 assembly (clang, -O0):
<emitToBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<emitToBuffer>:
mov    %sil,(%rdi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @emitToBuffer(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
store i8 %5, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
ret i8* %8
}

LLVM IR (-O2):
define i8* @emitToBuffer(i8* writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %3
}
void ff_hevc_put_hevc_uni_epel_v24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v24_8_sse4() {
ret void
}
/* Variables and functions */
float scalbnf(float, int);
float scalblnf(float x, long n) {
  return (scalbnf(x, (n > 65536) ? 65536 : (n < -65536) ? -65536 : (int)n));
}


x86 assembly (clang, -O0):
<scalblnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cmpq   $0x10000,-0x10(%rbp)
jle    1146 <scalblnf+0x36>
mov    $0x10000,%eax
mov    %eax,-0x18(%rbp)
jmp    116e <scalblnf+0x5e>
cmpq   $0xffffffffffff0000,-0x10(%rbp)
ff
jge    1161 <scalblnf+0x51>
mov    $0xffff0000,%eax
mov    %eax,-0x1c(%rbp)
jmp    1168 <scalblnf+0x58>
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x18(%rbp),%edi
call   1030 <scalbnf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalblnf>:
cmp    $0xffffffffffff0001,%rdi
mov    $0xffffffffffff0000,%rax
cmovl  %rax,%rdi
cmp    $0x10000,%rdi
mov    $0x10000,%eax
cmovge %eax,%edi
jmp    1030 <scalbnf@plt>

LLVM IR (-O0):
define float @scalblnf(float %0, i64 %1) {
%3 = alloca float
%4 = alloca i64
store float %0, float* %3
store i64 %1, i64* %4
%5 = load float, float* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %6, 65536
br i1 %7, label %8, label %9
8: ; preds = %2
br label %18
9: ; preds = %2
%10 = load i64, i64* %4
%11 = icmp slt i64 %10, -65536
br i1 %11, label %12, label %13
12: ; preds = %9
br label %16
13: ; preds = %9
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %13, %12
%17 = phi i32 [ -65536, %12 ], [ %15, %13 ]
br label %18
18: ; preds = %16, %8
%19 = phi i32 [ 65536, %8 ], [ %17, %16 ]
%20 = call float @scalbnf(float %5, i32 %19)
ret float %20
}

LLVM IR (-O2):
define float @scalblnf(float %0, i64 %1) {
%3 = icmp sgt i64 %1, -65536
%4 = select i1 %3, i64 %1, i64 -65536
%5 = icmp slt i64 %4, 65536
%6 = select i1 %5, i64 %4, i64 65536
%7 = trunc i64 %6 to i32
%8 = tail call float @scalbnf(float %0, i32 %7)
ret float %8
}
/* Variables and functions */
long SelectOneRecordWithHMACAndECMAC(int);
long SelectOneRecordWithHMACAndCircularECMAC(int id) {
  return SelectOneRecordWithHMACAndECMAC(id);
}


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

x86 assembly (clang, -O2):
<SelectOneRecordWithHMACAndCircularECMAC>:
jmp    1030 <SelectOneRecordWithHMACAndECMAC@plt>

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

LLVM IR (-O2):
define i64 @SelectOneRecordWithHMACAndCircularECMAC(i32 %0) {
%2 = tail call i64 @SelectOneRecordWithHMACAndECMAC(i32 %0)
ret i64 %2
}
/* Variables and functions */
scalar_t__ calloc(size_t, size_t);
int *ivector(int nlow, int nhigh) {
  int *data = NULL;
  data = (int *)calloc((size_t)(nhigh - nlow + 1 + 1), (size_t)sizeof(int));
  return data - nlow + 1;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x1,%eax
movslq %eax,%rdi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
add    $0x2,%esi
movslq %esi,%rdi
mov    $0x4,%esi
call   1030 <calloc@plt>
movslq %ebx,%rcx
shl    $0x2,%rcx
neg    %rcx
add    %rcx,%rax
add    $0x4,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @ivector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32* null, i32** %5
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = call i64 @calloc(i64 %11, i64 4)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = sub i64 0, %16
%18 = getelementptr inbounds i32, i32* %14, i64 %17
%19 = getelementptr inbounds i32, i32* %18, i64 1
ret i32* %19
}

LLVM IR (-O2):
define i32* @ivector(i32 %0, i32 %1) {
%3 = sub i32 2, %0
%4 = add i32 %3, %1
%5 = sext i32 %4 to i64
%6 = tail call i64 @calloc(i64 %5, i64 4)
%7 = inttoptr i64 %6 to i32*
%8 = sext i32 %0 to i64
%9 = sub nsw i64 0, %8
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
ret i32* %11
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgdiv(void) {
  gen("cdq");
  gen("idivl\t%ecx");
}


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

x86 assembly (clang, -O2):
<cgdiv>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <gen@plt>
lea    0xee0(%rip),%rdi
pop    %rax
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cdq\00"
@.str.1 = [11 x i8] c"idivl\09%ecx\00"
define void @cgdiv() {
%1 = call i32 @gen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cdq\00"
@.str.1 = [11 x i8] c"idivl\09%ecx\00"
define void @cgdiv() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _tfseof(int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_tfseof(int tfd) {
  int ret;
  monLock();
  ret = _tfseof(tfd);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_tfseof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x4(%rbp),%edi
call   1030 <_tfseof@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_tfseof>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %ebx,%edi
call   1030 <_tfseof@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mon_tfseof(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @monLock()
%5 = load i32, i32* %2
%6 = call i32 @_tfseof(i32 %5)
store i32 %6, i32* %3
%7 = call i32 (...) @monUnlock()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @mon_tfseof(i32 %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call i32 @_tfseof(i32 %0)
%4 = tail call i32 (...) @monUnlock()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo1();
int /*<<< orphan*/ foo4();
void __attribute__((near)) foo3(void) {
  foo1();
  foo4();
}


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

x86 assembly (clang, -O2):
<foo3>:
push   %rax
xor    %eax,%eax
call   1040 <foo1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo4@plt>

LLVM IR (-O0):
define void @foo3() {
%1 = call i32 (...) @foo1()
%2 = call i32 (...) @foo4()
ret void
}

LLVM IR (-O2):
define void @foo3() {
%1 = tail call i32 (...) @foo1()
%2 = tail call i32 (...) @foo4()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int my_favorite_number();
int main(int argc, char **argv) {
  assert(my_favorite_number() == 4);
  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   1040 <my_favorite_number@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <my_favorite_number@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1030 <assert@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 (...) @my_favorite_number()
%7 = icmp eq i32 %6, 4
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @my_favorite_number()
%4 = icmp eq i32 %3, 4
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_poll(int /*<<< orphan*/, int /*<<< orphan*/, int);
void TIME_Wait(int nDelay) { do_poll(0, 0, nDelay); }


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

x86 assembly (clang, -O2):
<TIME_Wait>:
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <do_poll@plt>

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

LLVM IR (-O2):
define void @TIME_Wait(i32 %0) {
%2 = tail call i32 @do_poll(i32 0, i32 0, i32 %0)
ret void
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *FSEv06_getErrorName(size_t code) { return ERR_getErrorName(code); }


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

x86 assembly (clang, -O2):
<FSEv06_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

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

LLVM IR (-O2):
define i8* @FSEv06_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ XML_Char;

/* Variables and functions */
void xml_status_tag_end(void *ud, const XML_Char *name) {}


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

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

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

LLVM IR (-O2):
define void @xml_status_tag_end(i8* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
long lmax(long, long);
long lmaxa(long a[], int length) {
  long max = a[0];
  int i;
  for (i = 0; i < length; i++) {
    max = lmax(max, a[i]);
  }
  return max;
}


x86 assembly (clang, -O0):
<lmaxa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <lmaxa+0x54>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <lmax@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <lmaxa+0x21>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmaxa>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%rax
test   %esi,%esi
jle    1155 <lmaxa+0x45>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %rax,%rdi
mov    %rax,%rsi
call   1030 <lmax@plt>
cmp    $0x1,%ebp
je     1155 <lmaxa+0x45>
mov    %ebp,%ebp
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rsi
mov    %rax,%rdi
call   1030 <lmax@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <lmaxa+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @lmaxa(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
store i64 %9, i64* %5
store i32 0, i32* %6
br label %10
10: ; preds = %22, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = load i64, i64* %5
%16 = load i64*, i64** %3
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i64, i64* %16, i64 %18
%20 = load i64, i64* %19
%21 = call i64 @lmax(i64 %15, i64 %20)
store i64 %21, i64* %5
br label %22
22: ; preds = %14
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %10
25: ; preds = %10
%26 = load i64, i64* %5
ret i64 %26
}

LLVM IR (-O2):
define i64 @lmaxa(i64* nocapture %0, i32 %1) {
%3 = load i64, i64* %0
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = zext i32 %1 to i64
%7 = tail call i64 @lmax(i64 %3, i64 %3)
%8 = icmp eq i32 %1, 1
br i1 %8, label %17, label %9
9: ; preds = %5, %9
%10 = phi i64 [ %15, %9 ], [ 1, %5 ]
%11 = phi i64 [ %14, %9 ], [ %7, %5 ]
%12 = getelementptr inbounds i64, i64* %0, i64 %10
%13 = load i64, i64* %12
%14 = tail call i64 @lmax(i64 %11, i64 %13)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %17, label %9
17: ; preds = %9, %5, %2
%18 = phi i64 [ %3, %2 ], [ %7, %5 ], [ %14, %9 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ z80_gen_all();
int main(int argc, char **argv) {
  z80_gen_all();
  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 <z80_gen_all@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <z80_gen_all@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 (...) @z80_gen_all()
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @H010ToAR30() {
ret void
}
double jac_djacobi_P1(double x, double a, double b) {
  return 0.5 * (a + b + 2.0);
}


x86 assembly (clang, -O0):
<jac_djacobi_P1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xee3(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xecf(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_djacobi_P1>:
movapd %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  0xef0(%rip),%xmm0
mulsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @jac_djacobi_P1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = fadd double %7, %8
%10 = fadd double %9, 2.000000e+00
%11 = fmul double 5.000000e-01, %10
ret double %11
}

LLVM IR (-O2):
define double @jac_djacobi_P1(double %0, double %1, double %2) {
%4 = fadd double %1, %2
%5 = fadd double %4, 2.000000e+00
%6 = fmul double %5, 5.000000e-01
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_epi16(int /*<<< orphan*/ const,
                                  int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_srai_epi16(int /*<<< orphan*/ const, int const);
__m128i mm_round_epi16_sse2(const __m128i *const src,
                            const __m128i *const half_depth, const int depth) {
  const __m128i nearest_src = _mm_adds_epi16(*src, *half_depth);
  return _mm_srai_epi16(nearest_src, depth);
}


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

x86 assembly (clang, -O2):
<mm_round_epi16_sse2>:
push   %rbx
mov    %edx,%ebx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <_mm_adds_epi16@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <_mm_srai_epi16@plt>

LLVM IR (-O0):
define i32 @mm_round_epi16_sse2(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = call i32 @_mm_adds_epi16(i32 %9, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = call i32 @_mm_srai_epi16(i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mm_round_epi16_sse2(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @_mm_adds_epi16(i32 %4, i32 %5)
%7 = tail call i32 @_mm_srai_epi16(i32 %6, i32 %2)
ret i32 %7
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ printf(char *, double);
double sqroot(float, float);
int main(int argc, char *argv[]) {
  float num, epsilon;
  num = atof(argv[1]);
  epsilon = atof(argv[2]);
  printf("%f\n", sqroot(num, epsilon));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
call   1050 <sqroot@plt>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
movss  %xmm0,0xc(%rsp)
mov    0x10(%rbx),%rdi
call   1030 <atof@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
call   1050 <sqroot@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call float @atof(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call float @atof(i8* %7)
%9 = tail call double @sqroot(float %5, float %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
int ecma119_node_cmp_flag(void const *, void const *, int);
int ecma119_node_cmp_hard(const void *v1, const void *v2) {
  return ecma119_node_cmp_flag(v1, v2, 1);
}


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

x86 assembly (clang, -O2):
<ecma119_node_cmp_hard>:
mov    $0x1,%edx
jmp    1030 <ecma119_node_cmp_flag@plt>

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

LLVM IR (-O2):
define i32 @ecma119_node_cmp_hard(i8* %0, i8* %1) {
%3 = tail call i32 @ecma119_node_cmp_flag(i8* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int max(int, int);
int min(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x, y;
  x = 10;
  y = 20;
  printf("max=%d\n", max(x, y));
  printf("min=%d\n", min(x, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <max@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <min@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1050 <max@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <min@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"max=%d\0A\00"
@.str.1 = [8 x i8] c"min=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @max(i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @min(i32 10, i32 20)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
int search(val, table, size)
int val;
short *table;
int size;
{
  int i;
  for (i = 0; i < size; i++) {
    if (val <= *table++)
      return (i);
  }
  return (size);
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115c <search+0x5c>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x2,%rdx
mov    %rdx,-0x10(%rbp)
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1149 <search+0x49>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <search+0x62>
jmp    114e <search+0x4e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <search+0x15>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %edx,%eax
test   %edx,%edx
jle    1120 <search+0x20>
mov    %eax,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movswl (%rsi,%rcx,2),%edx
cmp    %edi,%edx
jge    1121 <search+0x21>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32 %0, i16* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3, %11
%6 = phi i32 [ %13, %11 ], [ 0, %3 ]
%7 = phi i16* [ %12, %11 ], [ %1, %3 ]
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
%10 = icmp slt i32 %9, %0
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = getelementptr inbounds i16, i16* %7, i64 1
%13 = add nuw nsw i32 %6, 1
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %5
15: ; preds = %5, %11, %3
%16 = phi i32 [ %2, %3 ], [ %2, %11 ], [ %6, %5 ]
ret i32 %16
}
void updateMode(unsigned char mode, unsigned int *reg) {
  reg -= 2;
  *reg &= ~0x1f;
  *reg |= mode;
}


x86 assembly (clang, -O0):
<updateMode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
and    $0xffffffe0,%ecx
mov    %ecx,(%rax)
movzbl -0x1(%rbp),%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateMode>:
mov    -0x8(%rsi),%eax
and    $0xffffffe0,%eax
or     %edi,%eax
mov    %eax,-0x8(%rsi)
ret

LLVM IR (-O0):
define void @updateMode(i8 zeroext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 -2
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = and i32 %8, -32
store i32 %9, i32* %7
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = or i32 %13, %11
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @updateMode(i8 zeroext %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 -2
%4 = load i32, i32* %3
%5 = and i32 %4, -32
%6 = zext i8 %0 to i32
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void rws_free(void *mem) {
  if (mem) {
    free(mem);
  }
}


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

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

LLVM IR (-O0):
define void @rws_free(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 @rws_free(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 */
int /*<<< orphan*/ setup_resource_map_x_offset(unsigned int const *, int,
                                               int /*<<< orphan*/,
                                               int /*<<< orphan*/);
void setup_resource_map_x(const unsigned int *register_values, int max) {
  setup_resource_map_x_offset(register_values, max, 0, 0);
}


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

x86 assembly (clang, -O2):
<setup_resource_map_x>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <setup_resource_map_x_offset@plt>

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

LLVM IR (-O2):
define void @setup_resource_map_x(i32* %0, i32 %1) {
%3 = tail call i32 @setup_resource_map_x_offset(i32* %0, i32 %1, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int strlen(char const *);
int length(const char *a) {
  if (a == NULL) {
    fprintf(stderr, "NULL Pointer Exception at length\n");
    exit(-1);
  }
  return strlen(a) + 1;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1166 <length+0x36>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
push   %rax
test   %rdi,%rdi
je     1140 <length+0x10>
call   1030 <strlen@plt>
add    $0x1,%eax
pop    %rcx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"NULL Pointer Exception at length\0A\00"
define i32 @length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = add nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"NULL Pointer Exception at length\0A\00"
define i32 @length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
%8 = tail call i32 @strlen(i8* %0)
%9 = add nsw i32 %8, 1
ret i32 %9
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createEqExpression(struct memorycontainer *expression1,
                   struct memorycontainer *expression2) {
  return createExpression(0x0005, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createEqExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x5,%edi
jmp    1030 <createExpression@plt>

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

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createEqExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 5, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int _close(int fd) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_close>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @_close(i32 %0) {
%2 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pres_terminate_req_all();
void CC_BLF_unsudirribe_All() { pres_terminate_req_all(); }


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

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

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

LLVM IR (-O2):
define void @CC_BLF_unsudirribe_All() {
%1 = tail call i32 (...) @pres_terminate_req_all()
ret void
}