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

/* Variables and functions */
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ quick_sort(int *, int /*<<< orphan*/, int);
int main() {
  int a[] = {1, 9, 2, 8, 3, 7, 4, 6, 5, 0};
  int n = sizeof(a) / sizeof(int);
  quick_sort(a, 0, 9);
  print(a, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1050 <quick_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1040 <quick_sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 1, i32 9, i32 2, i32 8, i32 3, i32 7, i32 4, i32 6, i32 5, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 10, i32* %3
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @quick_sort(i32* %5, i32 0, i32 9)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @print(i32* %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 1, i32 9, i32 2, i32 8, i32 3, i32 7, i32 4, i32 6, i32 5, i32 0]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @quick_sort(i32* %3, i32 0, i32 9)
%5 = call i32 @print(i32* %3, i32 10)
ret i32 0
}
/* Type definitions */
typedef int __s16;

/* Variables and functions */
int noreceiver(int device) {
  return (device != (__s16)0xc52b && device != (__s16)0xc532 &&
          device != (__s16)0xc534 && device != (__s16)0xc52f);
}


x86 assembly (clang, -O0):
<noreceiver>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xc52b,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <noreceiver+0x4a>
xor    %eax,%eax
cmpl   $0xc532,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <noreceiver+0x4a>
xor    %eax,%eax
cmpl   $0xc534,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <noreceiver+0x4a>
cmpl   $0xc52f,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<noreceiver>:
lea    -0xc52b(%rdi),%ecx
cmp    $0x9,%ecx
ja     1118 <noreceiver+0x18>
xor    %eax,%eax
mov    $0x281,%edx
bt     %ecx,%edx
jae    1118 <noreceiver+0x18>
ret
xor    %eax,%eax
cmp    $0xc52f,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @noreceiver(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 50475
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 50482
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 50484
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 50479
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ false, %8 ], [ false, %5 ], [ false, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @noreceiver(i32 %0) {
switch i32 %0, label %2 [
i32 50484, label %5
i32 50482, label %5
i32 50475, label %5
]
2: ; preds = %1
%3 = icmp ne i32 %0, 50479
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 0, %1 ], [ %4, %2 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
scalar_t__ math(float, double, long double);
long double foo(float f, double d, long double ld) {
  double r = ld;
  r += math(f, d, ld);
#pragma omp target map(r)
  { r += math(f, d, ld); }
  return r;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <math@plt>
cvtsi2sd %rax,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <math@plt>
cvtsi2sd %rax,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
fldl   -0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x48,%rsp
movsd  %xmm1,0x20(%rsp)
movss  %xmm0,0x14(%rsp)
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x3c(%rsp)
fstl   0x30(%rsp)
fstpt  (%rsp)
call   1030 <math@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
fldt   0x3c(%rsp)
fstpt  (%rsp)
movss  0x14(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1030 <math@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
fldl   0x28(%rsp)
add    $0x48,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @foo(float %0, double %1, x86_fp80 %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca x86_fp80
%7 = alloca double
store float %0, float* %4
store double %1, double* %5
store x86_fp80 %2, x86_fp80* %6
%8 = load x86_fp80, x86_fp80* %6
%9 = fptrunc x86_fp80 %8 to double
store double %9, double* %7
%10 = load float, float* %4
%11 = load double, double* %5
%12 = load x86_fp80, x86_fp80* %6
%13 = call i64 @math(float %10, double %11, x86_fp80 %12)
%14 = sitofp i64 %13 to double
%15 = load double, double* %7
%16 = fadd double %15, %14
store double %16, double* %7
%17 = load float, float* %4
%18 = load double, double* %5
%19 = load x86_fp80, x86_fp80* %6
%20 = call i64 @math(float %17, double %18, x86_fp80 %19)
%21 = sitofp i64 %20 to double
%22 = load double, double* %7
%23 = fadd double %22, %21
store double %23, double* %7
%24 = load double, double* %7
%25 = fpext double %24 to x86_fp80
ret x86_fp80 %25
}

LLVM IR (-O2):
define x86_fp80 @foo(float %0, double %1, x86_fp80 %2) {
%4 = fptrunc x86_fp80 %2 to double
%5 = tail call i64 @math(float %0, double %1, x86_fp80 %2)
%6 = sitofp i64 %5 to double
%7 = fadd double %4, %6
%8 = tail call i64 @math(float %0, double %1, x86_fp80 %2)
%9 = sitofp i64 %8 to double
%10 = fadd double %7, %9
%11 = fpext double %10 to x86_fp80
ret x86_fp80 %11
}
void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) {}


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

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

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

LLVM IR (-O2):
%struct.bcma_drv_mips = type opaque
define void @bcma_core_mips_early_init(%struct.bcma_drv_mips* nocapture %0) {
ret void
}
const char *Resize_Description(void) {
  return "The `Resize` class can be implemented by objects which can be "
         "resized in "
         "some way. Resizing to a larger size than the current may allow for "
         "some "
         "resource or other to be preallocated or reserved. For example this "
         "class "
         "is implemented by `Array` and `Table` to either remove a number of "
         "items "
         "quickly or to preallocate memory space if it is known that many "
         "items are "
         "going to be added at a later date.";
}


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

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

LLVM IR (-O0):
@.str = [400 x i8] c"The `Resize` class can be implemented by objects which can be resized in some way. Resizing to a larger size than the current may allow for some resource or other to be preallocated or reserved. For example this class is implemented by `Array` and `Table` to either remove a number of items quickly or to preallocate memory space if it is known that many items are going to be added at a later date.\00"
define i8* @Resize_Description() {
ret i8* getelementptr inbounds ([400 x i8], [400 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [400 x i8] c"The `Resize` class can be implemented by objects which can be resized in some way. Resizing to a larger size than the current may allow for some resource or other to be preallocated or reserved. For example this class is implemented by `Array` and `Table` to either remove a number of items quickly or to preallocate memory space if it is known that many items are going to be added at a later date.\00"
define i8* @Resize_Description() {
ret i8* getelementptr inbounds ([400 x i8], [400 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void vector_slot_free(void *slot) { free(slot); }


x86 assembly (clang, -O0):
<vector_slot_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):
<vector_slot_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @vector_slot_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 @vector_slot_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void f123(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({
      goto a;
      0;
    });
    ({ 0; });
  a:
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f123>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f123() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* %1
store i32 0, i32* %2
%7 = load i32, i32* %2
store i32 0, i32* %3
%8 = load i32, i32* %3
br label %9
9: ; preds = %0
store i32 0, i32* %5
%10 = load i32, i32* %5
ret void
}

LLVM IR (-O2):
define void @f123() {
ret void
}
/* Variables and functions */
long lround(int);
int sqrt(int);
int ispantagon(int p) {
  long n = lround((1 + sqrt(1 + 24 * p)) / 6);
  return n * (3 * n - 1) / 2 == p;
}


x86 assembly (clang, -O0):
<ispantagon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x18,-0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <sqrt@plt>
add    $0x1,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <lround@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x3,-0x10(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispantagon>:
push   %rbx
mov    %edi,%ebx
lea    0x0(,%rbx,8),%eax
lea    (%rax,%rax,2),%edi
or     $0x1,%edi
call   1040 <sqrt@plt>
add    $0x1,%eax
cltq
imul   $0x2aaaaaab,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
shr    $0x20,%rdi
add    %eax,%edi
call   1030 <lround@plt>
lea    (%rax,%rax,2),%rcx
add    $0xffffffffffffffff,%rcx
imul   %rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
add    %rcx,%rdx
sar    %rdx
movslq %ebx,%rcx
xor    %eax,%eax
cmp    %rcx,%rdx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ispantagon(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 24, %4
%6 = add nsw i32 1, %5
%7 = call i32 @sqrt(i32 %6)
%8 = add nsw i32 1, %7
%9 = sdiv i32 %8, 6
%10 = call i64 @lround(i32 %9)
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = load i64, i64* %3
%13 = mul nsw i64 3, %12
%14 = sub nsw i64 %13, 1
%15 = mul nsw i64 %11, %14
%16 = sdiv i64 %15, 2
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = icmp eq i64 %16, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @ispantagon(i32 %0) {
%2 = mul nsw i32 %0, 24
%3 = or i32 %2, 1
%4 = tail call i32 @sqrt(i32 %3)
%5 = add nsw i32 %4, 1
%6 = sdiv i32 %5, 6
%7 = tail call i64 @lround(i32 %6)
%8 = mul nsw i64 %7, 3
%9 = add nsw i64 %8, -1
%10 = mul nsw i64 %9, %7
%11 = sdiv i64 %10, 2
%12 = sext i32 %0 to i64
%13 = icmp eq i64 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
double asin(double const);
char f_asin(double *a, const double *b) {
  *a = asin(*b);
  return (0);
}


x86 assembly (clang, -O0):
<f_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <asin@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_asin>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rsi),%xmm0
call   1030 <asin@plt>
movsd  %xmm0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @f_asin(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = call double @asin(double %6)
%8 = load double*, double** %3
store double %7, double* %8
ret i8 0
}

LLVM IR (-O2):
define signext i8 @f_asin(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = tail call double @asin(double %3)
store double %4, double* %0
ret i8 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sieve(int);
int main() {
  uint64_t total = sieve(2000000);
  printf("total: %llu\n", total);
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"total: %llu\0A\00"
define i32 @main() {
%1 = tail call i32 @sieve(i32 2000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int rename(char const *, char const *);
int xrename(const char *oldpath, const char *newpath) {
  int ret = rename(oldpath, newpath);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xrename>:
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   1030 <rename@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    113f <xrename+0x2f>
jmp    113f <xrename+0x2f>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrename>:
jmp    1030 <rename@plt>

LLVM IR (-O0):
define i32 @xrename(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 @rename(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %2
%13 = load i32, i32* %5
ret i32 %13
}

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

/* Variables and functions */
void inc_t(uint8_t *t, int tlength) {
  int i;
  i = tlength - 1;
  while (!(++t[i]) && i)
    i--;
}


x86 assembly (clang, -O0):
<inc_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rdx
mov    (%rax,%rdx,4),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax,%rdx,4)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    113d <inc_t+0x3d>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114d <inc_t+0x4d>
jmp    115b <inc_t+0x5b>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <inc_t+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_t>:
movslq %esi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdx
add    $0xffffffffffffffff,%rax
setb   %cl
addl   $0x1,(%rdi,%rdx,4)
jne    1124 <inc_t+0x24>
test   %cl,%cl
jne    1110 <inc_t+0x10>
ret

LLVM IR (-O0):
define void @inc_t(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* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %21, %2
%9 = load i32*, i32** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %8
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
br label %19
19: ; preds = %16, %8
%20 = phi i1 [ false, %8 ], [ %18, %16 ]
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = load i32, i32* %5
%23 = add nsw i32 %22, -1
store i32 %23, i32* %5
br label %8
24: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @inc_t(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %6, %4 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = icmp eq i32 %9, 0
%11 = icmp ne i64 %6, 0
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %4, label %13
13: ; preds = %4
ret void
}
/* Variables and functions */
intptr_t syscall3(int, uintptr_t, int /*<<< orphan*/, int /*<<< orphan*/);
intptr_t syscall1(int nr, uintptr_t a1) { return syscall3(nr, a1, 0, 0); }


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

x86 assembly (clang, -O2):
<syscall1>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall3@plt>

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

LLVM IR (-O2):
define i64 @syscall1(i32 %0, i64 %1) {
%3 = tail call i64 @syscall3(i32 %0, i64 %1, i32 0, i32 0)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "cpud uname host port\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"cpud uname host port\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"cpud uname host port\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "The CBUS-daemon %s\n", "O.3 Daemon Days");
  fprintf(stderr, "Usage: cbusd -b [CBUS base dir]\n"
                  "Optional Arguments:\n"
                  "\t-h show this help and exit\n"
                  "\t-v show debugging information\n"
                  "\t-d drop all packages to stderr\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xee9(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
lea    0xeec(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"The CBUS-daemon %s\0A\00"
@.str.1 = [16 x i8] c"O.3 Daemon Days\00"
@.str.2 = [144 x i8] c"Usage: cbusd -b [CBUS base dir]\0AOptional Arguments:\0A\09-h show this help and exit\0A\09-v show debugging information\0A\09-d drop all packages to stderr\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"The CBUS-daemon %s\0A\00"
@.str.1 = [16 x i8] c"O.3 Daemon Days\00"
@.str.2 = [144 x i8] c"Usage: cbusd -b [CBUS base dir]\0AOptional Arguments:\0A\09-h show this help and exit\0A\09-v show debugging information\0A\09-d drop all packages to stderr\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int strlen_c(char *src) {
  int i = 0;
  while (src[i])
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen_c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <strlen_c+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen_c+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_c>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen_c+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen_c(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int isinstr(char c, char *str) {
  char *p;
  p = str;
  while (*p != '\0')
    if (c == *p++)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isinstr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <isinstr+0x55>
movsbl -0x5(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1150 <isinstr+0x50>
movl   $0x1,-0x4(%rbp)
jmp    115c <isinstr+0x5c>
jmp    1116 <isinstr+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinstr>:
movzbl (%rsi),%eax
test   %al,%al
je     1116 <isinstr+0x16>
add    $0x1,%rsi
cmp    %dil,%al
jne    1100 <isinstr>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

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

/* Variables and functions */
unsigned char ExtractMonth(uint16_t date) { return date >> 12; }


x86 assembly (clang, -O0):
<ExtractMonth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExtractMonth>:
mov    %edi,%eax
shr    $0xc,%eax
ret

LLVM IR (-O0):
define zeroext i8 @ExtractMonth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 12
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @ExtractMonth(i32 %0) {
%2 = lshr i32 %0, 12
%3 = trunc i32 %2 to i8
ret i8 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ width;
};
struct TYPE_4__ {
  TYPE_1__ xexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xexpose_width(void *_p) {
  return (int)((XEvent *)_p)->xexpose.width;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xexpose_width>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XEvent_xexpose_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
void malloc_array_good(int len) {
  char *o = (char *)malloc(len);
  if (o) {
    o[0] = 'a';
    char c = o[0];
  }
  free(o);
}


x86 assembly (clang, -O0):
<malloc_array_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <malloc_array_good+0x32>
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_array_good>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112e <malloc_array_good+0xe>
movb   $0x61,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @malloc_array_good(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 97, i8* %3
br label %6
6: ; preds = %5, %1
%7 = tail call i32 @free(i8* %3)
ret void
}
int XCellsOfScreen() {}


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

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

LLVM IR (-O0):
define i32 @XCellsOfScreen() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XCellsOfScreen() {
ret i32 undef
}
void ffi_call_SYSV(void) {}


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

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

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

LLVM IR (-O2):
define void @ffi_call_SYSV() {
ret void
}
/* Variables and functions */
int _ozJC4(int /*<<< orphan*/, unsigned long volatile *, unsigned int);
__attribute__((no)) unsigned __attribute__((stdcall, regparm(3)))
SlE234(volatile unsigned long *RdZoN, unsigned kKiv65) {
  return _ozJC4(0, RdZoN, kKiv65);
}


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

x86 assembly (clang, -O2):
<SlE234>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <_ozJC4@plt>

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

LLVM IR (-O2):
define i32 @SlE234(i64* %0, i32 %1) {
%3 = tail call i32 @_ozJC4(i32 0, i64* %0, i32 %1)
ret i32 %3
}
unsigned long long g(unsigned long long a) { return a & 0x700000ull; }


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

x86 assembly (clang, -O2):
<g>:
mov    %rdi,%rax
and    $0x700000,%eax
ret

LLVM IR (-O0):
define i64 @g(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 7340032
ret i64 %4
}

LLVM IR (-O2):
define i64 @g(i64 %0) {
%2 = and i64 %0, 7340032
ret i64 %2
}
void set_pixelize(unsigned int i) {
  if (i)
    i = ((16 - i) << 4) | 0x0f;
  *((unsigned char *)0x2106) = (i);
  ;
}


x86 assembly (clang, -O0):
<set_pixelize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1122 <set_pixelize+0x22>
mov    $0x10,%eax
sub    -0x4(%rbp),%eax
shl    $0x4,%eax
or     $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x2106,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pixelize>:
mov    %edi,%eax
shl    $0x4,%al
mov    $0xf,%cl
sub    %al,%cl
test   %edi,%edi
movzbl %cl,%eax
cmove  %edi,%eax
mov    %al,0x2106
ret

LLVM IR (-O0):
define void @set_pixelize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub i32 16, %6
%8 = shl i32 %7, 4
%9 = or i32 %8, 15
store i32 %9, i32* %2
br label %10
10: ; preds = %5, %1
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
store i8 %12, i8* inttoptr (i64 8454 to i8*)
ret void
}

LLVM IR (-O2):
define void @set_pixelize(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = trunc i32 %0 to i8
%4 = mul i8 %3, -16
%5 = or i8 %4, 15
%6 = select i1 %2, i8 0, i8 %5
store i8 %6, i8* inttoptr (i64 8454 to i8*)
ret void
}
/* Variables and functions */
size_t untable_nth(size_t i) { return 2 * i + 3; }


x86 assembly (clang, -O0):
<untable_nth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<untable_nth>:
lea    (%rdi,%rdi,1),%rax
add    $0x3,%rax
ret

LLVM IR (-O0):
define i64 @untable_nth(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 2, %3
%5 = add i64 %4, 3
ret i64 %5
}

LLVM IR (-O2):
define i64 @untable_nth(i64 %0) {
%2 = shl i64 %0, 1
%3 = add i64 %2, 3
ret i64 %3
}
void foo_2_1_2_1_2_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_2_1_2_1_2() {
ret void
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_window_ask_refresh(int);
void gui_bar_config_change_conditions(void *data,
                                      struct t_config_option *option) {
  (void)data;
  (void)option;
  gui_window_ask_refresh(1);
}


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

x86 assembly (clang, -O2):
<gui_bar_config_change_conditions>:
mov    $0x1,%edi
jmp    1030 <gui_window_ask_refresh@plt>

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @gui_bar_config_change_conditions(i8* %0, %struct.t_config_option* %1) {
%3 = alloca i8*
%4 = alloca %struct.t_config_option*
store i8* %0, i8** %3
store %struct.t_config_option* %1, %struct.t_config_option** %4
%5 = load i8*, i8** %3
%6 = load %struct.t_config_option*, %struct.t_config_option** %4
%7 = call i32 @gui_window_ask_refresh(i32 1)
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @gui_bar_config_change_conditions(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1) {
%3 = tail call i32 @gui_window_ask_refresh(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ keypressed();
int TEXTVER_check_event() {
  if (keypressed()) {
    return -128;
  }
  return (0);
}


x86 assembly (clang, -O0):
<TEXTVER_check_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <keypressed@plt>
cmp    $0x0,%rax
je     1135 <TEXTVER_check_event+0x25>
movl   $0xffffff80,-0x4(%rbp)
jmp    113c <TEXTVER_check_event+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEXTVER_check_event>:
push   %rax
xor    %eax,%eax
call   1030 <keypressed@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
shl    $0x7,%ecx
add    $0xffffff80,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @TEXTVER_check_event() {
%1 = alloca i32
%2 = call i64 (...) @keypressed()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -128, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @TEXTVER_check_event() {
%1 = tail call i64 (...) @keypressed()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i32 0, i32 -128
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ skytraq_flush(int);
int skytraq_write(int, char const *, int);
int skytraq_cmd_nowait(int fd, const char *message, int len) {
  skytraq_flush(fd);
  return skytraq_write(fd, message, len);
}


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

x86 assembly (clang, -O2):
<skytraq_cmd_nowait>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <skytraq_flush@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <skytraq_write@plt>

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

LLVM IR (-O2):
define i32 @skytraq_cmd_nowait(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @skytraq_flush(i32 %0)
%5 = tail call i32 @skytraq_write(i32 %0, i8* %1, i32 %2)
ret i32 %5
}
int main(int argc, char *argv[]) {
  printf("%d", ({
           typeof(2) __x = (2);
           typeof(1) __y = (1);
           (&__x == &__y);
           __x < __y ? __x : __y;
         }));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    114b <main+0x3b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1151 <main+0x41>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 1, i32* %7
%9 = icmp eq i32* %6, %7
%10 = zext i1 %9 to i32
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i32, i32* %6
br label %18
16: ; preds = %2
%17 = load i32, i32* %7
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void RTLockValidatorClassRelease(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorClassRelease() {
ret void
}
long test_lroundf(float x) { return __builtin_lroundf(x); }


x86 assembly (clang, -O0):
<test_lroundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <lroundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lroundf>:
jmp    1030 <lroundf@plt>

LLVM IR (-O0):
define i64 @test_lroundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @lroundf(float %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test_lroundf(float %0) {
%2 = tail call i64 @lroundf(float %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void display_version(void) {
  puts("ed2kd v"
       "17"
       "."
       "15"
       "\n"
       "Build on: "
       "Mar 17 2022"
       " "
       "06:35:23");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"ed2kd v17.15\0ABuild on: Mar 17 2022 06:35:23\00"
define void @display_version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"ed2kd v17.15\0ABuild on: Mar 17 2022 06:35:23\00"
define void @display_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_pkt_fwd_ctl_usage(void) {
  printf("\nUsage : sys_cfg_pkt_fwd_ctl [0|1]\n");
  printf("\nOptions: 0     - Forward all packets to the host");
  printf("\n         1     - Firmware handles intra-BSS packets");
  printf("\n         empty - Get current packet forwarding setting\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_pkt_fwd_ctl_usage>:
push   %rax
lea    0xf3f(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xef2(%rip),%rdi
call   1040 <printf@plt>
lea    0xf3e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0AUsage : sys_cfg_pkt_fwd_ctl [0|1]\0A\00"
@.str.1 = [50 x i8] c"\0AOptions: 0 - Forward all packets to the host\00"
@.str.2 = [53 x i8] c"\0A 1 - Firmware handles intra-BSS packets\00"
@.str.3 = [57 x i8] c"\0A empty - Get current packet forwarding setting\0A\00"
define void @print_sys_cfg_pkt_fwd_ctl_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [50 x i8] c"\0AOptions: 0 - Forward all packets to the host\00"
@.str.2 = [53 x i8] c"\0A 1 - Firmware handles intra-BSS packets\00"
@str = [35 x i8] c"\0AUsage : sys_cfg_pkt_fwd_ctl [0|1]\00"
@str.4 = [56 x i8] c"\0A empty - Get current packet forwarding setting\00"
define void @print_sys_cfg_pkt_fwd_ctl_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gprs_func(char *, int);
int /*<<< orphan*/ printf(char *);
int gprs(int alarm_type, char *phone_num) {
  printf("after  define\n");
  gprs_func(phone_num, alarm_type);
  printf("after the main  gprs_func\n");
  return 0;
}


x86 assembly (clang, -O0):
<gprs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <gprs_func@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gprs>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <gprs_func@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"after define\0A\00"
@.str.1 = [27 x i8] c"after the main gprs_func\0A\00"
define i32 @gprs(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = call i32 @gprs_func(i8* %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"after define\00"
@str.2 = [26 x i8] c"after the main gprs_func\00"
define i32 @gprs(i32 %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @gprs_func(i8* %1, i32 %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int fault_function() {
  char *x = (char *)malloc(10 * sizeof(char));
  free(x);
  return x[5];
}


x86 assembly (clang, -O0):
<fault_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movsbl 0x5(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fault_function>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
movsbl 0x5(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fault_function() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @free(i8* %4)
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @fault_function() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
%4 = getelementptr inbounds i8, i8* %2, i64 5
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
XBell() {}


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

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

LLVM IR (-O0):
define i32 @XBell() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XBell() {
ret i32 undef
}