xunge/DecIR huggingface dataset:
int DRV_GET_ARM_PLL_STATUS(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_GET_ARM_PLL_STATUS() {
ret i32 0
}
void par_shapes__copy3(float *result, float const *a) {
  result[0] = a[0];
  result[1] = a[1];
  result[2] = a[2];
}


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

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

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

LLVM IR (-O2):
define void @par_shapes__copy3(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
ret void
}
double wavg_impl(double x, double y, double w, const char *file, int line) {
  (void)(file);
  (void)(line);
  (void)(w >= 0.0);
  (void)(w <= 1.0);
  return (x + (y - x) * w);
}


x86 assembly (clang, -O0):
<wavg_impl>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wavg_impl>:
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @wavg_impl(double %0, double %1, double %2, i8* %3, i32 %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i8*
%10 = alloca i32
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %9
%12 = load i32, i32* %10
%13 = load double, double* %8
%14 = fcmp oge double %13, 0.000000e+00
%15 = zext i1 %14 to i32
%16 = load double, double* %8
%17 = fcmp ole double %16, 1.000000e+00
%18 = zext i1 %17 to i32
%19 = load double, double* %6
%20 = load double, double* %7
%21 = load double, double* %6
%22 = fsub double %20, %21
%23 = load double, double* %8
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double %19)
ret double %24
}

