xunge/DecIR huggingface dataset:
unsigned int xxh_mix(unsigned int x, unsigned int seed) {
  unsigned int crc = x + seed + 2654435761U;
  crc ^= crc >> 15;
  crc *= 2246822519U;
  crc ^= crc >> 13;
  crc *= 3266489917U;
  crc ^= crc >> 16;
  return crc;
}


x86 assembly (clang, -O0):
<xxh_mix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x9e3779b1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xf,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x85ebca77,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xd,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0xc2b2ae3d,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxh_mix>:
lea    (%rdi,%rsi,1),%eax
add    $0x9e3779b1,%eax
mov    %eax,%ecx
shr    $0xf,%ecx
xor    %eax,%ecx
imul   $0x85ebca77,%ecx,%eax
mov    %eax,%ecx
shr    $0xd,%ecx
xor    %eax,%ecx
imul   $0xc2b2ae3d,%ecx,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xxh_mix(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add i32 %6, %7
%9 = add i32 %8, -1640531535
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = lshr i32 %10, 15
%12 = load i32, i32* %5
%13 = xor i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = mul i32 %14, -2048144777
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = lshr i32 %16, 13
%18 = load i32, i32* %5
%19 = xor i32 %18, %17
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = mul i32 %20, -1028477379
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = lshr i32 %22, 16
%24 = load i32, i32* %5
%25 = xor i32 %24, %23
store i32 %25, i32* %5
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @xxh_mix(i32 %0, i32 %1) {
%3 = add i32 %0, -1640531535
%4 = add i32 %3, %1
%5 = lshr i32 %4, 15
%6 = xor i32 %5, %4
%7 = mul i32 %6, -2048144777
%8 = lshr i32 %7, 13
%9 = xor i32 %8, %7
%10 = mul i32 %9, -1028477379
%11 = lshr i32 %10, 16
%12 = xor i32 %11, %10
ret i32 %12
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
void pauseUntilStdInputEnter(void) {
  printf("\nInput Enter to Return...");
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<pauseUntilStdInputEnter>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1148 <pauseUntilStdInputEnter+0x28>
jmp    1130 <pauseUntilStdInputEnter+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pauseUntilStdInputEnter>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1130 <pauseUntilStdInputEnter+0x10>
pop    %rax
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0AInput Enter to Return...\00"
define void @pauseUntilStdInputEnter() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0AInput Enter to Return...\00"
define void @pauseUntilStdInputEnter() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_indent(int indent) {
  int i;
  for (i = 0; i < indent; i++) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <print_indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %rbx
test   %edi,%edi
jle    112f <print_indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_indent+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sequencia(int);
int main() {
  printf("o valor da sequencia para n = 5 eh: %d", sequencia(5));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"o valor da sequencia para n = 5 eh: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sequencia(i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"o valor da sequencia para n = 5 eh: %d\00"
define i32 @main() {
%1 = tail call i32 @sequencia(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int okn_mtx3_init(struct okn_mtx3 *mtx) {}


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

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

LLVM IR (-O0):
%struct.okn_mtx3 = type opaque
define i32 @okn_mtx3_init(%struct.okn_mtx3* %0) {
%2 = alloca i32
%3 = alloca %struct.okn_mtx3*
store %struct.okn_mtx3* %0, %struct.okn_mtx3** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.okn_mtx3 = type opaque
define i32 @okn_mtx3_init(%struct.okn_mtx3* nocapture readnone %0) {
ret i32 undef
}
double approx1(double x1, double x2, double x3, double c1, double c2) {
  double T1 = x1 - c1;
  double T2 = T1 - x2;
  double T3 = T1 - x3;
  return c2 * (T2 * T2 - T3 * T3);
}


x86 assembly (clang, -O0):
<approx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm2
mulsd  -0x40(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<approx1>:
subsd  %xmm3,%xmm0
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm3,%xmm3
subsd  %xmm0,%xmm3
mulsd  %xmm4,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @approx1(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%14 = load double, double* %6
%15 = load double, double* %9
%16 = fsub double %14, %15
store double %16, double* %11
%17 = load double, double* %11
%18 = load double, double* %7
%19 = fsub double %17, %18
store double %19, double* %12
%20 = load double, double* %11
%21 = load double, double* %8
%22 = fsub double %20, %21
store double %22, double* %13
%23 = load double, double* %10
%24 = load double, double* %12
%25 = load double, double* %12
%26 = load double, double* %13
%27 = load double, double* %13
%28 = fmul double %26, %27
%29 = fneg double %28
%30 = call double @llvm.fmuladd.f64(double %24, double %25, double %29)
%31 = fmul double %23, %30
ret double %31
}

LLVM IR (-O2):
define double @approx1(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %3
%7 = fsub double %6, %1
%8 = fsub double %6, %2
%9 = fneg double %8
%10 = fmul double %8, %9
%11 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %10)
%12 = fmul double %11, %4
ret double %12
}
__attribute__((section(".separate_section"))) int func(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @func() section ".separate_section" {
ret i32 0
}

LLVM IR (-O2):
define i32 @func() section ".separate_section" {
ret i32 0
}
/* Type definitions */
struct value_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct value_t *);
void value_free(struct value_t *value) { free(value); }


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

x86 assembly (clang, -O2):
<value_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.value_t = type { i32 }
define void @value_free(%struct.value_t* %0) {
%2 = alloca %struct.value_t*
store %struct.value_t* %0, %struct.value_t** %2
%3 = load %struct.value_t*, %struct.value_t** %2
%4 = call i32 @free(%struct.value_t* %3)
ret void
}

LLVM IR (-O2):
%struct.value_t = type { i32 }
define void @value_free(%struct.value_t* nocapture %0) {
%2 = tail call i32 @free(%struct.value_t* %0)
ret void
}
int signed_high_prod(int x, int y) {
  int w = sizeof(int) << 3;
  long long prod = ((long long)x) * ((long long)y);
  return (int)(prod >> w);
}


x86 assembly (clang, -O0):
<signed_high_prod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_high_prod>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i32 @signed_high_prod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul nsw i64 %8, %10
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = ashr i64 %12, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @signed_high_prod(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
%6 = lshr i64 %5, 32
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int PAPI_create_eventset(int *);
void PAPIF_CREATE_EVENTSET(int *EventSet, int *check) {
  *check = PAPI_create_eventset(EventSet);
}


x86 assembly (clang, -O0):
<PAPIF_CREATE_EVENTSET>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <PAPI_create_eventset@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_CREATE_EVENTSET>:
push   %rbx
mov    %rsi,%rbx
call   1030 <PAPI_create_eventset@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_CREATE_EVENTSET(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 = call i32 @PAPI_create_eventset(i32* %5)
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @PAPIF_CREATE_EVENTSET(i32* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @PAPI_create_eventset(i32* %0)
store i32 %3, i32* %1
ret void
}
int tegra_pm_irq_set_wake_type(int wake, int flow_type) { return 0; }


x86 assembly (clang, -O0):
<tegra_pm_irq_set_wake_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tegra_pm_irq_set_wake_type(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
unsigned int UARTRegConfigModeEnable(unsigned int, int);
unsigned int UARTSpaceAvail(unsigned int baseAdd) {
  unsigned int lcrRegValue = 0;
  unsigned int retVal = 0;
  lcrRegValue = UARTRegConfigModeEnable(baseAdd, (0x007F));
  if ((*((volatile unsigned int *)(baseAdd + (0x14)))) &
      ((0x00000040u) | (0x00000020u))) {
    retVal = 1;
  }
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = lcrRegValue;
  return retVal;
}


x86 assembly (clang, -O0):
<UARTSpaceAvail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x7f,%esi
call   1030 <UARTRegConfigModeEnable@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x60,%eax
cmp    $0x0,%eax
je     1156 <UARTSpaceAvail+0x46>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTSpaceAvail>:
push   %rbx
mov    %edi,%ebx
mov    $0x7f,%esi
call   1030 <UARTRegConfigModeEnable@plt>
lea    0x14(%rbx),%edx
xor    %ecx,%ecx
testl  $0x60,(%rdx)
setne  %cl
add    $0xc,%ebx
mov    %eax,(%rbx)
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UARTSpaceAvail(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @UARTRegConfigModeEnable(i32 %5, i32 127)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = add i32 %7, 20
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 96
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 1, i32* %4
br label %15
15: ; preds = %14, %1
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = add i32 %17, 12
%19 = zext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %16, i32* %20
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @UARTSpaceAvail(i32 %0) {
%2 = tail call i32 @UARTRegConfigModeEnable(i32 %0, i32 127)
%3 = add i32 %0, 20
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 96
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = add i32 %0, 12
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %2, i32* %12
ret i32 %9
}
/* Variables and functions */
size_t index_of(void *heap, void *elem, size_t size) {
  return (size_t)(((char *)elem - (char *)heap) / size);
}


x86 assembly (clang, -O0):
<index_of>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_of>:
mov    %rdx,%rcx
mov    %rsi,%rax
sub    %rdi,%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     111b <index_of+0x1b>
xor    %edx,%edx
div    %rcx
ret
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
define i64 @index_of(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = load i64, i64* %6
%13 = udiv i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @index_of(i8* %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = udiv i64 %6, %2
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ drawDbuff();
int /*<<< orphan*/ drawMiniMap();
int /*<<< orphan*/ drawUI();
void drawGameScreen(void) {
  drawMiniMap();
  drawUI();
  drawDbuff();
}


x86 assembly (clang, -O0):
<drawGameScreen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <drawMiniMap@plt>
mov    $0x0,%al
call   1030 <drawUI@plt>
mov    $0x0,%al
call   1050 <drawDbuff@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawGameScreen>:
push   %rax
xor    %eax,%eax
call   1040 <drawMiniMap@plt>
xor    %eax,%eax
call   1030 <drawUI@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <drawDbuff@plt>

LLVM IR (-O0):
define void @drawGameScreen() {
%1 = call i32 (...) @drawMiniMap()
%2 = call i32 (...) @drawUI()
%3 = call i32 (...) @drawDbuff()
ret void
}

LLVM IR (-O2):
define void @drawGameScreen() {
%1 = tail call i32 (...) @drawMiniMap()
%2 = tail call i32 (...) @drawUI()
%3 = tail call i32 (...) @drawDbuff()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int main(void) {
  for (long long i = 1;; i++) {
    printf("Slept for a total of %lld iterations.\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <main+0x17>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [39 x i8] c"Slept for a total of %lld iterations.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %2
br label %3
3: ; preds = %6, %0
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %4)
br label %6
6: ; preds = %3
%7 = load i64, i64* %2
%8 = add nsw i64 %7, 1
store i64 %8, i64* %2
br label %3
}

LLVM IR (-O2):
@.str = [39 x i8] c"Slept for a total of %lld iterations.\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = add nuw nsw i64 %2, 1
br label %1
}
int flash_clear_lock_bits(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @flash_clear_lock_bits() {
ret i32 1
}
txt_parameter(chan, control, value) {
  prtime();
  printf("Parameter, chan=%d c1=%d c2=%d\n", chan + 1, control, value);
}


x86 assembly (clang, -O0):
<txt_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_parameter>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Parameter, chan=%d c1=%d c2=%d\0A\00"
define i32 @txt_parameter(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = call i32 (...) @prtime()
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [32 x i8] c"Parameter, chan=%d c1=%d c2=%d\0A\00"
define i32 @txt_parameter(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @prtime()
%5 = add nsw i32 %0, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1, i32 %2)
ret i32 undef
}
/* Type definitions */
struct parameter {
  int dummy;
};

/* Variables and functions */
int pcommand(int, char *);
int com_bell(int p0, struct parameter *param) {
  int retval;
  (void)(param);
  if ((retval = pcommand(p0, "set bell")) != 0)
    return retval;
  else
    return 9;
}


x86 assembly (clang, -O0):
<com_bell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    0xed7(%rip),%rsi
call   1030 <pcommand@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1145 <com_bell+0x35>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <com_bell+0x3c>
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_bell>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <pcommand@plt>
test   %eax,%eax
mov    $0x9,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.parameter = type { i32 }
@.str = [9 x i8] c"set bell\00"
define i32 @com_bell(i32 %0, %struct.parameter* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.parameter*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.parameter* %1, %struct.parameter** %5
%7 = load %struct.parameter*, %struct.parameter** %5
%8 = load i32, i32* %4
%9 = call i32 @pcommand(i32 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %6
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 9, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.parameter = type { i32 }
@.str = [9 x i8] c"set bell\00"
define i32 @com_bell(i32 %0, %struct.parameter* nocapture readnone %1) {
%3 = tail call i32 @pcommand(i32 %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 9, i32 %3
ret i32 %5
}
unsigned _hl_buffer_size(void) { return 1024; }


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

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

LLVM IR (-O0):
define i32 @_hl_buffer_size() {
ret i32 1024
}

LLVM IR (-O2):
define i32 @_hl_buffer_size() {
ret i32 1024
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int fstat(int, struct stat *);
int __fxstat(int ver, int fd, struct stat *buf) { return fstat(fd, buf); }


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

x86 assembly (clang, -O2):
<__fxstat>:
mov    %esi,%edi
mov    %rdx,%rsi
jmp    1030 <fstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @__fxstat(i32 %0, i32 %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.stat* %2, %struct.stat** %6
%7 = load i32, i32* %5
%8 = load %struct.stat*, %struct.stat** %6
%9 = call i32 @fstat(i32 %7, %struct.stat* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @__fxstat(i32 %0, i32 %1, %struct.stat* nocapture %2) {
%4 = tail call i32 @fstat(i32 %1, %struct.stat* %2)
ret i32 %4
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stdout;
char *strerror(int);
void nc_error(char *where) {
  fprintf(stdout,
          "rtv:ERROR: "
          "NC error:%s:%d:%s\n",
          where, errno, strerror(errno));
}


x86 assembly (clang, -O0):
<nc_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    %rax,%r8
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_error>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eaa(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea9(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1040 <strerror@plt>
lea    0xeb9(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %rax,%r8
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [30 x i8] c"rtv:ERROR: NC error:%s:%d:%s\0A\00"
@errno = global i32 0
define void @nc_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = load i32, i32* @errno
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5, i8* %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [30 x i8] c"rtv:ERROR: NC error:%s:%d:%s\0A\00"
@errno = global i32 0
define void @nc_error(i8* %0) {
%2 = load i32, i32* @stdout
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __objref_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<__objref_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__objref_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void finalizer_scrub256(void *ptr) {
  uint64_t *sz_ptr = (uint64_t *)ptr;
  int i;
  for (i = 0; i < 32; i++)
    sz_ptr[i] = 0xa5a5a5a5a5a5a5a5ULL;
}


x86 assembly (clang, -O0):
<finalizer_scrub256>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    113e <finalizer_scrub256+0x3e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xa5a5a5a5,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <finalizer_scrub256+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<finalizer_scrub256>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @finalizer_scrub256(i8* nocapture writeonly %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
uint32_t UARTParityModeGet(uint32_t ui32Base) {
  ASSERT(_UARTBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x0000002C))) &
          (0x00000080 | 0x00000004 | 0x00000002));
}


x86 assembly (clang, -O0):
<UARTParityModeGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%eax
and    $0x86,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeGet>:
push   %rbx
mov    %edi,%ebx
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rcx
mov    $0x86,%eax
and    0x2c(%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UARTParityModeGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_UARTBaseValid(i32 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 44
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 134
ret i32 %11
}

LLVM IR (-O2):
define i32 @UARTParityModeGet(i32 %0) {
%2 = tail call i32 @_UARTBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i32 %0, 44
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 134
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int findprop(char *);
int upload(int /*<<< orphan*/ *, int, int);
int ploadbuf(uint8_t *dlbuf, int count, char *port, int type) {
  int rc = 0;
  rc = findprop(port);
  if (!rc) {
    rc = upload(dlbuf, count, type);
  }
  return rc;
}


x86 assembly (clang, -O0):
<ploadbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <findprop@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1165 <ploadbuf+0x45>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <upload@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ploadbuf>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <findprop@plt>
test   %eax,%eax
je     113d <ploadbuf+0x1d>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <upload@plt>

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

LLVM IR (-O2):
define i32 @ploadbuf(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @findprop(i8* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @upload(i32* %0, i32 %1, i32 %3)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %5, %4 ], [ %8, %7 ]
ret i32 %10
}
void RTMpGetCount(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMpGetCount() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0;
  int b = 1;
  int c = 2;
  int d = 3;
  printf("VALUE OF %d", d);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"VALUE OF %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ stderr;
FILE *epopen(char *com, char *mode) {
  FILE *fp;
  if (fp = popen(com, mode))
    return fp;
  fprintf(stderr, "couldn't open stream %s mode %s\n", com, mode);
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<epopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <popen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1165 <epopen+0x35>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe83(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<epopen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <popen@plt>
test   %rax,%rax
je     114c <epopen+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"couldn't open stream %s mode %s\0A\00"
define noalias i32* @epopen(i8* %0, i8* %1) {
%3 = tail call i32* @popen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i32* %3
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%9 = tail call i32 @exit(i32 1)
unreachable
}
void vsub(float *v1, float *v2, float *out) {
  out[0] = v1[0] - v2[0];
  out[1] = v1[1] - v2[1];
  out[2] = v1[2] - v2[2];
}


x86 assembly (clang, -O0):
<vsub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsub>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
subss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vsub(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vsub(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fsub float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
void wifi_rsp_hardware_change_notification_config(
    const struct wifi_msg_hardware_change_notification_config_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_hardware_change_notification_config_rsp_t = type opaque
define void @wifi_rsp_hardware_change_notification_config(%struct.wifi_msg_hardware_change_notification_config_rsp_t* nocapture %0) {
ret void
}
int occampi_asm_post_setup(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @occampi_asm_post_setup() {
ret i32 0
}

LLVM IR (-O2):
define i32 @occampi_asm_post_setup() {
ret i32 0
}
/* Variables and functions */
int func1();
int func2() { return func1() + 1; }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func1@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rax
xor    %eax,%eax
call   1030 <func1@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func2() {
%1 = call i32 (...) @func1()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func2() {
%1 = tail call i32 (...) @func1()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gcd(int, int);
int input();
int /*<<< orphan*/ output(int /*<<< orphan*/);
int main(void) {
  int x;
  int y;
  x = input();
  y = input();
  output(gcd(x, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <gcd@plt>
mov    %eax,%edi
call   1040 <output@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <input@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <gcd@plt>
mov    %eax,%edi
call   1040 <output@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @input()
store i32 %4, i32* %2
%5 = call i32 (...) @input()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @gcd(i32 %6, i32 %7)
%9 = call i32 @output(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @input()
%2 = tail call i32 (...) @input()
%3 = tail call i32 @gcd(i32 %1, i32 %2)
%4 = tail call i32 @output(i32 %3)
ret i32 0
}
void do_double_math(double *x) {
  printf("%s: X before: %f\n", __func__, *x);
  *x += 5;
  printf("%s: X after: %f\n", __func__, *x);
}


x86 assembly (clang, -O0):
<do_double_math>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xedd(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0xebb(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xecd(%rip),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_double_math>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
lea    0xee6(%rip),%rdi
lea    0xef1(%rip),%r14
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  (%rbx),%xmm0
addsd  0xec1(%rip),%xmm0
movsd  %xmm0,(%rbx)
lea    0xedf(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s: X before: %f\0A\00"
@__func__.do_double_math = [15 x i8] c"do_double_math\00"
@.str.1 = [17 x i8] c"%s: X after: %f\0A\00"
define void @do_double_math(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.do_double_math, i64 0, i64 0), double %4)
%6 = load double*, double** %2
%7 = load double, double* %6
%8 = fadd double %7, 5.000000e+00
store double %8, double* %6
%9 = load double*, double** %2
%10 = load double, double* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.do_double_math, i64 0, i64 0), double %10)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s: X before: %f\0A\00"
@__func__.do_double_math = [15 x i8] c"do_double_math\00"
@.str.1 = [17 x i8] c"%s: X after: %f\0A\00"
define void @do_double_math(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.do_double_math, i64 0, i64 0), double %2)
%4 = load double, double* %0
%5 = fadd double %4, 5.000000e+00
store double %5, double* %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.do_double_math, i64 0, i64 0), double %5)
ret void
}
int internal_bb() { return 64; }


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

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

LLVM IR (-O0):
define i32 @internal_bb() {
ret i32 64
}

LLVM IR (-O2):
define i32 @internal_bb() {
ret i32 64
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void releaser(void *obj) { printf("Should release: %p\n", obj); }


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"Should release: %p\0A\00"
define void @releaser(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}