xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void puterr(const char *file, int line, const char *msg) {
  (void)fprintf(stderr, "%s:%d: %s\n", file, line, msg);
}


x86 assembly (clang, -O0):
<puterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puterr>:
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"%s:%d: %s\0A\00"
define void @puterr(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"%s:%d: %s\0A\00"
define void @puterr(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeWakeHigh(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000000);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000001, 0x00000208);
}


x86 assembly (clang, -O0):
<GPIOPinTypeWakeHigh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
mov    $0x208,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeWakeHigh>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edx,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x208,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeWakeHigh(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 @GPIODirModeSet(i32 %5, i32 %6, i32 0)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 1, i32 520)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeWakeHigh(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 0)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 1, i32 520)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ leave_playpen();
void cleanup(int sig) {
  static int in_cleanup = 0;
  if (!in_cleanup) {
    in_cleanup = 1;
    leave_playpen();
  }
  if (sig)
    exit(1);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,0x2f02(%rip)
jne    1149 <cleanup+0x29>
movl   $0x1,0x2ef2(%rip)
mov    $0x0,%al
call   1030 <leave_playpen@plt>
cmpl   $0x0,-0x4(%rbp)
je     115d <cleanup+0x3d>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %edi,%ebx
cmpb   $0x0,0x2f0a(%rip)
jne    113a <cleanup+0x1a>
movb   $0x1,0x2f01(%rip)
xor    %eax,%eax
call   1030 <leave_playpen@plt>
test   %ebx,%ebx
jne    1140 <cleanup+0x20>
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@cleanup.in_cleanup = internal global i32 0
define void @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @cleanup.in_cleanup
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
store i32 1, i32* @cleanup.in_cleanup
%6 = call i32 (...) @leave_playpen()
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %7
ret void
}