LLVM IR (-O2):
define double @wavg_impl(double %0, double %1, double %2, i8* nocapture readnone %3, i32 %4) {
%6 = fsub double %1, %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %2, double %0)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(char *);
void *malloc(int);
int /*<<< orphan*/ my_strlen(char *);
int /*<<< orphan*/ xwrite(int, char *, int /*<<< orphan*/);
void *xmalloc(int size) {
  void *tmp;
  char *err;
  tmp = malloc(size);
  if (tmp == NULL) {
    err = "Get Next Line Error : malloc error";
    xwrite(2, err, my_strlen(err));
    free(err);
    exit(-1);
  }
  return (tmp);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11b1 <xmalloc+0x61>
lea    0xe87(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1050 <xwrite@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1060 <malloc@plt>
test   %rax,%rax
je     115d <xmalloc+0xd>
pop    %rbx
ret
lea    0xe9c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <my_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <xwrite@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Get Next Line Error : malloc error\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i8* @malloc(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %17
9: ; preds = %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @my_strlen(i8* %11)
%13 = call i32 @xwrite(i32 2, i8* %10, i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
%16 = call i32 @exit(i32 -1)
unreachable
17: ; preds = %1
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [35 x i8] c"Get Next Line Error : malloc error\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @my_strlen(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @xwrite(i32 2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @free(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ drop_all_storage();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig(int num) {
  drop_all_storage();
  exit(0);
}


x86 assembly (clang, -O0):
<sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <drop_all_storage@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig>:
push   %rax
xor    %eax,%eax
call   1030 <drop_all_storage@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @drop_all_storage()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sig(i32 %0) {
%2 = tail call i32 (...) @drop_all_storage()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int startup_INFO(void) { return 200; }


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

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

LLVM IR (-O0):
define i32 @startup_INFO() {
ret i32 200
}

LLVM IR (-O2):
define i32 @startup_INFO() {
ret i32 200
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int htonl(int);
extern uint64_t ntohll(uint64_t number) {
  return (htonl((number >> 32) & 0xFFFFFFFF) |
          ((uint64_t)(htonl(number & 0xFFFFFFFF)) << 32));
}


x86 assembly (clang, -O0):
<ntohll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
and    $0xffffffff,%edi
call   1030 <htonl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffffffff,%edi
call   1030 <htonl@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohll>:
push   %rbx
mov    %edi,%ebx
call   1030 <htonl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @ntohll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 32
%5 = and i32 %4, -1
%6 = call i32 @htonl(i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, -1
%9 = call i32 @htonl(i32 %8)
%10 = shl i32 %9, 32
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ntohll(i32 %0) {
%2 = tail call i32 @htonl(i32 poison)
%3 = tail call i32 @htonl(i32 %0)
ret i32 poison
}
int ab5500_btemp_get_batctrl_temp(struct ab5500_btemp *btemp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ab5500_btemp = type opaque
define i32 @ab5500_btemp_get_batctrl_temp(%struct.ab5500_btemp* nocapture readnone %0) {
ret i32 0
}
int of_instance_to_package(int in_handle) {
  struct {
    const char *name;
    int num_args;
    int num_returns;
    int in_handle;
    int handle;
  } args;
  args.name = "instance-to-package";
  args.num_args = 1;
  args.num_returns = 1;
  args.in_handle = in_handle;
  of(&args);
  return args.handle;
}


x86 assembly (clang, -O0):
<of_instance_to_package>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <of@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<of_instance_to_package>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x8(%rsp)
mov    %edi,0x10(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <of@plt>
mov    0x14(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32, i32, i32, i32 }
@.str = [20 x i8] c"instance-to-package\00"
define i32 @of_instance_to_package(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.anon
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 1
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 2
store i32 1, i32* %6
%7 = load i32, i32* %2
%8 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 3
store i32 %7, i32* %8
%9 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @of to i32 (%struct.anon*, ...)*)(%struct.anon* %3)
%10 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 4
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32, i32, i32, i32 }
@.str = [20 x i8] c"instance-to-package\00"
define i32 @of_instance_to_package(i32 %0) {
%2 = alloca %struct.anon
%3 = bitcast %struct.anon* %2 to i8*
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 0
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 1
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 2
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 3
store i32 %0, i32* %7
%8 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @of to i32 (%struct.anon*, ...)*)(%struct.anon* %2)
%9 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 4
%10 = load i32, i32* %9
ret i32 %10
}
int check_prime(int num) {
  int i = 2;
  while (i < num) {
    if (num % i == 0)
      return 1;
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1144 <check_prime+0x44>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <check_prime+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114b <check_prime+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <check_prime+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @check_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %19
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
store i32 0, i32* %2
br label %19
19: ; preds = %18, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char *arg[]) {
  int t[] = {};
  if (sizeof(t) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [0 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [0 x i32]* %6 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int omap1_mux_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap1_mux_init() {
ret i32 0
}
int factorial(int number) {
  return number * ((number > 1) ? factorial(number - 1) : 1);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    113e <factorial+0x2e>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
jmp    114b <factorial+0x3b>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <factorial+0x3b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1125 <factorial+0x15>
lea    -0x1(%rbx),%edi
call   1030 <factorial@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @factorial(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = call i32 @factorial(i32 %8)
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 1, %10 ]
%13 = mul nsw i32 %3, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @factorial(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @factorial(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 1, %1 ]
%8 = mul nsw i32 %7, %0
ret i32 %8
}
/* Type definitions */
struct slName {
  int dummy;
};

/* Variables and functions */
struct slName *newSlName(char *);
int /*<<< orphan*/ slAddHead(struct slName **, struct slName *);
struct slName *slNameAddHead(struct slName **pList, char *name) {
  struct slName *el = newSlName(name);
  slAddHead(pList, el);
  return el;
}


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

x86 assembly (clang, -O2):
<slNameAddHead>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <newSlName@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <slAddHead@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.slName = type { i32 }
define %struct.slName* @slNameAddHead(%struct.slName** %0, i8* %1) {
%3 = alloca %struct.slName**
%4 = alloca i8*
%5 = alloca %struct.slName*
store %struct.slName** %0, %struct.slName*** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call %struct.slName* @newSlName(i8* %6)
store %struct.slName* %7, %struct.slName** %5
%8 = load %struct.slName**, %struct.slName*** %3
%9 = load %struct.slName*, %struct.slName** %5
%10 = call i32 @slAddHead(%struct.slName** %8, %struct.slName* %9)
%11 = load %struct.slName*, %struct.slName** %5
ret %struct.slName* %11
}

LLVM IR (-O2):
%struct.slName = type { i32 }
define %struct.slName* @slNameAddHead(%struct.slName** %0, i8* %1) {
%3 = tail call %struct.slName* @newSlName(i8* %1)
%4 = tail call i32 @slAddHead(%struct.slName** %0, %struct.slName* %3)
ret %struct.slName* %3
}
/* Variables and functions */
int /*<<< orphan*/ USART_send(char);
void USART_putstring(char *StringPtr) {
  while (*StringPtr != 0x00) {
    USART_send(*StringPtr);
    StringPtr++;
  }
}


x86 assembly (clang, -O0):
<USART_putstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <USART_putstring+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <USART_send@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <USART_putstring+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @USART_putstring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @USART_send(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int stun_make_type(int);
uint16_t stun_make_indication(uint16_t method) {
  return ((stun_make_type(method) & 0xFEEF) | 0x0010);
}


x86 assembly (clang, -O0):
<stun_make_indication>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <stun_make_type@plt>
and    $0xfeef,%eax
or     $0x10,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_make_indication>:
push   %rax
call   1030 <stun_make_type@plt>
and    $0xfeef,%eax
or     $0x10,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stun_make_indication(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @stun_make_type(i32 %3)
%5 = and i32 %4, 65263
%6 = or i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @stun_make_indication(i32 %0) {
%2 = tail call i32 @stun_make_type(i32 %0)
%3 = and i32 %2, 65263
%4 = or i32 %3, 16
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ do_fputchars();
void do_fputstring(void) { do_fputchars(); }


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

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

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

LLVM IR (-O2):
define void @do_fputstring() {
%1 = tail call i32 (...) @do_fputchars()
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c;
  int x, y, z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  c = 0;
  while (x > z) {
    while (y > z) {
      y = y - 1;
      c = c + 1;
    }
    c = c + 1;
    x = x - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    118f <main+0x7f>
jmp    1155 <main+0x45>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1178 <main+0x68>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x34>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SubGussFs(double *, double *, double, double, int);
void CalGuassFromLB(double dLongitude, double dLatitude, double *dX, double *dY,
                    long nCenterL) {
  int CenterL = (int)nCenterL;
  SubGussFs(dX, dY, dLatitude, dLongitude, CenterL);
  nCenterL = (long)CenterL;
}


x86 assembly (clang, -O0):
<CalGuassFromLB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0x2c(%rbp),%edx
call   1030 <SubGussFs@plt>
movslq -0x2c(%rbp),%rax
mov    %rax,-0x28(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalGuassFromLB>:
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
jmp    1030 <SubGussFs@plt>

LLVM IR (-O0):
define void @CalGuassFromLB(double %0, double %1, double* %2, double* %3, i64 %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca i64
%11 = alloca i32
store double %0, double* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store i64 %4, i64* %10
%12 = load i64, i64* %10
%13 = trunc i64 %12 to i32
store i32 %13, i32* %11
%14 = load double*, double** %8
%15 = load double*, double** %9
%16 = load double, double* %7
%17 = load double, double* %6
%18 = load i32, i32* %11
%19 = call i32 @SubGussFs(double* %14, double* %15, double %16, double %17, i32 %18)
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
store i64 %21, i64* %10
ret void
}

LLVM IR (-O2):
define void @CalGuassFromLB(double %0, double %1, double* %2, double* %3, i64 %4) {
%6 = trunc i64 %4 to i32
%7 = tail call i32 @SubGussFs(double* %2, double* %3, double %1, double %0, i32 %6)
ret void
}
int bv_bpw() { return 8; }


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

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

LLVM IR (-O0):
define i32 @bv_bpw() {
ret i32 8
}

LLVM IR (-O2):
define i32 @bv_bpw() {
ret i32 8
}
/* Variables and functions */
int floor(float);
int /*<<< orphan*/ printf(char *, float, float);
void roundToThousandths(float number) {
  float rounded = floor(number * 1000 + .5) / 1000;
  printf("original = %f  Rounded to Thousandth = %.3f\n", number, rounded);
}


x86 assembly (clang, -O0):
<roundToThousandths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xed3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <floor@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundToThousandths>:
push   %rax
movaps %xmm0,%xmm1
movss  %xmm0,0x4(%rsp)
movss  0xece(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  0xec6(%rip),%xmm0
call   1040 <floor@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
lea    0xea1(%rip),%rdi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"original = %f Rounded to Thousandth = %.3f\0A\00"
define void @roundToThousandths(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 1.000000e+03
%6 = fpext float %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fptrunc double %7 to float
%9 = call i32 @floor(float %8)
%10 = sdiv i32 %9, 1000
%11 = sitofp i32 %10 to float
store float %11, float* %3
%12 = load float, float* %2
%13 = load float, float* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), float %12, float %13)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"original = %f Rounded to Thousandth = %.3f\0A\00"
define void @roundToThousandths(float %0) {
%2 = fmul float %0, 1.000000e+03
%3 = fadd float %2, 5.000000e-01
%4 = tail call i32 @floor(float %3)
%5 = sdiv i32 %4, 1000
%6 = sitofp i32 %5 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), float %0, float %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: \n"
         "\t-d ad_name\t domain name\n"
         "\t-u ad_manager\t domain's manager account\n"
         "\t-p ad_passwd\t domain's manager account password\n"
         "\t\t\t if ad_passwd is '-' cmd will read stdin to get password\n"
         "\t-f conf_file\t specify config file's path. it will instead the\n"
         "\t\t\t the default /tmp/domain.conf. if any option above are "
         "specified \n"
         "\t\t\t will override the corresponding field in conf_file\n");
}


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

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

LLVM IR (-O0):
@.str = [371 x i8] c"Usage: \0A\09-d ad_name\09 domain name\0A\09-u ad_manager\09 domain's manager account\0A\09-p ad_passwd\09 domain's manager account password\0A\09\09\09 if ad_passwd is '-' cmd will read stdin to get password\0A\09-f conf_file\09 specify config file's path. it will instead the\0A\09\09\09 the default /tmp/domain.conf. if any option above are specified \0A\09\09\09 will override the corresponding field in conf_file\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([371 x i8], [371 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [370 x i8] c"Usage: \0A\09-d ad_name\09 domain name\0A\09-u ad_manager\09 domain's manager account\0A\09-p ad_passwd\09 domain's manager account password\0A\09\09\09 if ad_passwd is '-' cmd will read stdin to get password\0A\09-f conf_file\09 specify config file's path. it will instead the\0A\09\09\09 the default /tmp/domain.conf. if any option above are specified \0A\09\09\09 will override the corresponding field in conf_file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([370 x i8], [370 x i8]* @str, i64 0, i64 0))
ret void
}
int fb_do_a_barrel_roll(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fb_do_a_barrel_roll() {
ret i32 -1
}
int pipe(f)
int f[2];
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @pipe(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int core4_swap(char *, int);
int U_EMRSCALEVIEWPORTEXTEX_swap(char *record, int torev) {
  return (core4_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSCALEVIEWPORTEXTEX_swap>:
jmp    1030 <core4_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSCALEVIEWPORTEXTEX_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypePECITx(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000001, 0x00000008);
}


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

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

LLVM IR (-O0):
define void @GPIOPinTypePECITx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @GPIODirModeSet(i32 %5, i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 1, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypePECITx(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 1, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ show_string(char *, char *);
void die(char *msg) {
  show_string("dmsg", msg);
  show_string("exit", "die");
  fflush(NULL);
  exit(0);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <show_string@plt>
lea    0xeb2(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <show_string@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <show_string@plt>
lea    0xebe(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <show_string@plt>
xor    %edi,%edi
call   1030 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"dmsg\00"
@.str.1 = [5 x i8] c"exit\00"
@.str.2 = [4 x i8] c"die\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @show_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @show_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @fflush(i32* null)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"dmsg\00"
@.str.1 = [5 x i8] c"exit\00"
@.str.2 = [4 x i8] c"die\00"
define void @die(i8* %0) {
%2 = tail call i32 @show_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @show_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @fflush(i32* null)
%5 = tail call i32 @exit(i32 0)
unreachable
}
int eval_if(const char *stat) {
  (void)stat;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @eval_if(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i32 1
}

LLVM IR (-O2):
define i32 @eval_if(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int atoi(char *);
int CompileDate() {
  const char macro[16] = "Mar 17 2022";
  char stmp[4] = {0};
  stmp[0] = macro[4];
  stmp[1] = macro[5];
  stmp[2] = '\0';
  return atoi(stmp);
}


x86 assembly (clang, -O0):
<CompileDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0xc(%rbp),%al
mov    %al,-0x14(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0x13(%rbp)
movb   $0x0,-0x12(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompileDate>:
push   %rax
movl   $0x3731,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <atoi@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.CompileDate.macro = [16 x i8] c"Mar 17 2022\00\00\00\00\00"
define i32 @CompileDate() {
%1 = alloca [16 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [16 x i8]* %1 to i8*
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 4
%6 = load i8, i8* %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 5
%9 = load i8, i8* %8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
store i8 0, i8* %11
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%13 = call i32 @atoi(i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @CompileDate() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 14129, i32* %1
%3 = call i32 @atoi(i8* %2)
ret i32 %3
}
int getKey() { return 0x76; }


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

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

LLVM IR (-O0):
define i32 @getKey() {
ret i32 118
}

LLVM IR (-O2):
define i32 @getKey() {
ret i32 118
}
int reset_control_deassert(struct reset_control *rstc) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.reset_control = type opaque
define i32 @reset_control_deassert(%struct.reset_control* nocapture readnone %0) {
ret i32 0
}
int int_comp(const void *r1_ptr, const void *r2_ptr) {
  int *r1 = (int *)r1_ptr;
  int *r2 = (int *)r2_ptr;
  if (*r1 < *r2)
    return (-1);
  else if (*r1 > *r2)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<int_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <int_comp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <int_comp+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    1158 <int_comp+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <int_comp+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_comp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void mpu6000SpiGyroInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @mpu6000SpiGyroInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test();
int main(void) {
  test();
  printf("test\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"test\00"
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int n1(int a, int b) { return a >> b; }


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

x86 assembly (clang, -O2):
<n1>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @n1(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 = ashr i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @n1(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
void outsw(unsigned short port, const void *addr, unsigned long count) {
  asm volatile("cld ; rep ; outsw"
               : "=S"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


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

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

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

LLVM IR (-O2):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char const *);
void ft_putstr_err(char const *s) {
  ft_putstr("\x1B[31m");
  ft_putstr(s);
  ft_putstr("\x1B[0m");
}


x86 assembly (clang, -O0):
<ft_putstr_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <ft_putstr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ft_putstr@plt>
lea    0xece(%rip),%rdi
call   1030 <ft_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_err>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <ft_putstr@plt>
mov    %rbx,%rdi
call   1030 <ft_putstr@plt>
lea    0xed7(%rip),%rdi
pop    %rbx
jmp    1030 <ft_putstr@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putstr_err(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putstr(i8* %0)
%4 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _merge_sort_inplace(int *, int /*<<< orphan*/, int);
void merge_sort_inplace(int arr[], int n) { _merge_sort_inplace(arr, 0, n); }


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

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

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

LLVM IR (-O2):
define void @merge_sort_inplace(i32* %0, i32 %1) {
%3 = tail call i32 @_merge_sort_inplace(i32* %0, i32 0, i32 %1)
ret void
}