xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint_fast8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int /*<<< orphan*/);
int /*<<< orphan*/ IntUnregister(int /*<<< orphan*/);
int /*<<< orphan*/ _CANIntNumberGet(int /*<<< orphan*/);
void CANIntUnregister(uint32_t ui32Base) {
  uint_fast8_t ui8IntNumber;
  ;
  ui8IntNumber = _CANIntNumberGet(ui32Base);
  ;
  IntDisable(ui8IntNumber);
  IntUnregister(ui8IntNumber);
}


x86 assembly (clang, -O0):
<CANIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_CANIntNumberGet@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntUnregister>:
push   %rbx
call   1040 <_CANIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @CANIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_CANIntNumberGet(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @IntDisable(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @IntUnregister(i32 %8)
ret void
}

LLVM IR (-O2):
define void @CANIntUnregister(i32 %0) {
%2 = tail call i32 @_CANIntNumberGet(i32 %0)
%3 = tail call i32 @IntDisable(i32 %2)
%4 = tail call i32 @IntUnregister(i32 %2)
ret void
}
/* Variables and functions */
double log(double);
double rand();
double expon(double x) {
  double z;
  double exp_value;
  do {
    z = rand();
  } while ((z == 0) || (z == 1));
  exp_value = -x * log(z);
  return (exp_value);
}


x86 assembly (clang, -O0):
<expon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jne    115b <expon+0x3b>
jp     115b <expon+0x3b>
jmp    1177 <expon+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    112d <expon+0xd>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expon>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <rand@plt>
ucomisd 0xec9(%rip),%xmm0
jne    1143 <expon+0x23>
jnp    1130 <expon+0x10>
ucomisd 0xeb5(%rip),%xmm0
jne    114f <expon+0x2f>
jnp    1130 <expon+0x10>
movaps (%rsp),%xmm1
xorps  0xeb6(%rip),%xmm1
movaps %xmm1,(%rsp)
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @expon(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
br label %5
5: ; preds = %13, %1
%6 = call double (...) @rand()
store double %6, double* %3
br label %7
7: ; preds = %5
%8 = load double, double* %3
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load double, double* %3
%12 = fcmp oeq double %11, 1.000000e+00
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ true, %7 ], [ %12, %10 ]
br i1 %14, label %5, label %15
15: ; preds = %13
%16 = load double, double* %2
%17 = fneg double %16
%18 = load double, double* %3
%19 = call double @log(double %18)
%20 = fmul double %17, %19
store double %20, double* %4
%21 = load double, double* %4
ret double %21
}