LLVM IR (-O2):
@cleanup.in_cleanup = internal unnamed_addr global i1 false
define void @cleanup(i32 %0) {
%2 = load i1, i1* @cleanup.in_cleanup
br i1 %2, label %5, label %3
3: ; preds = %1
store i1 true, i1* @cleanup.in_cleanup
%4 = tail call i32 (...) @leave_playpen()
br label %5
5: ; preds = %3, %1
%6 = icmp eq i32 %0, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %5
ret void
}
__attribute__((always_)) void outsb(unsigned short port, const void *addr,
                                    unsigned long count) {
  asm volatile("rep ; outs"
               "b"
               : "=S"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
rep outsb %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsb>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsb %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
main() {
  double sum, term;
  sum = 0.0;
  term = 0.5;
  while (sum != sum + term) {
    sum += term;
    term /= 2;
  }
  printf("The sum of Zeno's series is %g\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    1158 <main+0x48>
jp     1158 <main+0x48>
jmp    1182 <main+0x72>
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe94(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1134 <main+0x24>
movsd  -0x10(%rbp),%xmm0
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm1
movapd %xmm1,%xmm2
movapd %xmm1,%xmm3
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movapd %xmm2,%xmm0
mulsd  %xmm1,%xmm3
addsd  %xmm3,%xmm2
ucomisd %xmm2,%xmm0
jne    1130 <main+0x20>
jp     1130 <main+0x20>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"The sum of Zeno's series is %g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 5.000000e-01, double* %3
br label %4
4: ; preds = %10, %0
%5 = load double, double* %2
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fadd double %6, %7
%9 = fcmp une double %5, %8
br i1 %9, label %10, label %16
10: ; preds = %4
%11 = load double, double* %3
%12 = load double, double* %2
%13 = fadd double %12, %11
store double %13, double* %2
%14 = load double, double* %3
%15 = fdiv double %14, 2.000000e+00
store double %15, double* %3
br label %4
16: ; preds = %4
%17 = load double, double* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %17)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [32 x i8] c"The sum of Zeno's series is %g\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi double [ 5.000000e-01, %0 ], [ %5, %1 ]
%3 = phi double [ 5.000000e-01, %0 ], [ %4, %1 ]
%4 = fmul double %3, 5.000000e-01
%5 = fadd double %2, %4
%6 = fcmp une double %2, %5
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}
int end_farm() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @end_farm() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printArray(char *, int *);
int main() {
  int array[20] = {19, 18, 17, 16, 15, 14, 13, 12, 11, 20,
                   1,  2,  3,  4,  5,  6,  7,  8,  9,  10};
  printArray("Original Array: ", array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x50,%edx
call   1030 <memcpy@plt>
lea    -0x60(%rbp),%rsi
lea    0xf01(%rip),%rdi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xefa(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printArray@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [20 x i32] [i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 20, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [17 x i8] c"Original Array: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
store i32 0, i32* %1
%3 = bitcast [20 x i32]* %2 to i8*
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%5 = call i32 @printArray(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [20 x i32] [i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 20, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [17 x i8] c"Original Array: \00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vid_writef(char *);
void newline_handler(void) { vid_writef("\n"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @newline_handler() {
%1 = tail call i32 @vid_writef(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_extract_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_insert_pi16(int /*<<< orphan*/, int /*<<< orphan*/, int);
__m64 test_ins_ext(__m64 a) {
  return _mm_insert_pi16(a, _mm_extract_pi16(a, 0), 3);
}


x86 assembly (clang, -O0):
<test_ins_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <_mm_extract_pi16@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
mov    $0x3,%edx
call   1030 <_mm_insert_pi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ins_ext>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1040 <_mm_extract_pi16@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    $0x3,%edx
pop    %rbx
jmp    1030 <_mm_insert_pi16@plt>

LLVM IR (-O0):
define i32 @test_ins_ext(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_mm_extract_pi16(i32 %4, i32 0)
%6 = call i32 @_mm_insert_pi16(i32 %3, i32 %5, i32 3)
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_ins_ext(i32 %0) {
%2 = tail call i32 @_mm_extract_pi16(i32 %0, i32 0)
%3 = tail call i32 @_mm_insert_pi16(i32 %0, i32 %2, i32 3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_id_set();
int main() {
  test_id_set();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_id_set()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_id_set()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  short y;
};
typedef TYPE_1__ XArc;

/* Variables and functions */
void set_XArc_y(void *_p, short _v) { ((XArc *)_p)->y = (short)_v; }


x86 assembly (clang, -O0):
<set_XArc_y>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XArc_y>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XArc_y(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XArc_y(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strlen(char *);
char *get_exec_cmd(char *expression) {
  char *format = "printf '0x%%x\n' $[%s]";
  char *exec_cmd = malloc(strlen(expression) + strlen(format));
  sprintf(exec_cmd, format, expression);
  return exec_cmd;
}


x86 assembly (clang, -O0):
<get_exec_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_exec_cmd>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x15(%rax),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeb1(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"printf '0x%%x\0A' $[%s]\00"
define i8* @get_exec_cmd(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %6, %8
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @sprintf(i8* %11, i8* %12, i8* %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"printf '0x%%x\0A' $[%s]\00"
define noalias i8* @get_exec_cmd(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 21
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %4
}
/* Variables and functions */
double rand();
double random_double() { return rand(); }


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

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

LLVM IR (-O0):
define double @random_double() {
%1 = call double (...) @rand()
ret double %1
}

LLVM IR (-O2):
define double @random_double() {
%1 = tail call double (...) @rand()
ret double %1
}
/* Variables and functions */
double __nv_erfc(double);
double erfc(double __a) { return __nv_erfc(__a); }


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

x86 assembly (clang, -O2):
<erfc>:
jmp    1030 <__nv_erfc@plt>

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

LLVM IR (-O2):
define double @erfc(double %0) {
%2 = tail call double @__nv_erfc(double %0)
ret double %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMREF_set(void) { return U_WMRCORENONE_set("U_WMREF"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMREF\00"
define i8* @U_WMREF_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ vga_clear_screen();
void vga_text_clear_screen(void) { vga_clear_screen(); }


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

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

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

LLVM IR (-O2):
define void @vga_text_clear_screen() {
%1 = tail call i32 (...) @vga_clear_screen()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int close_modem(int fd) {
  close(fd);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @close_modem(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
unsigned long int system_get_memory_cache() { return 0; }


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

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

LLVM IR (-O0):
define i64 @system_get_memory_cache() {
ret i64 0
}

LLVM IR (-O2):
define i64 @system_get_memory_cache() {
ret i64 0
}
/* Variables and functions */
long grg_get_double_grid_index(long const *, long const *, long const *);
long ksp_get_double_grgrid_index(const long address_double[3],
                                 const long D_diag[3], const long PS[3]) {
  return grg_get_double_grid_index(address_double, D_diag, PS);
}


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

x86 assembly (clang, -O2):
<ksp_get_double_grgrid_index>:
jmp    1030 <grg_get_double_grid_index@plt>

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

LLVM IR (-O2):
define i64 @ksp_get_double_grgrid_index(i64* %0, i64* %1, i64* %2) {
%4 = tail call i64 @grg_get_double_grid_index(i64* %0, i64* %1, i64* %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int, int, long long, int, long double, int, int, long long,
                     int, double);
main() {
  f(4, 10, 10000000000LL, 11, 3.14L, 12, 13, 20000000000LL, 14, 2.72);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %rsp,%rax
movabs $0x4a817c800,%rcx
mov    %rcx,0x10(%rax)
fldt   0xeba(%rip)
fstpt  (%rax)
movl   $0xe,0x18(%rax)
mov    $0x4,%edi
mov    $0xa,%esi
movabs $0x2540be400,%rdx
mov    $0xb,%ecx
mov    $0xc,%r8d
mov    $0xd,%r9d
movsd  0xe94(%rip),%xmm0
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x4a817c800,%rax
mov    %rax,0x10(%rsp)
fldt   0xec7(%rip)
fstpt  (%rsp)
movl   $0xe,0x18(%rsp)
movabs $0x2540be400,%rdx
movsd  0xeba(%rip),%xmm0
mov    $0x4,%edi
mov    $0xa,%esi
mov    $0xb,%ecx
mov    $0xc,%r8d
mov    $0xd,%r9d
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 4, i32 10, i64 10000000000, i32 11, x86_fp80 0xK4000C8F5C28F5C28F5C3, i32 12, i32 13, i64 20000000000, i32 14, double 2.720000e+00)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 4, i32 10, i64 10000000000, i32 11, x86_fp80 0xK4000C8F5C28F5C28F5C3, i32 12, i32 13, i64 20000000000, i32 14, double 2.720000e+00)
%2 = tail call i32 @exit(i32 0)
unreachable
}
OP(dd, c1) {
  illegal_1();
  op_c1();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_c1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_c1()
ret i32 undef
}
struct s32 {
  char a;
  unsigned : 0;
} f32(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<f32>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f32+0x9>
jmp    1109 <f32+0x9>

x86 assembly (clang, -O2):
<f32>:
jmp    1100 <f32>

LLVM IR (-O0):
define i32 @f32() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define i32 @f32() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int lengthOfLongestSubstring(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("main: Len of lonest substring is %d\n",
         lengthOfLongestSubstring("abcabcbb"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefd(%rip),%rdi
call   1040 <lengthOfLongestSubstring@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"main: Len of lonest substring is %d\0A\00"
@.str.1 = [9 x i8] c"abcabcbb\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"main: Len of lonest substring is %d\0A\00"
@.str.1 = [9 x i8] c"abcabcbb\00"
define i32 @main() {
%1 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int exp(double);
double sqrt(int);
double f(double x) { return (sqrt(1 + exp(-x) * exp(-x))); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    -0xc(%rbp),%edi
imul   %eax,%edi
add    $0x1,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
xorps  0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
call   1030 <exp@plt>
mov    %eax,%ebx
movaps (%rsp),%xmm0
call   1030 <exp@plt>
imul   %eax,%ebx
add    $0x1,%ebx
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @exp(double %4)
%6 = load double, double* %2
%7 = fneg double %6
%8 = call i32 @exp(double %7)
%9 = mul nsw i32 %5, %8
%10 = add nsw i32 1, %9
%11 = call double @sqrt(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = tail call i32 @exp(double %2)
%5 = mul nsw i32 %4, %3
%6 = add nsw i32 %5, 1
%7 = tail call double @sqrt(i32 %6)
ret double %7
}
int bitwiseAddition(int n, int m) {
  while (m != 0) {
    int carry = n & m;
    n = n ^ m;
    m = carry << 1;
  }
  return n;
}


x86 assembly (clang, -O0):
<bitwiseAddition>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1134 <bitwiseAddition+0x34>
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110a <bitwiseAddition+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitwiseAddition>:
mov    %edi,%eax
test   %esi,%esi
je     111c <bitwiseAddition+0x1c>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
and    %esi,%ecx
xor    %esi,%eax
add    %ecx,%ecx
mov    %ecx,%esi
jne    1110 <bitwiseAddition+0x10>
ret

LLVM IR (-O0):
define i32 @bitwiseAddition(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = xor i32 %13, %14
store i32 %15, i32* %3
%16 = load i32, i32* %5
%17 = shl i32 %16, 1
store i32 %17, i32* %4
br label %6
18: ; preds = %6
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @bitwiseAddition(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %1, %2 ]
%7 = and i32 %5, %6
%8 = xor i32 %5, %6
%9 = shl i32 %7, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ %0, %2 ], [ %8, %4 ]
ret i32 %12
}
void wad_stab_debug() {}


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

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

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

LLVM IR (-O2):
define void @wad_stab_debug() {
ret void
}
unsigned int nraise0(unsigned int k, unsigned int n) {
  unsigned int i;
  unsigned int sum;
  if (k == 1)
    return 10 - n;
  sum = 0;
  for (i = n; i <= 9; ++i) {
    sum += nraise0(k - 1, i);
  }
  return sum;
}


x86 assembly (clang, -O0):
<nraise0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1138 <nraise0+0x28>
mov    $0xa,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <nraise0+0x67>
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
ja     1171 <nraise0+0x61>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%esi
call   1030 <nraise0@plt>
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <nraise0+0x35>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nraise0>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
cmp    $0x1,%edi
jne    1124 <nraise0+0x14>
mov    $0xa,%ebp
sub    %ebx,%ebp
jmp    1154 <nraise0+0x44>
xor    %ebp,%ebp
cmp    $0x9,%ebx
ja     1154 <nraise0+0x44>
mov    %edi,%r14d
add    $0xffffffff,%r14d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <nraise0@plt>
add    %eax,%ebp
add    $0x1,%ebx
cmp    $0xa,%ebx
jne    1140 <nraise0+0x30>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nraise0(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %5
%12 = sub i32 10, %11
store i32 %12, i32* %3
br label %30
13: ; preds = %2
store i32 0, i32* %7
%14 = load i32, i32* %5
store i32 %14, i32* %6
br label %15
15: ; preds = %25, %13
%16 = load i32, i32* %6
%17 = icmp ule i32 %16, 9
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = load i32, i32* %4
%20 = sub i32 %19, 1
%21 = load i32, i32* %6
%22 = call i32 @nraise0(i32 %20, i32 %21)
%23 = load i32, i32* %7
%24 = add i32 %23, %22
store i32 %24, i32* %7
br label %25
25: ; preds = %18
%26 = load i32, i32* %6
%27 = add i32 %26, 1
store i32 %27, i32* %6
br label %15
28: ; preds = %15
%29 = load i32, i32* %7
store i32 %29, i32* %3
br label %30
30: ; preds = %28, %10
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @nraise0(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp ult i32 %1, 10
br i1 %5, label %6, label %17
6: ; preds = %4
%7 = add i32 %0, -1
br label %10
8: ; preds = %2
%9 = sub i32 10, %1
br label %17
10: ; preds = %6, %10
%11 = phi i32 [ 0, %6 ], [ %14, %10 ]
%12 = phi i32 [ %1, %6 ], [ %15, %10 ]
%13 = tail call i32 @nraise0(i32 %7, i32 %12)
%14 = add i32 %13, %11
%15 = add i32 %12, 1
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %10
17: ; preds = %10, %4, %8
%18 = phi i32 [ %9, %8 ], [ 0, %4 ], [ %14, %10 ]
ret i32 %18
}
const char *lastack_typename(int t) {
  static const char *type_names[] = {
      "mat",
      "v4",
      "quat",
  };
  if (t < 0 || t >= sizeof(type_names) / sizeof(type_names[0]))
    return "unknown";
  return type_names[t];
}


x86 assembly (clang, -O0):
<lastack_typename>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     111f <lastack_typename+0x1f>
movslq -0xc(%rbp),%rax
cmp    $0x3,%rax
jb     112f <lastack_typename+0x2f>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1142 <lastack_typename+0x42>
movslq -0xc(%rbp),%rcx
lea    0x2ef6(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastack_typename>:
cmp    $0x2,%edi
jbe    110d <lastack_typename+0xd>
lea    0xf0c(%rip),%rax
ret
mov    %edi,%eax
lea    0xeea(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@lastack_typename.type_names = internal global [3 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0)]
@.str = [4 x i8] c"mat\00"
@.str.1 = [3 x i8] c"v4\00"
@.str.2 = [5 x i8] c"quat\00"
@.str.3 = [8 x i8] c"unknown\00"
define i8* @lastack_typename(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = icmp uge i64 %8, 3
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %16
11: ; preds = %6
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [3 x i8*], [3 x i8*]* @lastack_typename.type_names, i64 0, i64 %13
%15 = load i8*, i8** %14
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@reltable.lastack_typename = internal unnamed_addr constant [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.lastack_typename to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.lastack_typename to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.lastack_typename to i64)) to i32)]
@.str = [4 x i8] c"mat\00"
@.str.1 = [3 x i8] c"v4\00"
@.str.2 = [5 x i8] c"quat\00"
@.str.3 = [8 x i8] c"unknown\00"
define i8* @lastack_typename(i32 %0) {
%2 = icmp ugt i32 %0, 2
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.lastack_typename to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
long SSL_session_reused(int /*<<< orphan*/ *);
long SSL_ctrl(SSL *s, int cmd, long larg, void *parg) {
  switch (cmd) {
  case 8: {
    return SSL_session_reused(s);
  }
  default:
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<SSL_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
jne    114a <SSL_ctrl+0x3a>
jmp    1138 <SSL_ctrl+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <SSL_session_reused@plt>
mov    %rax,-0x8(%rbp)
jmp    1157 <SSL_ctrl+0x47>
jmp    114f <SSL_ctrl+0x3f>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSL_ctrl>:
cmp    $0x8,%esi
jne    111a <SSL_ctrl+0xa>
jmp    1030 <SSL_session_reused@plt>
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @SSL_ctrl(i32* %0, i32 %1, i64 %2, i8* %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
%10 = load i32, i32* %7
switch i32 %10, label %14 [
i32 8, label %11
]
11: ; preds = %4
%12 = load i32*, i32** %6
%13 = call i64 @SSL_session_reused(i32* %12)
store i64 %13, i64* %5
br label %16
14: ; preds = %4
br label %15
15: ; preds = %14
store i64 -1, i64* %5
br label %16
16: ; preds = %15, %11
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
define i64 @SSL_ctrl(i32* %0, i32 %1, i64 %2, i8* nocapture readnone %3) {
%5 = icmp eq i32 %1, 8
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i64 @SSL_session_reused(i32* %0)
br label %8
8: ; preds = %4, %6
%9 = phi i64 [ %7, %6 ], [ -1, %4 ]
ret i64 %9
}
/* Type definitions */
struct opd_image {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
struct opd_image *opd_get_image(char const *, char const *, int,
                                int /*<<< orphan*/, int /*<<< orphan*/);
struct opd_image *opd_get_kernel_image(char const *name, char const *app_name,
                                       pid_t tid, pid_t tgid) {
  return opd_get_image(name, app_name, 1, tid, tgid);
}


x86 assembly (clang, -O0):
<opd_get_kernel_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x1,%edx
call   1030 <opd_get_image@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opd_get_kernel_image>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    $0x1,%edx
jmp    1030 <opd_get_image@plt>

LLVM IR (-O0):
%struct.opd_image = type { i32 }
define %struct.opd_image* @opd_get_kernel_image(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call %struct.opd_image* @opd_get_image(i8* %9, i8* %10, i32 1, i32 %11, i32 %12)
ret %struct.opd_image* %13
}

LLVM IR (-O2):
%struct.opd_image = type { i32 }
define %struct.opd_image* @opd_get_kernel_image(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call %struct.opd_image* @opd_get_image(i8* %0, i8* %1, i32 1, i32 %2, i32 %3)
ret %struct.opd_image* %5
}
int cpu_current() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @cpu_current() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ AtmegaCompareP__0__AtmegaCompare__stop();
void AtmegaCompareP__0__Alarm__stop(void) {
  AtmegaCompareP__0__AtmegaCompare__stop();
}


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

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

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

LLVM IR (-O2):
define void @AtmegaCompareP__0__Alarm__stop() {
%1 = tail call i32 (...) @AtmegaCompareP__0__AtmegaCompare__stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void Usage(const char *appName) {
  printf("Usage:\n");
  printf("  %s width height imgfile\n", appName);
  printf("Where imgfile is a ppm file\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [27 x i8] c" %s width height imgfile\0A\00"
@.str.2 = [29 x i8] c"Where imgfile is a ppm file\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c" %s width height imgfile\0A\00"
@str = [7 x i8] c"Usage:\00"
@str.3 = [28 x i8] c"Where imgfile is a ppm file\00"
define void @Usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void crt_cursor_off() {
  outb(0x3D4, 0x0A);
  outb(0x3D5, 0x20);
}


x86 assembly (clang, -O0):
<crt_cursor_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crt_cursor_off>:
push   %rax
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
mov    $0x20,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @crt_cursor_off() {
%1 = call i32 @outb(i32 980, i32 10)
%2 = call i32 @outb(i32 981, i32 32)
ret void
}

LLVM IR (-O2):
define void @crt_cursor_off() {
%1 = tail call i32 @outb(i32 980, i32 10)
%2 = tail call i32 @outb(i32 981, i32 32)
ret void
}
int mylib_aa() { return 32; }


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

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

LLVM IR (-O0):
define i32 @mylib_aa() {
ret i32 32
}

LLVM IR (-O2):
define i32 @mylib_aa() {
ret i32 32
}
int booltest1(int x) { return x > 256; }


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

x86 assembly (clang, -O2):
<booltest1>:
xor    %eax,%eax
cmp    $0x101,%edi
setge  %al
ret

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

LLVM IR (-O2):
define i32 @booltest1(i32 %0) {
%2 = icmp sgt i32 %0, 256
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ realloc(char *, scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
char *str_cat(char *str, char *add) {
  if (!add)
    return (str);
  str = (char *)realloc(str, strlen(str) + strlen(add) + 3);
  strcat(str, add);
  return (str);
}


x86 assembly (clang, -O0):
<str_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <str_cat+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11a3 <str_cat+0x73>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdi
add    %rax,%rsi
add    $0x3,%rsi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cat>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     1171 <str_cat+0x41>
mov    %rsi,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rsi
add    $0x3,%rsi
mov    %rbx,%rdi
call   1040 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_cat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = load i8*, i8** %4
store i8* %9, i8** %3
br label %24
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %4
%13 = call i64 @strlen(i8* %12)
%14 = load i8*, i8** %5
%15 = call i64 @strlen(i8* %14)
%16 = add nsw i64 %13, %15
%17 = add nsw i64 %16, 3
%18 = call i64 @realloc(i8* %11, i64 %17)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %4
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = call i32 @strcat(i8* %20, i8* %21)
%23 = load i8*, i8** %4
store i8* %23, i8** %3
br label %24
24: ; preds = %10, %8
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @str_cat(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = tail call i64 @strlen(i8* %1)
%7 = add i64 %5, 3
%8 = add i64 %7, %6
%9 = tail call i64 @realloc(i8* %0, i64 %8)
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 @strcat(i8* %10, i8* %1)
br label %12
12: ; preds = %2, %4
%13 = phi i8* [ %10, %4 ], [ %0, %2 ]
ret i8* %13
}
void alFree(void *aligned) {
  void *raw = *(void **)((char *)aligned - sizeof(void *));
  wrFree(raw);
}


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

x86 assembly (clang, -O2):
<alFree>:
mov    -0x8(%rdi),%rdi
xor    %eax,%eax
jmp    1030 <wrFree@plt>

LLVM IR (-O0):
define void @alFree(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 -8
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @wrFree to i32 (i8*, ...)*)(i8* %8)
ret void
}

LLVM IR (-O2):
define void @alFree(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @wrFree to i32 (i8*, ...)*)(i8* %4)
ret void
}