xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dmaxabs(int, double *, int);
int main() {
  double x[] = {1.0, -2.0, -3.0, 4.0, -5.0, -6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dmaxabs(N, x, stride);
  printf("maxabs: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1050 <stdlib_strided_dmaxabs@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dmaxabs@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e+00, double -6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [13 x i8] c"maxabs: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dmaxabs(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e+00, double -6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [13 x i8] c"maxabs: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dmaxabs(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
int foo() {
  long unsigned int s = __builtin_expect((long unsigned int)&&L, 0);
L:
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0x4(%rip),%rax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i64
store i64 ptrtoint (i8* blockaddress(@foo, %2) to i64), i64* %1
br label %2
2: ; preds = %0, %3
ret i32 0
3: ; No predecessors!
indirectbr i8* undef, [label %2]
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ checkInput(int *, double *, double *);
int /*<<< orphan*/ printf(char *, int, int, double, double);
int to_binary(int);
int main() {
  int a;
  double b, c;
  checkInput(&a, &b, &c);
  printf("|%-10X|%010d|%10.1lf|%-10.3lf|", a, to_binary(a), b, c);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <checkInput@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <to_binary@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xc(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1050 <checkInput@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <to_binary@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
lea    0xe99(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"|%-10X|%010d|%10.1lf|%-10.3lf|\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @checkInput(i32* %2, double* %3, double* %4)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @to_binary(i32 %7)
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, double %9, double %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [31 x i8] c"|%-10X|%010d|%10.1lf|%-10.3lf|\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @checkInput(i32* %1, double* %2, double* %3)
%8 = load i32, i32* %1
%9 = call i32 @to_binary(i32 %8)
%10 = load double, double* %2
%11 = load double, double* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, double %10, double %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}
__attribute__((no, noclone)) unsigned __int128 t157_3add(signed __int128 y) {
  unsigned __int128 r;
  if (__builtin_add_overflow((signed __int128)(3), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t157_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
add    $0x3,%rdx
adc    $0x0,%rcx
mov    %r9,%r8
adc    $0x0,%r8
adc    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1187 <t157_3add+0x77>
jmp    118e <t157_3add+0x7e>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t157_3add>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x3,%r14
mov    %rsi,%rbx
adc    $0x0,%rbx
mov    $0xfffffffffffffffc,%rax
cmp    %rdi,%rax
mov    $0xffffffffffffffff,%rax
sbb    %rsi,%rax
jl     113f <t157_3add+0x2f>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t157_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 3, i129 %12)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t157_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nuw i129 %7, 3
%9 = icmp slt i128 %6, -3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(unsigned long, int /*<<< orphan*/ *);
void put4(unsigned long val, FILE *out) {
  putc(val & 0xff, out);
  putc((val >> 8) & 0xff, out);
  putc((val >> 16) & 0xff, out);
  putc((val >> 24) & 0xff, out);
}


x86 assembly (clang, -O0):
<put4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rdi
shr    $0x8,%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rdi
shr    $0x10,%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rdi
shr    $0x18,%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put4>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movzbl %bl,%edi
call   1030 <putc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
shr    $0x18,%ebx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @put4(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = and i64 %5, 255
%7 = load i32*, i32** %4
%8 = call i32 @putc(i64 %6, i32* %7)
%9 = load i64, i64* %3
%10 = lshr i64 %9, 8
%11 = and i64 %10, 255
%12 = load i32*, i32** %4
%13 = call i32 @putc(i64 %11, i32* %12)
%14 = load i64, i64* %3
%15 = lshr i64 %14, 16
%16 = and i64 %15, 255
%17 = load i32*, i32** %4
%18 = call i32 @putc(i64 %16, i32* %17)
%19 = load i64, i64* %3
%20 = lshr i64 %19, 24
%21 = and i64 %20, 255
%22 = load i32*, i32** %4
%23 = call i32 @putc(i64 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @put4(i64 %0, i32* nocapture %1) {
%3 = and i64 %0, 255
%4 = tail call i32 @putc(i64 %3, i32* %1)
%5 = lshr i64 %0, 8
%6 = and i64 %5, 255
%7 = tail call i32 @putc(i64 %6, i32* %1)
%8 = lshr i64 %0, 16
%9 = and i64 %8, 255
%10 = tail call i32 @putc(i64 %9, i32* %1)
%11 = lshr i64 %0, 24
%12 = and i64 %11, 255
%13 = tail call i32 @putc(i64 %12, i32* %1)
ret void
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  long long tv_nsec;
};
typedef long long int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t systemTime() {
  struct timespec t;
  t.tv_sec = t.tv_nsec = 0;
  clock_gettime(CLOCK_MONOTONIC, &t);
  return (int64_t)(t.tv_sec) * 1000000000LL + t.tv_nsec;
}


x86 assembly (clang, -O0):
<systemTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<systemTime>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,(%rsp),%rax
3b
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @systemTime() {
%1 = alloca %struct.timespec
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i64 0, i64* %3
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %1)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @systemTime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = bitcast %struct.timespec* %1 to i8*
%6 = load i32, i32* @CLOCK_MONOTONIC
%7 = call i32 @clock_gettime(i32 %6, %struct.timespec* %1)
%8 = load i64, i64* %4
%9 = mul nsw i64 %8, 1000000000
%10 = load i64, i64* %3
%11 = add nsw i64 %9, %10
ret i64 %11
}
void atomic_add(double *data, double delta) {
  union {
    double dv;
    long lv;
  } old;
  union {
    double dv;
    long lv;
  } new;
  while (1) {
    old.lv = *(volatile long *)data;
    new.dv = old.dv + delta;
    if (__sync_bool_compare_and_swap(((volatile long *)data), (old.lv),
                                     (new.lv)))
      break;
  }
  return;
}


x86 assembly (clang, -O0):
<atomic_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
mov    %rax,%rcx
sete   %al
test   $0x1,%al
jne    114f <atomic_add+0x4f>
jmp    1154 <atomic_add+0x54>
jmp    1159 <atomic_add+0x59>
jmp    110d <atomic_add+0xd>
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add>:
mov    (%rdi),%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm1
movq   %xmm1,%rcx
lock cmpxchg %rcx,(%rdi)
jne    1100 <atomic_add>
ret

LLVM IR (-O0):
%union.anon = type { double }
%union.anon.0 = type { double }
define void @atomic_add(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
%5 = alloca %union.anon
%6 = alloca %union.anon.0
store double* %0, double** %3
store double %1, double* %4
br label %7
7: ; preds = %2, %26
%8 = load double*, double** %3
%9 = bitcast double* %8 to i64*
%10 = load volatile i64, i64* %9
%11 = bitcast %union.anon* %5 to i64*
store i64 %10, i64* %11
%12 = bitcast %union.anon* %5 to double*
%13 = load double, double* %12
%14 = load double, double* %4
%15 = fadd double %13, %14
%16 = bitcast %union.anon.0* %6 to double*
store double %15, double* %16
%17 = load double*, double** %3
%18 = bitcast double* %17 to i64*
%19 = bitcast %union.anon* %5 to i64*
%20 = load i64, i64* %19
%21 = bitcast %union.anon.0* %6 to i64*
%22 = load i64, i64* %21
%23 = cmpxchg i64* %18, i64 %20, i64 %22 seq_cst seq_cst
%24 = extractvalue { i64, i1 } %23, 1
br i1 %24, label %25, label %26
25: ; preds = %7
br label %27
26: ; preds = %7
br label %7
27: ; preds = %25
ret void
}

LLVM IR (-O2):
define void @atomic_add(double* %0, double %1) {
%3 = bitcast double* %0 to i64*
br label %4
4: ; preds = %4, %2
%5 = load volatile i64, i64* %3
%6 = bitcast i64 %5 to double
%7 = fadd double %6, %1
%8 = bitcast double %7 to i64
%9 = cmpxchg i64* %3, i64 %5, i64 %8 seq_cst seq_cst
%10 = extractvalue { i64, i1 } %9, 1
br i1 %10, label %11, label %4
11: ; preds = %4
ret void
}
const char *fxtyp_string(unsigned short fxtyp) {
  switch (fxtyp) {
  case 0:
    return "Time,Lat,Lng";
    break;
  case 1:
    return "Time,Lat,Lng,Alt";
    break;
  case 2:
    return "Time,Lat,Lng,Alt,Vel";
    break;
  default:
    return "Invalid";
  }
}


x86 assembly (clang, -O0):
<fxtyp_string>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1141 <fxtyp_string+0x41>
jmp    111f <fxtyp_string+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1151 <fxtyp_string+0x51>
jmp    1130 <fxtyp_string+0x30>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1161 <fxtyp_string+0x61>
jmp    1171 <fxtyp_string+0x71>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <fxtyp_string+0x7c>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <fxtyp_string+0x7c>
lea    0xeb6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <fxtyp_string+0x7c>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxtyp_string>:
cmp    $0x2,%di
ja     1119 <fxtyp_string+0x19>
movswq %di,%rax
lea    0xf2b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf13(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Time,Lat,Lng\00"
@.str.1 = [17 x i8] c"Time,Lat,Lng,Alt\00"
@.str.2 = [21 x i8] c"Time,Lat,Lng,Alt,Vel\00"
@.str.3 = [8 x i8] c"Invalid\00"
define i8* @fxtyp_string(i16 zeroext %0) {
%2 = alloca i8*
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
switch i32 %5, label %9 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
]
6: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"Time,Lat,Lng\00"
@.str.1 = [17 x i8] c"Time,Lat,Lng,Alt\00"
@.str.2 = [21 x i8] c"Time,Lat,Lng,Alt,Vel\00"
@.str.3 = [8 x i8] c"Invalid\00"
@reltable.fxtyp_string = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.fxtyp_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.fxtyp_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.fxtyp_string to i64)) to i32)]
define i8* @fxtyp_string(i16 zeroext %0) {
%2 = icmp ult i16 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i16 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.fxtyp_string 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
}
short *test_func_02(short *p, int c) {
  *--p = (short)c;
  *--p = (short)c;
  return p;
}


x86 assembly (clang, -O0):
<test_func_02>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffffe,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cx,-0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffffe,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cx,-0x2(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_02>:
mov    %si,-0x2(%rdi)
mov    %si,-0x4(%rdi)
lea    -0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i16* @test_func_02(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i16
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i32 -1
store i16* %8, i16** %3
store i16 %6, i16* %8
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i16
%11 = load i16*, i16** %3
%12 = getelementptr inbounds i16, i16* %11, i32 -1
store i16* %12, i16** %3
store i16 %10, i16* %12
%13 = load i16*, i16** %3
ret i16* %13
}

LLVM IR (-O2):
define i16* @test_func_02(i16* writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = getelementptr inbounds i16, i16* %0, i64 -1
store i16 %3, i16* %4
%5 = getelementptr inbounds i16, i16* %0, i64 -2
store i16 %3, i16* %5
ret i16* %5
}
int fun1040() { return 1040; }


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

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

LLVM IR (-O0):
define i32 @fun1040() {
ret i32 1040
}

LLVM IR (-O2):
define i32 @fun1040() {
ret i32 1040
}
void updateMovieArchive(unsigned int movieID, const char *archived) { return; }


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

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

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

LLVM IR (-O2):
define void @updateMovieArchive(i32 %0, i8* nocapture %1) {
ret void
}
float factorial(float number) {
  if (number <= 1.0)
    return (number);
  else
    return (number * factorial(number - 1.0));
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1147 <factorial+0x37>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1180 <factorial+0x70>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9e(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <factorial@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rax
movaps %xmm0,%xmm1
movss  0xee4(%rip),%xmm0
ucomiss %xmm1,%xmm0
jae    1142 <factorial+0x32>
movss  0xedb(%rip),%xmm0
addss  %xmm1,%xmm0
movss  %xmm1,0x4(%rsp)
call   1030 <factorial@plt>
movss  0x4(%rsp),%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @factorial(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ole double %5, 1.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load float, float* %3
store float %8, float* %2
br label %17
9: ; preds = %1
%10 = load float, float* %3
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = fsub double %12, 1.000000e+00
%14 = fptrunc double %13 to float
%15 = call float @factorial(float %14)
%16 = fmul float %10, %15
store float %16, float* %2
br label %17
17: ; preds = %9, %7
%18 = load float, float* %2
ret float %18
}

LLVM IR (-O2):
define float @factorial(float %0) {
%2 = fcmp ugt float %0, 1.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1, %5
%4 = phi float [ %8, %5 ], [ %0, %1 ]
ret float %4
5: ; preds = %1
%6 = fadd float %0, -1.000000e+00
%7 = tail call float @factorial(float %6)
%8 = fmul float %7, %0
br label %3
}
int cairo_code_draw_lushGraphPoint_get_height() { return 21; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_lushGraphPoint_get_height() {
ret i32 21
}

LLVM IR (-O2):
define i32 @cairo_code_draw_lushGraphPoint_get_height() {
ret i32 21
}
/* Variables and functions */
int /*<<< orphan*/ cgincglob(char *, char *, int);
void cgincpg(char *s, int v) { cgincglob("add", s, v); }


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

x86 assembly (clang, -O2):
<cgincpg>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <cgincglob@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"add\00"
define void @cgincpg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @cgincglob(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
define void @cgincpg(i8* %0, i32 %1) {
%3 = tail call i32 @cgincglob(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void printallconst() { printf("Compiled %s %s\n", "Mar 19 2022", "07:31:24"); }


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

x86 assembly (clang, -O2):
<printallconst>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xef7(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Compiled %s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 19 2022\00"
@.str.2 = [9 x i8] c"07:31:24\00"
define void @printallconst() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Compiled %s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 19 2022\00"
@.str.2 = [9 x i8] c"07:31:24\00"
define void @printallconst() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pt_regs {
  int dummy;
};
struct ehci_sitd {
  int dummy;
};
struct ehci_hcd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ehci_err(struct ehci_hcd *, char *, struct ehci_sitd *);
unsigned sitd_complete(struct ehci_hcd *ehci, struct ehci_sitd *sitd,
                       struct pt_regs *regs) {
  ehci_err(ehci, "sitd_complete %p?\n", sitd);
  return 0;
}


x86 assembly (clang, -O0):
<sitd_complete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rsi
call   1030 <ehci_err@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sitd_complete>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <ehci_err@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ehci_hcd = type { i32 }
%struct.ehci_sitd = type { i32 }
%struct.pt_regs = type { i32 }
@.str = [19 x i8] c"sitd_complete %p?\0A\00"
define i32 @sitd_complete(%struct.ehci_hcd* %0, %struct.ehci_sitd* %1, %struct.pt_regs* %2) {
%4 = alloca %struct.ehci_hcd*
%5 = alloca %struct.ehci_sitd*
%6 = alloca %struct.pt_regs*
store %struct.ehci_hcd* %0, %struct.ehci_hcd** %4
store %struct.ehci_sitd* %1, %struct.ehci_sitd** %5
store %struct.pt_regs* %2, %struct.pt_regs** %6
%7 = load %struct.ehci_hcd*, %struct.ehci_hcd** %4
%8 = load %struct.ehci_sitd*, %struct.ehci_sitd** %5
%9 = call i32 @ehci_err(%struct.ehci_hcd* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.ehci_sitd* %8)
ret i32 0
}

LLVM IR (-O2):
%struct.ehci_hcd = type { i32 }
%struct.ehci_sitd = type { i32 }
%struct.pt_regs = type { i32 }
@.str = [19 x i8] c"sitd_complete %p?\0A\00"
define i32 @sitd_complete(%struct.ehci_hcd* %0, %struct.ehci_sitd* %1, %struct.pt_regs* nocapture readnone %2) {
%4 = tail call i32 @ehci_err(%struct.ehci_hcd* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.ehci_sitd* %1)
ret i32 0
}
int add4(int a) { return a + 4; }


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

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

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

LLVM IR (-O2):
define i32 @add4(i32 %0) {
%2 = add nsw i32 %0, 4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *, size_t,
                            size_t);
char *format(char *buffer, size_t size, const char *name, size_t quantity,
             size_t weight) {
  snprintf(buffer, size, "Item: %s Quantity: %ld Weight: %ld", name, quantity,
           weight);
  return buffer;
}


x86 assembly (clang, -O0):
<format>:
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    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xeb9(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format>:
push   %rbx
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rdi,%rbx
lea    0xedc(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Item: %s Quantity: %ld Weight: %ld\00"
define i8* @format(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @snprintf(i8* %11, i64 %12, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %13, i64 %14, i64 %15)
%17 = load i8*, i8** %6
ret i8* %17
}

LLVM IR (-O2):
@.str = [35 x i8] c"Item: %s Quantity: %ld Weight: %ld\00"
define i8* @format(i8* returned %0, i64 %1, i8* %2, i64 %3, i64 %4) {
%6 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2, i64 %3, i64 %4)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, size_t);
int recv_all(int, int /*<<< orphan*/ *, size_t);
int /*<<< orphan*/ rxdecrypt(int /*<<< orphan*/ *, size_t);
int recv_enc(int fd, uint8_t *b, size_t n) {
  int ret;
  memset(b, 0, n);
  if (0 != (ret = recv_all(fd, b, n))) {
    return ret;
  }
  rxdecrypt(b, n);
  return 0;
}


x86 assembly (clang, -O0):
<recv_enc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <recv_all@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
je     117c <recv_enc+0x4c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <recv_enc+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <rxdecrypt@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_enc>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <recv_all@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1164 <recv_enc+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <rxdecrypt@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @recv_enc(i32 %0, i32* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
%9 = load i32*, i32** %6
%10 = load i64, i64* %7
%11 = call i32 @memset(i32* %9, i32 0, i64 %10)
%12 = load i32, i32* %5
%13 = load i32*, i32** %6
%14 = load i64, i64* %7
%15 = call i32 @recv_all(i32 %12, i32* %13, i64 %14)
store i32 %15, i32* %8
%16 = icmp ne i32 0, %15
br i1 %16, label %17, label %19
17: ; preds = %3
%18 = load i32, i32* %8
store i32 %18, i32* %4
br label %23
19: ; preds = %3
%20 = load i32*, i32** %6
%21 = load i64, i64* %7
%22 = call i32 @rxdecrypt(i32* %20, i64 %21)
store i32 0, i32* %4
br label %23
23: ; preds = %19, %17
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @recv_enc(i32 %0, i32* %1, i64 %2) {
%4 = tail call i32 @memset(i32* %1, i32 0, i64 %2)
%5 = tail call i32 @recv_all(i32 %0, i32* %1, i64 %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @rxdecrypt(i32* %1, i64 %2)
br label %9
9: ; preds = %3, %7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ i2c_ClearRXRdy(int /*<<< orphan*/);
void i2c0_ClearRXRdy(void) { i2c_ClearRXRdy(0); }


x86 assembly (clang, -O0):
<i2c0_ClearRXRdy>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <i2c_ClearRXRdy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c0_ClearRXRdy>:
xor    %edi,%edi
jmp    1030 <i2c_ClearRXRdy@plt>

LLVM IR (-O0):
define void @i2c0_ClearRXRdy() {
%1 = call i32 @i2c_ClearRXRdy(i32 0)
ret void
}

LLVM IR (-O2):
define void @i2c0_ClearRXRdy() {
%1 = tail call i32 @i2c_ClearRXRdy(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int Setpgid(pid_t pid, pid_t pgid) {
  if (setpgid(pid, pgid) < 0) {
    fprintf(stdout, "setpgid error");
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<Setpgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <setpgid@plt>
cmp    $0x0,%rax
jge    116f <Setpgid+0x3f>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setpgid>:
push   %rax
call   1040 <setpgid@plt>
test   %rax,%rax
js     113f <Setpgid+0xf>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"setpgid error\00"
define i32 @Setpgid(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 i64 @setpgid(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stdout
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"setpgid error\00"
define i32 @Setpgid(i32 %0, i32 %1) {
%3 = tail call i64 @setpgid(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stdout
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_message_rewind(void *m,
                                                                 int complete) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_rewind>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_rewind>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_rewind(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_rewind(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int test_0x1000010() { return 0x1000010; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x1000010,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x1000010,%eax
ret

LLVM IR (-O0):
define i32 @test_0x1000010() {
ret i32 16777232
}

LLVM IR (-O2):
define i32 @test_0x1000010() {
ret i32 16777232
}
/* Variables and functions */
char hw_read_key();
char hw_keys() { return hw_read_key(); }


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

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

LLVM IR (-O0):
define signext i8 @hw_keys() {
%1 = call signext i8 (...) @hw_read_key()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @hw_keys() {
%1 = tail call signext i8 (...) @hw_read_key()
ret i8 %1
}
/* Variables and functions */
char *take_arg(char **arg) {
  char *d;
  d = *arg;
  *arg = NULL;
  return d;
}


x86 assembly (clang, -O0):
<take_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<take_arg>:
mov    (%rdi),%rax
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i8* @take_arg(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
store i8* %5, i8** %3
%6 = load i8**, i8*** %2
store i8* null, i8** %6
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define i8* @take_arg(i8** nocapture %0) {
%2 = load i8*, i8** %0
store i8* null, i8** %0
ret i8* %2
}
int charToNumber(char number) { return number - '0'; }


x86 assembly (clang, -O0):
<charToNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @charToNumber(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @charToNumber(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ d7eucldistsq(double *, double *);
double sqrt(int /*<<< orphan*/);
double d7eucldist(double v1[7], double v2[6]) {
  return sqrt(d7eucldistsq(v1, v2));
}


x86 assembly (clang, -O0):
<d7eucldist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <d7eucldistsq@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d7eucldist>:
push   %rax
call   1030 <d7eucldistsq@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

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

LLVM IR (-O2):
define double @d7eucldist(double* %0, double* %1) {
%3 = tail call i32 @d7eucldistsq(double* %0, double* %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putstr(char *str) {
  int i;
  i = 0;
  while (str[i])
    ft_putchar(str[i++]);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <ft_putstr+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @ft_putchar(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
const char *unqlite_lib_signature(void) { return "unqlite/1.1.2"; }


x86 assembly (clang, -O0):
<unqlite_lib_signature>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unqlite_lib_signature>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unqlite/1.1.2\00"
define i8* @unqlite_lib_signature() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"unqlite/1.1.2\00"
define i8* @unqlite_lib_signature() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
double f4_cb_send_pre_int_int_double(double (*cb)(int, int, double)) {
  double r = 66.0;
  return cb(8, 9, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
call   *%rax
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_double>:
push   %rax
mov    %rdi,%rax
movsd  0xef4(%rip),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
call   *%rax
addsd  0xee8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_double(double (i32, i32, double)* %0) {
%2 = alloca double (i32, i32, double)*
%3 = alloca double
store double (i32, i32, double)* %0, double (i32, i32, double)** %2
store double 6.600000e+01, double* %3
%4 = load double (i32, i32, double)*, double (i32, i32, double)** %2
%5 = load double, double* %3
%6 = call double %4(i32 8, i32 9, double %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_double(double (i32, i32, double)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, double 6.600000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ ReflexTestData_IncrementIndex();
void LedModel_IncrementIndex() { ReflexTestData_IncrementIndex(); }


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

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

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

LLVM IR (-O2):
define void @LedModel_IncrementIndex() {
%1 = tail call i32 (...) @ReflexTestData_IncrementIndex()
ret void
}
char *lcd_ident() { return "$Id: lcd.c 230 2007-10-23 17:42:49Z  $"; }


x86 assembly (clang, -O0):
<lcd_ident>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_ident>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"$Id: lcd.c 230 2007-10-23 17:42:49Z $\00"
define i8* @lcd_ident() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [39 x i8] c"$Id: lcd.c 230 2007-10-23 17:42:49Z $\00"
define i8* @lcd_ident() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
void *get_XNoExposeEvent_display(void *_p) {
  return (void *)((XNoExposeEvent *)_p)->display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XNoExposeEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ print_header();
int /*<<< orphan*/ tag_enable(int);
void tag_dump_header(void) {
  tag_enable(1);
  print_header();
  tag_enable(0);
}


x86 assembly (clang, -O0):
<tag_dump_header>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <tag_enable@plt>
mov    $0x0,%al
call   1040 <print_header@plt>
xor    %edi,%edi
call   1030 <tag_enable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag_dump_header>:
push   %rax
mov    $0x1,%edi
call   1030 <tag_enable@plt>
xor    %eax,%eax
call   1040 <print_header@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <tag_enable@plt>

LLVM IR (-O0):
define void @tag_dump_header() {
%1 = call i32 @tag_enable(i32 1)
%2 = call i32 (...) @print_header()
%3 = call i32 @tag_enable(i32 0)
ret void
}

LLVM IR (-O2):
define void @tag_dump_header() {
%1 = tail call i32 @tag_enable(i32 1)
%2 = tail call i32 (...) @print_header()
%3 = tail call i32 @tag_enable(i32 0)
ret void
}