xunge/DecIR huggingface dataset:
int new_id(void) {
  static int current_id = 0;
  current_id = (current_id + 1) % 16000;
  if (current_id == 0)
    current_id = 1;
  return (current_id);
}


x86 assembly (clang, -O0):
<new_id>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    $0x3e80,%ecx
cltd
idiv   %ecx
mov    %edx,0x2f09(%rip)
cmpl   $0x0,0x2f02(%rip)
jne    1132 <new_id+0x32>
movl   $0x1,0x2ef2(%rip)
mov    0x2eec(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_id>:
mov    0x2f1e(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2a,%rcx
add    %edx,%ecx
imul   $0x3e80,%ecx,%ecx
neg    %ecx
add    %eax,%ecx
add    $0x1,%ecx
test   %ecx,%ecx
mov    $0x1,%eax
cmovne %ecx,%eax
mov    %eax,0x2ee5(%rip)
ret

LLVM IR (-O0):
@new_id.current_id = internal global i32 0
define i32 @new_id() {
%1 = load i32, i32* @new_id.current_id
%2 = add nsw i32 %1, 1
%3 = srem i32 %2, 16000
store i32 %3, i32* @new_id.current_id
%4 = load i32, i32* @new_id.current_id
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* @new_id.current_id
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* @new_id.current_id
ret i32 %8
}

LLVM IR (-O2):
@new_id.current_id = internal unnamed_addr global i32 0
define i32 @new_id() {
%1 = load i32, i32* @new_id.current_id
%2 = add nsw i32 %1, 1
%3 = srem i32 %2, 16000
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 1, i32 %3
store i32 %5, i32* @new_id.current_id
ret i32 %5
}
int xisdigit(int c) { return (c >= (int)'0' && c <= (int)'9'); }


x86 assembly (clang, -O0):
<xisdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <xisdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xisdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xisdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ counting_sort(int *, int *, int);
int /*<<< orphan*/ display(int *, int);
int main() {
  int n = 12;
  int a[] = {-1, 4, 5, 5, 3, 8, 3, 9, 2, 2, 1, 9, 7};
  int b[12 + 1];
  display(a, n);
  counting_sort(a, b, n);
  display(b, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeac(%rip),%rsi
mov    $0x34,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <display@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <counting_sort@plt>
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    0xf03(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   1030 <display@plt>
lea    0x40(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1040 <counting_sort@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.a = [13 x i32] [i32 -1, i32 4, i32 5, i32 5, i32 3, i32 8, i32 3, i32 9, i32 2, i32 2, i32 1, i32 9, i32 7]
define i32 @main() {
%1 = alloca [13 x i32]
%2 = alloca [13 x i32]
%3 = bitcast [13 x i32]* %1 to i8*
%4 = bitcast [13 x i32]* %2 to i8*
%5 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%6 = call i32 @display(i32* %5, i32 12)
%7 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%8 = call i32 @counting_sort(i32* %5, i32* %7, i32 12)
%9 = call i32 @display(i32* %7, i32 12)
ret i32 0
}
/* Type definitions */
struct TY_CTmodifier {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TY_PrintCTmod(struct TY_CTmodifier *);
void TY_ListCTmod(struct TY_CTmodifier *mod) { TY_PrintCTmod(mod); }


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

x86 assembly (clang, -O2):
<TY_ListCTmod>:
jmp    1030 <TY_PrintCTmod@plt>

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

LLVM IR (-O2):
%struct.TY_CTmodifier = type { i32 }
define void @TY_ListCTmod(%struct.TY_CTmodifier* %0) {
%2 = tail call i32 @TY_PrintCTmod(%struct.TY_CTmodifier* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SAI1_DriverIRQHandler();
__attribute__((weak)) void SAI1_IRQHandler(void) { SAI1_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @SAI1_IRQHandler() {
%1 = call i32 (...) @SAI1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SAI1_IRQHandler() {
%1 = tail call i32 (...) @SAI1_DriverIRQHandler()
ret void
}
int write_DCS8Number(double d, char *p) {
  unsigned long o32;
  d = d * 255.0 + 0.5;
  if (d >= 256.0)
    return 1;
  if (d < 0.0)
    return 1;
  o32 = (unsigned long)d;
  ((unsigned char *)p)[0] = (unsigned char)(o32);
  return 0;
}


x86 assembly (clang, -O0):
<write_DCS8Number>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1152 <write_DCS8Number+0x52>
movl   $0x1,-0x4(%rbp)
jmp    11ae <write_DCS8Number+0xae>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116c <write_DCS8Number+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    11ae <write_DCS8Number+0xae>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_DCS8Number>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ucomisd 0xef8(%rip),%xmm0
mov    $0x1,%eax
jae    114a <write_DCS8Number+0x4a>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     114a <write_DCS8Number+0x4a>
cvttsd2si %xmm0,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%rdx
and    %ecx,%edx
or     %edx,%eax
mov    %al,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @write_DCS8Number(double %0, i8* %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i8*
%6 = alloca i64
store double %0, double* %4
store i8* %1, i8** %5
%7 = load double, double* %4
%8 = call double @llvm.fmuladd.f64(double %7, double 2.550000e+02, double 5.000000e-01)
store double %8, double* %4
%9 = load double, double* %4
%10 = fcmp oge double %9, 2.560000e+02
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %23
12: ; preds = %2
%13 = load double, double* %4
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %3
br label %23
16: ; preds = %12
%17 = load double, double* %4
%18 = fptoui double %17 to i64
store i64 %18, i64* %6
%19 = load i64, i64* %6
%20 = trunc i64 %19 to i8
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 0
store i8 %20, i8* %22
store i32 0, i32* %3
br label %23
23: ; preds = %16, %15, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @write_DCS8Number(double %0, i8* nocapture writeonly %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double 2.550000e+02, double 5.000000e-01)
%4 = fcmp oge double %3, 2.560000e+02
%5 = fcmp olt double %3, 0.000000e+00
%6 = or i1 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = fptoui double %3 to i64
%9 = trunc i64 %8 to i8
store i8 %9, i8* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %11
}
signed char min(signed char a, signed char b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    112c <min+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <min+0x33>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %al,%dil
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @min(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @min(i8 signext %0, i8 signext %1) {
%3 = icmp slt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
int main() {
  int a[] = {1, 3, 5, 7};
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
unsigned char *malloc(size_t);
int /*<<< orphan*/ printf(char *, unsigned char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char **argv) {
  unsigned char *result;
  char input;
  size_t s = 1 << 30;
  result = malloc(s);
  printf("Addr: %p\n", result);
  scanf("%c", &input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x40000000,-0x28(%rbp)
40
mov    -0x28(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
lea    -0x19(%rbp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x40000000,%edi
call   1040 <malloc@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Addr: %p\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 1073741824, i64* %8
%9 = load i64, i64* %8
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Addr: %p\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = tail call dereferenceable_or_null(1073741824) i8* @malloc(i64 1073741824)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ res_hl(int);
void opcb_b6() { res_hl(6); }


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

x86 assembly (clang, -O2):
<opcb_b6>:
mov    $0x6,%edi
jmp    1030 <res_hl@plt>

LLVM IR (-O0):
define void @opcb_b6() {
%1 = call i32 @res_hl(i32 6)
ret void
}

LLVM IR (-O2):
define void @opcb_b6() {
%1 = tail call i32 @res_hl(i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(unsigned char);
void cmp_preg32pimm32_imm8(int reg32, unsigned long imm32, unsigned char imm8) {
  put8(0x80);
  put8(0xB8 + reg32);
  put32(imm32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<cmp_preg32pimm32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    $0x80,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0xb8,%eax
movzbl %al,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
movzbl -0x11(%rbp),%edi
call   1030 <put8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_preg32pimm32_imm8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x80,%edi
call   1030 <put8@plt>
add    $0xb8,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
call   1040 <put32@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cmp_preg32pimm32_imm8(i32 %0, i64 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = call i32 @put8(i8 zeroext -128)
%8 = load i32, i32* %4
%9 = add nsw i32 184, %8
%10 = trunc i32 %9 to i8
%11 = call i32 @put8(i8 zeroext %10)
%12 = load i64, i64* %5
%13 = call i32 @put32(i64 %12)
%14 = load i8, i8* %6
%15 = call i32 @put8(i8 zeroext %14)
ret void
}

LLVM IR (-O2):
define void @cmp_preg32pimm32_imm8(i32 %0, i64 %1, i8 zeroext %2) {
%4 = tail call i32 @put8(i8 zeroext -128)
%5 = trunc i32 %0 to i8
%6 = add i8 %5, -72
%7 = tail call i32 @put8(i8 zeroext %6)
%8 = tail call i32 @put32(i64 %1)
%9 = tail call i32 @put8(i8 zeroext %2)
ret void
}
int do_308() { return 308; }


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

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

LLVM IR (-O0):
define i32 @do_308() {
ret i32 308
}

LLVM IR (-O2):
define i32 @do_308() {
ret i32 308
}
/* Variables and functions */
int /*<<< orphan*/ Com_Frame();
int /*<<< orphan*/ Com_Init(int, char **);
void main(int argc, char **argv) {
  Com_Init(argc, argv);
  while (1) {
    Com_Frame();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <Com_Init@plt>
mov    $0x0,%al
call   1040 <Com_Frame@plt>
jmp    113b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <Com_Init@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <Com_Frame@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @Com_Init(i32 %5, i8** %6)
br label %8
8: ; preds = %2, %8
%9 = call i32 (...) @Com_Frame()
br label %8
}

LLVM IR (-O2):
define void @main(i32 %0, i8** %1) {
%3 = tail call i32 @Com_Init(i32 %0, i8** %1)
br label %4
4: ; preds = %2, %4
%5 = tail call i32 (...) @Com_Frame()
br label %4
}
/* Type definitions */
struct fast_log_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fast_log_copy(struct fast_log_buf *,
                                 struct fast_log_buf const *);
int fast_log_dump_impl(struct fast_log_buf *, int);
int fast_log_dump(const struct fast_log_buf *fb, struct fast_log_buf *scratch,
                  int fd) {
  fast_log_copy(scratch, fb);
  return fast_log_dump_impl(scratch, fd);
}


x86 assembly (clang, -O0):
<fast_log_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fast_log_copy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <fast_log_dump_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_log_dump>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <fast_log_copy@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fast_log_dump_impl@plt>

LLVM IR (-O0):
%struct.fast_log_buf = type { i32 }
define i32 @fast_log_dump(%struct.fast_log_buf* %0, %struct.fast_log_buf* %1, i32 %2) {
%4 = alloca %struct.fast_log_buf*
%5 = alloca %struct.fast_log_buf*
%6 = alloca i32
store %struct.fast_log_buf* %0, %struct.fast_log_buf** %4
store %struct.fast_log_buf* %1, %struct.fast_log_buf** %5
store i32 %2, i32* %6
%7 = load %struct.fast_log_buf*, %struct.fast_log_buf** %5
%8 = load %struct.fast_log_buf*, %struct.fast_log_buf** %4
%9 = call i32 @fast_log_copy(%struct.fast_log_buf* %7, %struct.fast_log_buf* %8)
%10 = load %struct.fast_log_buf*, %struct.fast_log_buf** %5
%11 = load i32, i32* %6
%12 = call i32 @fast_log_dump_impl(%struct.fast_log_buf* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.fast_log_buf = type { i32 }
define i32 @fast_log_dump(%struct.fast_log_buf* %0, %struct.fast_log_buf* %1, i32 %2) {
%4 = tail call i32 @fast_log_copy(%struct.fast_log_buf* %1, %struct.fast_log_buf* %0)
%5 = tail call i32 @fast_log_dump_impl(%struct.fast_log_buf* %1, i32 %2)
ret i32 %5
}
__attribute__((weak)) int _isatty(int file) {
  (void)file;
  return -1;
}


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

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

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

LLVM IR (-O2):
define weak i32 @_isatty(i32 %0) {
ret i32 -1
}
char uuchar(unsigned int val) {
  val &= 0x3F;
  val += 0x20;
  if (val == 0x20) {
    val = 0x60;
  }
  return val;
}


x86 assembly (clang, -O0):
<uuchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jne    112a <uuchar+0x2a>
movl   $0x60,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uuchar>:
and    $0x3f,%edi
lea    0x20(%rdi),%eax
test   %edi,%edi
movzbl %al,%ecx
mov    $0x60,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @uuchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 63
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add i32 %5, 32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 96, i32* %2
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @uuchar(i32 %0) {
%2 = and i32 %0, 63
%3 = icmp eq i32 %2, 0
%4 = trunc i32 %2 to i8
%5 = add nuw nsw i8 %4, 32
%6 = select i1 %3, i8 96, i8 %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ enumerate(int);
int /*<<< orphan*/ write_mbus_register(int, int, int);
int main() {
  enumerate(3);
  delay(10000);
  enumerate(4);
  delay(10000);
  write_mbus_register(4, 3, 0xBF0F0);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <enumerate@plt>
mov    $0x2710,%edi
call   1030 <delay@plt>
mov    $0x4,%edi
call   1040 <enumerate@plt>
mov    $0x2710,%edi
call   1030 <delay@plt>
mov    $0x4,%edi
mov    $0x3,%esi
mov    $0xbf0f0,%edx
call   1050 <write_mbus_register@plt>
jmp    117b <main+0x4b>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <enumerate@plt>
mov    $0x2710,%edi
call   1030 <delay@plt>
mov    $0x4,%edi
call   1040 <enumerate@plt>
mov    $0x2710,%edi
call   1030 <delay@plt>
mov    $0x4,%edi
mov    $0x3,%esi
mov    $0xbf0f0,%edx
call   1050 <write_mbus_register@plt>
nopl   (%rax)
jmp    1170 <main+0x40>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @enumerate(i32 3)
%3 = call i32 @delay(i32 10000)
%4 = call i32 @enumerate(i32 4)
%5 = call i32 @delay(i32 10000)
%6 = call i32 @write_mbus_register(i32 4, i32 3, i32 782576)
br label %7
7: ; preds = %0, %7
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @enumerate(i32 3)
%2 = tail call i32 @delay(i32 10000)
%3 = tail call i32 @enumerate(i32 4)
%4 = tail call i32 @delay(i32 10000)
%5 = tail call i32 @write_mbus_register(i32 4, i32 3, i32 782576)
br label %6
6: ; preds = %0, %6
br label %6
}
void gdk_query_visual_types() {}


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

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

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

LLVM IR (-O2):
define void @gdk_query_visual_types() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ puts(char *);
int main() {
  puts("This is a shared library test...");
  foo();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"This is a shared library test...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"This is a shared library test...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @foo()
ret i32 0
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SysCtlSleepPowerSet(uint32_t ui32Config) {
  (*((volatile unsigned long *)(0x400FE188))) = ui32Config;
}


x86 assembly (clang, -O0):
<SysCtlSleepPowerSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fe188,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlSleepPowerSet>:
mov    %rdi,0x400fe188
40
ret

LLVM IR (-O0):
define void @SysCtlSleepPowerSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074782600 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlSleepPowerSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074782600 to i64*)
ret void
}
void test_1(float *in, int *out) {
  out[0] = (int)in[0];
  out[1] = (int)in[1];
  out[2] = (int)in[2];
  out[3] = (int)in[3];
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvttss2si (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cvttss2si 0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
cvttss2si 0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
cvttss2si 0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
movups (%rdi),%xmm0
cvttps2dq %xmm0,%xmm0
movups %xmm0,(%rsi)
ret

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

LLVM IR (-O2):
define void @test_1(float* nocapture %0, i32* nocapture writeonly %1) {
%3 = bitcast float* %0 to <4 x float>*
%4 = load <4 x float>, <4 x float>* %3
%5 = fptosi <4 x float> %4 to <4 x i32>
%6 = bitcast i32* %1 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
ret void
}
/* Variables and functions */
int __nv_isnand(double);
int __isnan(double __a) { return __nv_isnand(__a); }


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

x86 assembly (clang, -O2):
<__isnan>:
jmp    1030 <__nv_isnand@plt>

LLVM IR (-O0):
define i32 @__isnan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @__nv_isnand(double %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @__isnan(double %0) {
%2 = tail call i32 @__nv_isnand(double %0)
ret i32 %2
}
void test_min_with_negpos_numbers(void) {
  do {
    seatest_assert_int_equal(-900, ({
      typeof(-900) _a = (-900);
      typeof(622) _b = (622);
      (_a < _b) ? _a : _b;
    }),
                             __FUNCTION__, 28);
  } while (0);
}


x86 assembly (clang, -O0):
<test_min_with_negpos_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xfffffc7c,-0x4(%rbp)
movl   $0x26e,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113d <test_min_with_negpos_numbers+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <test_min_with_negpos_numbers+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0xfffffc7c,%edi
lea    0xea8(%rip),%rdx
mov    $0x1c,%ecx
mov    $0x0,%al
call   1030 <seatest_assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_min_with_negpos_numbers>:
lea    0xee9(%rip),%rdx
mov    $0xfffffc7c,%edi
mov    $0xfffffc7c,%esi
mov    $0x1c,%ecx
xor    %eax,%eax
jmp    1030 <seatest_assert_int_equal@plt>

LLVM IR (-O0):
@__FUNCTION__.test_min_with_negpos_numbers = [29 x i8] c"test_min_with_negpos_numbers\00"
define void @test_min_with_negpos_numbers() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0
store i32 -900, i32* %1
store i32 622, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i32, i32* %1
br label %12
10: ; preds = %4
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 -900, i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.test_min_with_negpos_numbers, i64 0, i64 0), i32 28)
br label %16
16: ; preds = %12
ret void
}

LLVM IR (-O2):
@__FUNCTION__.test_min_with_negpos_numbers = [29 x i8] c"test_min_with_negpos_numbers\00"
define void @test_min_with_negpos_numbers() {
%1 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 -900, i32 -900, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.test_min_with_negpos_numbers, i64 0, i64 0), i32 28)
ret void
}
/* Variables and functions */
int strtol(char const *, char **, int);
int get_note_id_from_line(const char *line) {
  int id = -1;
  char *endptr;
  id = strtol(line, &endptr, 10);
  return id;
}


x86 assembly (clang, -O0):
<get_note_id_from_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_note_id_from_line>:
push   %rax
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_note_id_from_line(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtol(i8* %0, i8** %2, i32 10)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int BigEndian(void) {
  union {
    int i;
    char s[4];
  } u;
  strcpy(u.s, "123");
  if (u.i == 0x00333231)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<BigEndian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcpy@plt>
cmpl   $0x333231,-0x8(%rbp)
jne    1141 <BigEndian+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1148 <BigEndian+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigEndian>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
cmpl   $0x333231,(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { i32 }
@.str = [4 x i8] c"123\00"
define i32 @BigEndian() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = bitcast %union.anon* %2 to i32*
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 3355185
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %11
10: ; preds = %0
store i32 1, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%union.anon = type { i32 }
@.str = [4 x i8] c"123\00"
define i32 @BigEndian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds %union.anon, %union.anon* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 3355185
%7 = zext i1 %6 to i32
ret i32 %7
}
int fun496() { return 496; }


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

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

LLVM IR (-O0):
define i32 @fun496() {
ret i32 496
}

LLVM IR (-O2):
define i32 @fun496() {
ret i32 496
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  int arr[5];
#pragma omp target data map(alloc : arr[LARGE])
  {
#pragma omp target update CLAUSE(arr[SMALL])
  } fprintf(stderr, "success\n");
#pragma omp target data map(alloc : arr[SMALL])
  {
#pragma omp target update CLAUSE(arr[LARGE])
  } fprintf(stderr, "success\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%edi
lea    0xedb(%rip),%rbx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"success\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int GetIntegerArray(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ PrintIntegerArray(int *, int);
main() {
  int list[250], n;
  n = GetIntegerArray(list, 250, 0);
  PrintIntegerArray(list, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x3f0(%rbp),%rdi
mov    $0xfa,%esi
xor    %edx,%edx
call   1040 <GetIntegerArray@plt>
mov    %eax,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    -0x3f4(%rbp),%esi
call   1030 <PrintIntegerArray@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xfa,%esi
xor    %edx,%edx
call   1040 <GetIntegerArray@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <PrintIntegerArray@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [250 x i32]
%2 = alloca i32
%3 = getelementptr inbounds [250 x i32], [250 x i32]* %1, i64 0, i64 0
%4 = call i32 @GetIntegerArray(i32* %3, i32 250, i32 0)
store i32 %4, i32* %2
%5 = getelementptr inbounds [250 x i32], [250 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @PrintIntegerArray(i32* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [250 x i32]
%2 = bitcast [250 x i32]* %1 to i8*
%3 = getelementptr inbounds [250 x i32], [250 x i32]* %1, i64 0, i64 0
%4 = call i32 @GetIntegerArray(i32* %3, i32 250, i32 0)
%5 = call i32 @PrintIntegerArray(i32* %3, i32 %4)
ret i32 0
}
void ble_rsp_attclient_find_information(
    const struct ble_msg_attclient_find_information_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attclient_find_information_rsp_t = type opaque
define void @ble_rsp_attclient_find_information(%struct.ble_msg_attclient_find_information_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_instr(int);
void eval_gt(void) { write_instr(0x1C); }


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

x86 assembly (clang, -O2):
<eval_gt>:
mov    $0x1c,%edi
jmp    1030 <write_instr@plt>

LLVM IR (-O0):
define void @eval_gt() {
%1 = call i32 @write_instr(i32 28)
ret void
}

LLVM IR (-O2):
define void @eval_gt() {
%1 = tail call i32 @write_instr(i32 28)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *CmdCurArg(char *arg) {
  while (isspace(*arg))
    arg++;
  return arg;
}


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

x86 assembly (clang, -O2):
<CmdCurArg>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <CmdCurArg+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @CmdCurArg(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 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @CmdCurArg(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct xylo_tnode {
  int dummy;
};

/* Variables and functions */
size_t parent(int);
struct xylo_tnode *get_parent(int i, struct xylo_tnode **nodes) {
  return parent(i) < 0 ? NULL : nodes[parent(i)];
}


x86 assembly (clang, -O0):
<get_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <parent@plt>
cmp    $0x0,%rax
jae    113c <get_parent+0x2c>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    115b <get_parent+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <parent@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_parent>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <parent@plt>
mov    %ebp,%edi
call   1030 <parent@plt>
mov    (%rbx,%rax,8),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.xylo_tnode = type { i32 }
define %struct.xylo_tnode* @get_parent(i32 %0, %struct.xylo_tnode** %1) {
%3 = alloca i32
%4 = alloca %struct.xylo_tnode**
store i32 %0, i32* %3
store %struct.xylo_tnode** %1, %struct.xylo_tnode*** %4
%5 = load i32, i32* %3
%6 = call i64 @parent(i32 %5)
%7 = icmp ult i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load %struct.xylo_tnode**, %struct.xylo_tnode*** %4
%11 = load i32, i32* %3
%12 = call i64 @parent(i32 %11)
%13 = getelementptr inbounds %struct.xylo_tnode*, %struct.xylo_tnode** %10, i64 %12
%14 = load %struct.xylo_tnode*, %struct.xylo_tnode** %13
br label %15
15: ; preds = %9, %8
%16 = phi %struct.xylo_tnode* [ null, %8 ], [ %14, %9 ]
ret %struct.xylo_tnode* %16
}

LLVM IR (-O2):
%struct.xylo_tnode = type { i32 }
define %struct.xylo_tnode* @get_parent(i32 %0, %struct.xylo_tnode** nocapture %1) {
%3 = tail call i64 @parent(i32 %0)
%4 = tail call i64 @parent(i32 %0)
%5 = getelementptr inbounds %struct.xylo_tnode*, %struct.xylo_tnode** %1, i64 %4
%6 = load %struct.xylo_tnode*, %struct.xylo_tnode** %5
ret %struct.xylo_tnode* %6
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t __attribute__((__always___)) rdtsc_beg(void) {
  __asm__ __volatile__("" : : : "memory");
  uint64_t tsc;
  __asm __volatile("cpuid; rdtsc; shl $32, %%rdx; or %%rdx, %%rax"
                   : "=a"(tsc)
                   :
                   : "%rbx", "%rcx", "%rdx");
  __asm__ __volatile__("" : : : "memory");
  return tsc;
}


x86 assembly (clang, -O0):
<rdtsc_beg>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
cpuid
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc_beg>:
push   %rbx
cpuid
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @rdtsc_beg() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "cpuid; rdtsc; shl $$32, %rdx; or %rdx, %rax", "={ax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rdtsc_beg() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i8* asm sideeffect "cpuid; rdtsc; shl $$32, %rdx; or %rdx, %rax", "={ax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
int aa_pro_ctr_a1a(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a1a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a1a>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a1a = [15 x i8] c"aa_pro_ctr_a1a\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a1a(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 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a1a, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a1a = [15 x i8] c"aa_pro_ctr_a1a\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a1a(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a1a, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t length = 0u;
  while (str[length]) {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
adrreg0regx1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[10000000]) = (p1[x1]); }


x86 assembly (clang, -O0):
<adrreg0regx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x2625a00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0regx1_set>:
movslq %ecx,%rax
mov    (%r9,%rax,4),%eax
mov    %eax,0x2625a00(%r8)
ret

LLVM IR (-O0):
define i32 @adrreg0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32*, i32** %12
%20 = getelementptr inbounds i32, i32* %19, i64 10000000
store i32 %18, i32* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @adrreg0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %4, i64 10000000
store i32 %9, i32* %10
ret i32 undef
}