LLVM IR (-O2):
define double @expon(double %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call double (...) @rand()
%4 = fcmp oeq double %3, 0.000000e+00
%5 = fcmp oeq double %3, 1.000000e+00
%6 = or i1 %4, %5
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = fneg double %0
%9 = tail call double @log(double %3)
%10 = fmul double %9, %8
ret double %10
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int medusaReceiveInternal(int socket, char *buf, int length) {
  return recv(socket, buf, length, 0);
}


x86 assembly (clang, -O0):
<medusaReceiveInternal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaReceiveInternal>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @medusaReceiveInternal(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage();
int /*<<< orphan*/ version();
void usage_and_exit(int exit_code, const char *message) {
  version();
  usage();
  if (NULL != message) {
    fprintf(stderr, "%s\n", message);
  }
  exit(exit_code);
}


x86 assembly (clang, -O0):
<usage_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <version@plt>
mov    $0x0,%al
call   1050 <usage@plt>
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1182 <usage_and_exit+0x42>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe83(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<usage_and_exit>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <version@plt>
xor    %eax,%eax
call   1050 <usage@plt>
test   %rbx,%rbx
je     1173 <usage_and_exit+0x33>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    %ebp,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @usage_and_exit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (...) @version()
%6 = call i32 (...) @usage()
%7 = load i8*, i8** %4
%8 = icmp ne i8* null, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %4
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %9, %2
%14 = load i32, i32* %3
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @usage_and_exit(i32 %0, i8* %1) {
%3 = tail call i32 (...) @version()
%4 = tail call i32 (...) @usage()
%5 = icmp eq i8* %1, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %9
9: ; preds = %6, %2
%10 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
unsigned int mk_rnd_ipv4(int);
unsigned int mk_rnd_north_american_ipv4() { return mk_rnd_ipv4(198); }


x86 assembly (clang, -O0):
<mk_rnd_north_american_ipv4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc6,%edi
call   1030 <mk_rnd_ipv4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_north_american_ipv4>:
mov    $0xc6,%edi
jmp    1030 <mk_rnd_ipv4@plt>

LLVM IR (-O0):
define i32 @mk_rnd_north_american_ipv4() {
%1 = call i32 @mk_rnd_ipv4(i32 198)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mk_rnd_north_american_ipv4() {
%1 = tail call i32 @mk_rnd_ipv4(i32 198)
ret i32 %1
}
void TmsHighTransition(void) {
  ;
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @TmsHighTransition() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putbits(int, int);
void putdmv(signed int dmv) {
  if (dmv == 0)
    putbits(0, 1);
  else if (dmv > 0)
    putbits(2, 2);
  else
    putbits(3, 2);
}


x86 assembly (clang, -O0):
<putdmv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <putdmv+0x26>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <putbits@plt>
jmp    1165 <putdmv+0x55>
cmpl   $0x0,-0x4(%rbp)
jle    1151 <putdmv+0x41>
mov    $0x2,%esi
mov    %esi,%edi
call   1030 <putbits@plt>
jmp    1160 <putdmv+0x50>
mov    $0x3,%edi
mov    $0x2,%esi
call   1030 <putbits@plt>
jmp    1165 <putdmv+0x55>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putdmv>:
test   %edi,%edi
je     1125 <putdmv+0x15>
jle    1131 <putdmv+0x21>
mov    $0x2,%edi
mov    $0x2,%esi
jmp    1030 <putbits@plt>
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <putbits@plt>
mov    $0x3,%edi
mov    $0x2,%esi
jmp    1030 <putbits@plt>

LLVM IR (-O0):
define void @putdmv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @putbits(i32 0, i32 1)
br label %15
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @putbits(i32 2, i32 2)
br label %14
12: ; preds = %7
%13 = call i32 @putbits(i32 3, i32 2)
br label %14
14: ; preds = %12, %10
br label %15
15: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
define void @putdmv(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putbits(i32 0, i32 1)
br label %11
5: ; preds = %1
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @putbits(i32 2, i32 2)
br label %11
9: ; preds = %5
%10 = tail call i32 @putbits(i32 3, i32 2)
br label %11
11: ; preds = %7, %9, %3
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *Memento_calloc(size_t n, size_t s) { return calloc(n, s); }


x86 assembly (clang, -O0):
<Memento_calloc>:
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 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memento_calloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @Memento_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @Memento_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
int force_check_katcp(struct katcp_nonsense *ns) { return 1; }


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

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

LLVM IR (-O0):
%struct.katcp_nonsense = type opaque
define i32 @force_check_katcp(%struct.katcp_nonsense* %0) {
%2 = alloca %struct.katcp_nonsense*
store %struct.katcp_nonsense* %0, %struct.katcp_nonsense** %2
ret i32 1
}

LLVM IR (-O2):
%struct.katcp_nonsense = type opaque
define i32 @force_check_katcp(%struct.katcp_nonsense* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int mvprintw(int, int, char const *, int);
int i_mvprintw(int y, int x, const char *fmt, int i) {
  return (mvprintw(y, x, fmt, i));
}


x86 assembly (clang, -O0):
<i_mvprintw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <mvprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_mvprintw>:
jmp    1030 <mvprintw@plt>

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

LLVM IR (-O2):
define i32 @i_mvprintw(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int do_pop();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stdout;
int icall_putch() {
  int ret;
  ret = do_pop();
  if (ret < 0)
    return ret;
  putchar(ret & 0x00ff);
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<icall_putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <do_pop@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1157 <icall_putch+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <icall_putch+0x4a>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1040 <putchar@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icall_putch>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <do_pop@plt>
test   %eax,%eax
js     1156 <icall_putch+0x26>
movzbl %al,%edi
call   1040 <putchar@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1158 <icall_putch+0x28>
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @icall_putch() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @do_pop()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %14
8: ; preds = %0
%9 = load i32, i32* %2
%10 = and i32 %9, 255
%11 = call i32 @putchar(i32 %10)
%12 = load i32, i32* @stdout
%13 = call i32 @fflush(i32 %12)
store i32 0, i32* %1
br label %14
14: ; preds = %8, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @icall_putch() {
%1 = tail call i32 (...) @do_pop()
%2 = icmp slt i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = and i32 %1, 255
%5 = tail call i32 @putchar(i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
br label %8
8: ; preds = %0, %3
%9 = phi i32 [ 0, %3 ], [ %1, %0 ]
ret i32 %9
}
/* Variables and functions */
int getArrayBound(int, int /*<<< orphan*/);
int popNumber();
int /*<<< orphan*/ pushNumber(int);
void basLBound() {
  int index, range;
  index = popNumber();
  range = getArrayBound(index, 0);
  popNumber();
  pushNumber(range);
}


x86 assembly (clang, -O0):
<basLBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <getArrayBound@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    -0x8(%rbp),%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basLBound>:
push   %rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <getArrayBound@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basLBound() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @popNumber()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @getArrayBound(i32 %4, i32 0)
store i32 %5, i32* %2
%6 = call i32 (...) @popNumber()
%7 = load i32, i32* %2
%8 = call i32 @pushNumber(i32 %7)
ret void
}

LLVM IR (-O2):
define void @basLBound() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @getArrayBound(i32 %1, i32 0)
%3 = tail call i32 (...) @popNumber()
%4 = tail call i32 @pushNumber(i32 %2)
ret void
}
void patchc_(nu, nv) int *nu, *nv;
{ patchcurves((long)*nu, (long)*nv); }


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

x86 assembly (clang, -O2):
<patchc_>:
movslq (%rdi),%rdi
movslq (%rsi),%rsi
xor    %eax,%eax
jmp    1030 <patchcurves@plt>

LLVM IR (-O0):
define void @patchc_(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* %5
%7 = sext i32 %6 to i64
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = call i32 (i64, i64, ...) bitcast (i32 (...)* @patchcurves to i32 (i64, i64, ...)*)(i64 %7, i64 %10)
ret void
}

LLVM IR (-O2):
define void @patchc_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @patchcurves to i32 (i64, i64, ...)*)(i64 %4, i64 %6)
ret void
}
int main() {
  int b = 3;
  int arr[] = {-3, 125, 8, 9, 10};
  short int *ptr = arr;
  ptr++;
  printf("%X, %X\n", arr + 1, ptr);
  printf("%d, %d\n", *arr, *ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rsi
add    $0x4,%rsi
mov    -0x28(%rbp),%rdx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
mov    -0x28(%rbp),%rax
movswl (%rax),%edx
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x2(%rsp),%rdx
lea    0x4(%rsp),%rsi
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
mov    %esi,%edx
sar    $0x10,%edx
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 -3, i32 125, i32 8, i32 9, i32 10]
@.str = [8 x i8] c"%X, %X\0A\00"
@.str.1 = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = bitcast [5 x i32]* %1 to i16*
%5 = getelementptr inbounds i16, i16* %4, i64 1
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %6, i16* %5)
%8 = load i32, i32* %3
%9 = ashr i32 %8, 16
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
void out(unsigned short _port, unsigned char _data) {
  __asm__("out %%al, %%dx" : : "a"(_data), "d"(_port));
}


x86 assembly (clang, -O0):
<out>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<out>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @out(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @out(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "out %al, %dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ array_roll2d_x_s(size_t, size_t, double **,
                                    int /*<<< orphan*/ const);
int /*<<< orphan*/ array_roll2d_y_s(size_t, size_t, double **,
                                    int /*<<< orphan*/ const);
void array_roll2d_s(size_t size0, size_t size1, double array[size0][size1],
                    const ssize_t shift[2]) {
  array_roll2d_x_s(size0, size1, array, shift[0]);
  array_roll2d_y_s(size0, size1, array, shift[1]);
}


x86 assembly (clang, -O0):
<array_roll2d_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
call   1030 <array_roll2d_x_s@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%ecx
call   1040 <array_roll2d_y_s@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_roll2d_s>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rcx),%ecx
call   1030 <array_roll2d_x_s@plt>
mov    0x4(%r12),%ecx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <array_roll2d_y_s@plt>

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

LLVM IR (-O2):
define void @array_roll2d_s(i64 %0, i64 %1, double* %2, i32* nocapture %3) {
%5 = bitcast double* %2 to double**
%6 = load i32, i32* %3
%7 = tail call i32 @array_roll2d_x_s(i64 %0, i64 %1, double** %5, i32 %6)
%8 = getelementptr inbounds i32, i32* %3, i64 1
%9 = load i32, i32* %8
%10 = tail call i32 @array_roll2d_y_s(i64 %0, i64 %1, double** %5, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
char wait_a_char() {
  char ch = 'x';
  scanf("%c", &ch);
  return ch;
}


x86 assembly (clang, -O0):
<wait_a_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x78,-0x1(%rbp)
lea    0xedd(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_a_char>:
push   %rax
movb   $0x78,0x7(%rsp)
lea    0xee3(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define signext i8 @wait_a_char() {
%1 = alloca i8
store i8 120, i8* %1
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define signext i8 @wait_a_char() {
%1 = alloca i8
store i8 120, i8* %1
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}
void SERVO_PWM_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @SERVO_PWM_SaveConfig() {
ret void
}
void ft_get_values(char **data, char **str) { *str = data[0]; }


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

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

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

LLVM IR (-O2):
define void @ft_get_values(i8** nocapture %0, i8** nocapture writeonly %1) {
%3 = load i8*, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prinf(char *);
int main(int argc, char *arv[]) {
  prinf("Hello\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <prinf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hello\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @prinf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long __builtin_tbegin_nofloat(int /*<<< orphan*/);
long __TM_simple_begin() { return __builtin_tbegin_nofloat(0); }


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

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

LLVM IR (-O0):
define i64 @__TM_simple_begin() {
%1 = call i64 @__builtin_tbegin_nofloat(i32 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @__TM_simple_begin() {
%1 = tail call i64 @__builtin_tbegin_nofloat(i32 0)
ret i64 %1
}
const char *Size_Definition(void) {
  return "struct Size {\n"
         "  size_t (*size)(void);\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"struct Size {\0A size_t (*size)(void);\0A};\0A\00"
define i8* @Size_Definition() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [42 x i8] c"struct Size {\0A size_t (*size)(void);\0A};\0A\00"
define i8* @Size_Definition() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ script_action_install(int);
int script_action_installnext_timer_cb(const void *pointer, void *data,
                                       int remaining_calls) {
  (void)data;
  (void)remaining_calls;
  script_action_install((pointer) ? 1 : 0);
  return 0;
}


x86 assembly (clang, -O0):
<script_action_installnext_timer_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
xor    %edi,%edi
mov    $0x1,%eax
cmp    $0x0,%rcx
cmovne %eax,%edi
call   1030 <script_action_install@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_action_installnext_timer_cb>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1030 <script_action_install@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @script_action_installnext_timer_cb(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
%13 = call i32 @script_action_install(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @script_action_installnext_timer_cb(i8* readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp ne i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @script_action_install(i32 %5)
ret i32 0
}
void rev_byte_order_2b(void *a) {
  char *p = (char *)a;
  char tmp;
  tmp = p[0];
  p[0] = p[1];
  p[1] = tmp;
}


x86 assembly (clang, -O0):
<rev_byte_order_2b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_byte_order_2b>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @rev_byte_order_2b(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8, i8* %4
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @rev_byte_order_2b(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
ret void
}
int gettimeofday(struct timeval *__restrict tm, void *__restrict tz) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.timeval = type opaque
define i32 @gettimeofday(%struct.timeval* noalias %0, i8* noalias %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @gettimeofday(%struct.timeval* noalias nocapture readnone %0, i8* noalias nocapture readnone %1) {
ret i32 0
}
int lib2t22(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @lib2t22() {
ret i32 2
}

LLVM IR (-O2):
define i32 @lib2t22() {
ret i32 2
}
int main() {
  unsigned int a, b, c;
  a = 0x40;
  b = a * 8;
  c = b / 32;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x40,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 64, i32* %2
%5 = load i32, i32* %2
%6 = mul i32 %5, 8
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = udiv i32 %7, 32
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 16
}
/* Variables and functions */
int /*<<< orphan*/ cmd(char *, char const *);
void add_if(const char *iface) { cmd("ip link add %s type wireguard", iface); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"ip link add %s type wireguard\00"
define void @add_if(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cmd(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"ip link add %s type wireguard\00"
define void @add_if(i8* %0) {
%2 = tail call i32 @cmd(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char impulse_to_class(double impulse) {
  char c;
  c = 'C';
  while (impulse >= 10.) {
    c++;
    impulse /= 2;
  }
  return c;
}


x86 assembly (clang, -O0):
<impulse_to_class>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movb   $0x43,-0x9(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1147 <impulse_to_class+0x47>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    110d <impulse_to_class+0xd>
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<impulse_to_class>:
mov    $0x43,%al
ucomisd 0xef6(%rip),%xmm0
jb     112c <impulse_to_class+0x2c>
mov    $0x43,%al
movsd  0xef2(%rip),%xmm1
movsd  0xee2(%rip),%xmm2
xchg   %ax,%ax
add    $0x1,%al
mulsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jae    1120 <impulse_to_class+0x20>
ret

LLVM IR (-O0):
define signext i8 @impulse_to_class(double %0) {
%2 = alloca double
%3 = alloca i8
store double %0, double* %2
store i8 67, i8* %3
br label %4
4: ; preds = %7, %1
%5 = load double, double* %2
%6 = fcmp oge double %5, 1.000000e+01
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i8, i8* %3
%9 = add i8 %8, 1
store i8 %9, i8* %3
%10 = load double, double* %2
%11 = fdiv double %10, 2.000000e+00
store double %11, double* %2
br label %4
12: ; preds = %4
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @impulse_to_class(double %0) {
%2 = fcmp ult double %0, 1.000000e+01
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %6, %3 ], [ 67, %1 ]
%5 = phi double [ %7, %3 ], [ %0, %1 ]
%6 = add i8 %4, 1
%7 = fmul double %5, 5.000000e-01
%8 = fcmp ult double %7, 1.000000e+01
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8 [ 67, %1 ], [ %6, %3 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fn_BB(void) { printf("B=>B\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"B=>B\00"
define void @fn_BB() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void foo724(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo724(i32 %0) {
ret void
}
/* Variables and functions */
char *appaserver_parameter_file_get_appaserver_mount_point();
int /*<<< orphan*/ set_environment(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void add_library_to_python_path(void) {
  char *appaserver_mount_point;
  char python_library_path[128];
  appaserver_mount_point =
      appaserver_parameter_file_get_appaserver_mount_point();
  sprintf(python_library_path, "%s/library", appaserver_mount_point);
  set_environment("PYTHONPATH", python_library_path);
}


x86 assembly (clang, -O0):
<add_library_to_python_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    $0x0,%al
call   1040 <appaserver_parameter_file_get_appaserver_mount_point@plt>
mov    %rax,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea8(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1030 <set_environment@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_library_to_python_path>:
push   %rbx
sub    $0x80,%rsp
xor    %eax,%eax
call   1040 <appaserver_parameter_file_get_appaserver_mount_point@plt>
lea    0xeba(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rdx
call   1050 <sprintf@plt>
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <set_environment@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s/library\00"
@.str.1 = [11 x i8] c"PYTHONPATH\00"
define void @add_library_to_python_path() {
%1 = alloca i8*
%2 = alloca [128 x i8]
%3 = call i8* (...) @appaserver_parameter_file_get_appaserver_mount_point()
store i8* %3, i8** %1
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = load i8*, i8** %1
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%8 = call i32 @set_environment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s/library\00"
@.str.1 = [11 x i8] c"PYTHONPATH\00"
define void @add_library_to_python_path() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = tail call i8* (...) @appaserver_parameter_file_get_appaserver_mount_point()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @set_environment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((__weak__, __always___)) double
softboundcets_difftime(time_t time1, time_t time0) {
  return difftime(time1, time0);
}


x86 assembly (clang, -O0):
<softboundcets_difftime>:
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   1030 <difftime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_difftime>:
jmp    1030 <difftime@plt>

LLVM IR (-O0):
define weak double @softboundcets_difftime(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 double @difftime(i32 %5, i32 %6)
ret double %7
}

LLVM IR (-O2):
define weak double @softboundcets_difftime(i32 %0, i32 %1) {
%3 = tail call double @difftime(i32 %0, i32 %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ prstatus_t;

/* Variables and functions */
size_t ukvm_dumpcore_prstatus_size(void) { return sizeof(prstatus_t); }


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

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

LLVM IR (-O0):
define i64 @ukvm_dumpcore_prstatus_size() {
ret i64 4
}

LLVM IR (-O2):
define i64 @ukvm_dumpcore_prstatus_size() {
ret i64 4
}
/* Variables and functions */
int /*<<< orphan*/ clear_vram_display904();
int /*<<< orphan*/ commit_display904();
void clear_display904() {
  clear_vram_display904();
  commit_display904();
}


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

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

LLVM IR (-O0):
define void @clear_display904() {
%1 = call i32 (...) @clear_vram_display904()
%2 = call i32 (...) @commit_display904()
ret void
}

LLVM IR (-O2):
define void @clear_display904() {
%1 = tail call i32 (...) @clear_vram_display904()
%2 = tail call i32 (...) @commit_display904()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, int, int);
void key(unsigned char key, int x, int y) {
  printf("kDN: %c <%d> @ (%d,%d)\n", key, key, x, y);
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xec8(%rip),%rdi
movzbl %dl,%esi
movzbl %al,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee2(%rip),%rdi
mov    %edx,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [24 x i8] c"kDN: %c <%d> @ (%d,%d)\0A\00"
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8 zeroext %0, i8 zeroext %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_parse_sample_format() {
  printf("NOT IMPLEMENTED:"
         "pa_parse_sample_format"
         "\n");
}


x86 assembly (clang, -O0):
<pa_parse_sample_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_parse_sample_format\0A\00"
define i32 @pa_parse_sample_format() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_parse_sample_format\00"
define i32 @pa_parse_sample_format() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ CmdEndParagraph(int /*<<< orphan*/);
int /*<<< orphan*/ CmdIndent(int);
int /*<<< orphan*/ CmdVspace(int);
int /*<<< orphan*/ startParagraph(char *, int);
void PrepareDisplayedBitmap(char *the_type) {
  CmdEndParagraph(0);
  CmdVspace(1);
  CmdIndent(1);
  startParagraph(the_type, 1);
}


x86 assembly (clang, -O0):
<PrepareDisplayedBitmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1060 <CmdEndParagraph@plt>
mov    $0x1,%edi
call   1030 <CmdVspace@plt>
mov    $0x1,%edi
call   1040 <CmdIndent@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1050 <startParagraph@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrepareDisplayedBitmap>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1060 <CmdEndParagraph@plt>
mov    $0x1,%edi
call   1030 <CmdVspace@plt>
mov    $0x1,%edi
call   1040 <CmdIndent@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1050 <startParagraph@plt>

LLVM IR (-O0):
define void @PrepareDisplayedBitmap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @CmdEndParagraph(i32 0)
%4 = call i32 @CmdVspace(i32 1)
%5 = call i32 @CmdIndent(i32 1)
%6 = load i8*, i8** %2
%7 = call i32 @startParagraph(i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @PrepareDisplayedBitmap(i8* %0) {
%2 = tail call i32 @CmdEndParagraph(i32 0)
%3 = tail call i32 @CmdVspace(i32 1)
%4 = tail call i32 @CmdIndent(i32 1)
%5 = tail call i32 @startParagraph(i8* %0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ putbuf(int /*<<< orphan*/ *, int);
void putbuf2(uint16_t i) { putbuf(&i, 2); }


x86 assembly (clang, -O0):
<putbuf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x2,%esi
call   1030 <putbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putbuf2>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x2,%esi
call   1030 <putbuf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @putbuf2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @putbuf(i32* %2, i32 2)
ret void
}