xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sortrnd(void **, int, int (*)(void const *, void const *),
                           double *);
void sort(void **array, int size, int (*comp)(const void *, const void *)) {
  double seed = 91648253;
  sortrnd(array, size, comp, &seed);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <sortrnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %rax
movabs $0x4195d9c3f4000000,%rax
d9 95 41
mov    %rax,(%rsp)
mov    %rsp,%rcx
call   1030 <sortrnd@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @sort(i8** %0, i32 %1, i32 (i8*, i8*)* %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
store double 0x4195D9C3F4000000, double* %4
%6 = call i32 @sortrnd(i8** %0, i32 %1, i32 (i8*, i8*)* %2, double* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ir_tx_set(int /*<<< orphan*/, int);
void ir_serial_tx_stop(void) { ir_tx_set(0, (((int)(0.6e-3 * 36e3)))); }


x86 assembly (clang, -O0):
<ir_serial_tx_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x15,%esi
call   1030 <ir_tx_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_serial_tx_stop>:
xor    %edi,%edi
mov    $0x15,%esi
jmp    1030 <ir_tx_set@plt>

LLVM IR (-O0):
define void @ir_serial_tx_stop() {
%1 = call i32 @ir_tx_set(i32 0, i32 21)
ret void
}

LLVM IR (-O2):
define void @ir_serial_tx_stop() {
%1 = tail call i32 @ir_tx_set(i32 0, i32 21)
ret void
}
int is_alpha(char c) {
  if (c >= 'a' && c <= 'z')
    return (1);
  if (c >= 'A' && c <= 'Z')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <is_alpha+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <is_alpha+0x30>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_alpha+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <is_alpha+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <is_alpha+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_alpha+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %22
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16, %12
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *tmpnam(char *);
char *tmpnam_r(char *s) { return s ? tmpnam(s) : NULL; }


x86 assembly (clang, -O0):
<tmpnam_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <tmpnam_r+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <tmpnam@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <tmpnam_r+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <tmpnam_r+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpnam_r>:
test   %rdi,%rdi
je     111a <tmpnam_r+0xa>
jmp    1030 <tmpnam@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @tmpnam_r(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i8* @tmpnam(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %7, %5 ], [ null, %8 ]
ret i8* %10
}

LLVM IR (-O2):
define i8* @tmpnam_r(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @tmpnam(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
int clamp(int a, int v) {
  if (a > v)
    return v;
  else if (a < -v)
    return -v;
  else
    return a;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <clamp+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <clamp+0x44>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    113e <clamp+0x3e>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <clamp+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %esi,%eax
neg    %eax
cmp    %edi,%eax
cmovle %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub nsw i32 0, %1
%5 = icmp sgt i32 %4, %0
%6 = select i1 %5, i32 %4, i32 %0
%7 = select i1 %3, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(int /*<<< orphan*/);
int count_digits(int i) { return floor(log10(abs(i))) + 1; }


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
push   %rax
mov    %edi,%eax
neg    %eax
cmovns %eax,%edi
call   1030 <log10@plt>
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @count_digits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @abs(i32 %3)
%5 = call i32 @log10(i32 %4)
%6 = call i32 @floor(i32 %5)
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @count_digits(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 @log10(i32 %2)
%4 = tail call i32 @floor(i32 %3)
%5 = add nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int f(int);
int g() { return f(3); }


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

x86 assembly (clang, -O2):
<g>:
mov    $0x3,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @g() {
%1 = call i32 @f(i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 @f(i32 3)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Ello Chap\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Ello Chap\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void setup_smp_id(void *data) {
  asm("mov %0, %%gs:0" : : "r"(apic_id()) : "memory");
}


x86 assembly (clang, -O0):
<setup_smp_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <apic_id@plt>
mov    %eax,%gs:0x0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_smp_id>:
push   %rax
xor    %eax,%eax
call   1030 <apic_id@plt>
mov    %eax,%gs:0x0
pop    %rax
ret

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

LLVM IR (-O2):
define void @setup_smp_id(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @apic_id()
tail call void asm sideeffect "mov $0, %gs:0", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %2)
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number = 0;
  printf("Enter the number\n");
  scanf("%d", &number);
  printf("Factorial of number %d is %d\n", number, factorial(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <factorial@plt>
lea    0xe87(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter the number\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"Factorial of number %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @factorial(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"Factorial of number %d is %d\0A\00"
@str = [17 x i8] c"Enter the number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
unsigned long PRCMHIBRegRead(int);
unsigned long PRCMOCRRegisterRead(unsigned char ucIndex) {
  unsigned long ulRet;
  ulRet = PRCMHIBRegRead(0x4402F800 + 0x00000420 + (ucIndex << 2));
  if (((*((volatile unsigned long *)(0x4402E000 + 0x00000188))) &
       (0x00000080)) &&
      (ucIndex == 0)) {
    ulRet = ulRet >> 0x1;
  }
  return ulRet;
}


x86 assembly (clang, -O0):
<PRCMOCRRegisterRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
shl    $0x2,%edi
add    $0x4402fc20,%edi
call   1030 <PRCMHIBRegRead@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4402e188,%eax
mov    (%rax),%rax
and    $0x80,%rax
cmp    $0x0,%rax
je     1165 <PRCMOCRRegisterRead+0x55>
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    1165 <PRCMOCRRegisterRead+0x55>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMOCRRegisterRead>:
push   %rbx
mov    %edi,%ebx
lea    0x4402fc20(,%rbx,4),%edi
call   1030 <PRCMHIBRegRead@plt>
mov    0x4402e188,%rcx
44
movzbl %cl,%edx
shr    $0x7,%edx
test   %ebx,%ebx
sete   %cl
and    %dl,%cl
shr    %cl,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @PRCMOCRRegisterRead(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i64
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = shl i32 %5, 2
%7 = add nsw i32 1141046304, %6
%8 = call i64 @PRCMHIBRegRead(i32 %7)
store i64 %8, i64* %3
%9 = load volatile i64, i64* inttoptr (i64 1141039496 to i64*)
%10 = and i64 %9, 128
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %1
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i64, i64* %3
%18 = lshr i64 %17, 1
store i64 %18, i64* %3
br label %19
19: ; preds = %16, %12, %1
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @PRCMOCRRegisterRead(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw nsw i32 %2, 2
%4 = add nuw nsw i32 %3, 1141046304
%5 = tail call i64 @PRCMHIBRegRead(i32 %4)
%6 = load volatile i64, i64* inttoptr (i64 1141039496 to i64*)
%7 = and i64 %6, 128
%8 = icmp ne i64 %7, 0
%9 = icmp eq i8 %0, 0
%10 = and i1 %9, %8
%11 = zext i1 %10 to i64
%12 = lshr i64 %5, %11
ret i64 %12
}
void gtk_window_set_screen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_screen() {
ret void
}
/* Variables and functions */
char *load(char const *);
int strtol(char const *, char **, int);
int load_int(const char *key, int default_val) {
  int val;
  char *end;
  const char *sval = load(key);
  if (sval == NULL) {
    return default_val;
  }
  val = strtol(sval, &end, 10);
  if (*end != '\0') {
    return -1;
  }
  return val;
}


x86 assembly (clang, -O0):
<load_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <load@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1152 <load_int+0x32>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <load_int+0x69>
mov    -0x28(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1183 <load_int+0x63>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <load_int+0x69>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_int>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1040 <load@plt>
test   %rax,%rax
je     1150 <load_int+0x30>
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    0x8(%rsp),%rcx
xor    %edx,%edx
cmp    (%rcx),%dl
sbb    %ebx,%ebx
or     %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @load_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i8* @load(i8* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = call i32 @strtol(i8* %5, i8** %3, i32 10)
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = select i1 %11, i32 %8, i32 -1
br label %13
13: ; preds = %7, %2
%14 = phi i32 [ %1, %2 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ isalnum(int);
int iskeychar(int c) { return isalnum(c) || c == '-'; }


x86 assembly (clang, -O0):
<iskeychar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <iskeychar+0x2f>
cmpl   $0x2d,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iskeychar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x2d,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iskeychar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 45
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @iskeychar(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 45
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int fn2(int a, int b) {
  int tem1 = b & a;
  int tem2 = a | b;
  return tem1 + tem2;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @fn2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int cd_util_rand_int(unsigned int n) {
  return (double)rand() / ((double)RAND_MAX + 1) * n;
}


x86 assembly (clang, -O0):
<cd_util_rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eba(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec5(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_util_rand_int>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec2(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xecd(%rip),%xmm1
mov    %ebx,%eax
cvtsi2sd %rax,%xmm2
divsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @cd_util_rand_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %4, %7
%9 = load i32, i32* %2
%10 = uitofp i32 %9 to double
%11 = fmul double %8, %10
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @cd_util_rand_int(i32 %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %3, %6
%8 = uitofp i32 %0 to double
%9 = fmul double %7, %8
%10 = fptosi double %9 to i32
ret i32 %10
}
int helper_function(int arg) { return arg - 45; }


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

x86 assembly (clang, -O2):
<helper_function>:
lea    -0x2d(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @helper_function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 45
ret i32 %4
}

LLVM IR (-O2):
define i32 @helper_function(i32 %0) {
%2 = add nsw i32 %0, -45
ret i32 %2
}
int uwsgi_cheaper_algo_manual(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uwsgi_cheaper_algo_manual() {
ret i32 0
}
void DMA_readout(long addr, int dmapadr, int dmaladr, long dmasiz) {
  long temp_out, temp_in;
}


x86 assembly (clang, -O0):
<DMA_readout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @DMA_readout(i64 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
define void @DMA_readout(i64 %0, i32 %1, i32 %2, i64 %3) {
ret void
}
char *langRomTypeS1985() { return "S1985"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"S1985\00"
define i8* @langRomTypeS1985() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"S1985\00"
define i8* @langRomTypeS1985() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ calloc(int /*<<< orphan*/, int);
int32_t L_halloc(int32_t size) { return (int32_t)calloc(size, 1); }


x86 assembly (clang, -O0):
<L_halloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L_halloc>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i32 @L_halloc(i32 %0) {
%2 = tail call i32 @calloc(i32 %0, i32 1)
ret i32 %2
}
void gtk_tree_view_column_set_spacing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_set_spacing() {
ret void
}
char *__VERIFIER_nondet_pchar() {
  char *val;
  return val;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @__VERIFIER_nondet_pchar() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void CUP(int riga, int colonna) { printf("\x1B[%d;%dH", riga, colonna); }


x86 assembly (clang, -O0):
<CUP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @CUP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @CUP(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function(int);
int main(int argc, char *argv[]) {
  function(argc > 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <function@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
cmp    $0x2,%edi
setge  %al
mov    %eax,%edi
call   1030 <function@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @function(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @function(i32 %4)
ret i32 0
}
int count_args(char *str) {
  int i;
  int args = 0;
  for (i = 0; str[i]; i++) {
    if (str[i] == '<' && str[i + 1] == '%') {
      args++;
    }
  }
  return args;
}


x86 assembly (clang, -O0):
<count_args>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1173 <count_args+0x73>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3c,%eax
jne    1160 <count_args+0x60>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x25,%eax
jne    1160 <count_args+0x60>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1165 <count_args+0x65>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <count_args+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_args>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rcx
movzbl -0x1(%rdi,%rcx,1),%edx
test   %dl,%dl
je     112f <count_args+0x2f>
cmp    $0x3c,%dl
jne    1110 <count_args+0x10>
xor    %edx,%edx
cmpb   $0x25,(%rdi,%rcx,1)
sete   %dl
add    %edx,%eax
jmp    1110 <count_args+0x10>
ret

LLVM IR (-O0):
define i32 @count_args(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %33, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %36
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 60
br i1 %19, label %20, label %32
20: ; preds = %12
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 37
br i1 %28, label %29, label %32
29: ; preds = %20
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %32
32: ; preds = %29, %20, %12
br label %33
33: ; preds = %32
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %5
36: ; preds = %5
%37 = load i32, i32* %4
ret i32 %37
}

LLVM IR (-O2):
define i32 @count_args(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i64 [ %12, %11 ], [ 0, %1 ]
%4 = phi i32 [ %17, %11 ], [ 0, %1 ]
br label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ %3, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
switch i8 %8, label %9 [
i8 0, label %18
i8 60, label %11
]
9: ; preds = %5
%10 = add nuw i64 %6, 1
br label %5
11: ; preds = %5
%12 = add nuw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 37
%16 = zext i1 %15 to i32
%17 = add nuw nsw i32 %4, %16
br label %2
18: ; preds = %5
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int opt_store_1(char *arg, void *data) {
  assert(!arg && data);
  *(int *)data = 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_store_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    113b <opt_store_1+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_store_1>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
sete   %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
movl   $0x1,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @opt_store_1(i8* readnone %0, i8* writeonly %1) {
%3 = icmp eq i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = bitcast i8* %1 to i32*
store i32 1, i32* %8
ret i32 0
}
void outb(unsigned short addr, unsigned char val) {
  __asm__ __volatile__("outb %%al, %%dx" ::"d"(addr), "a"(val));
}


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

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

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

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb %al, %dx", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("o o\n");
  printf(" | \n");
  printf("\\_/\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"o o\00"
@str.3 = [4 x i8] c" | \00"
@str.4 = [4 x i8] c"\\_/\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int slg_write(int /*<<< orphan*/ *, char const *, int);
int strlen(char const *);
int slg_puts(BIO *bp, const char *str) {
  int n, ret;
  n = strlen(str);
  ret = slg_write(bp, str, n);
  return (ret);
}


x86 assembly (clang, -O0):
<slg_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <slg_write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slg_puts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <slg_write@plt>

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

LLVM IR (-O2):
define i32 @slg_puts(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @slg_write(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
unsigned char complement(unsigned char x) { return ~x; }


x86 assembly (clang, -O0):
<complement>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complement>:
mov    %edi,%eax
not    %al
ret

LLVM IR (-O0):
define zeroext i8 @complement(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = xor i32 %4, -1
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @complement(i8 zeroext %0) {
%2 = xor i8 %0, -1
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ testBasicInit();
int /*<<< orphan*/ testCopy();
int /*<<< orphan*/ testMerge();
int main() {
  testBasicInit();
  testCopy();
  testMerge();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <testBasicInit@plt>
mov    $0x0,%al
call   1030 <testCopy@plt>
mov    $0x0,%al
call   1050 <testMerge@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @testBasicInit()
%2 = call i32 (...) @testCopy()
%3 = call i32 (...) @testMerge()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testBasicInit()
%2 = tail call i32 (...) @testCopy()
%3 = tail call i32 (...) @testMerge()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mysleep(int);
int /*<<< orphan*/ redraw(int);
int /*<<< orphan*/ standout_end();
int /*<<< orphan*/ standout_start();
void flash(int h) {
  standout_start();
  redraw(((int)1));
  (void)mysleep(h);
  standout_end();
  redraw(((int)1));
}


x86 assembly (clang, -O0):
<flash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <standout_start@plt>
mov    $0x1,%edi
call   1050 <redraw@plt>
mov    -0x4(%rbp),%edi
call   1040 <mysleep@plt>
mov    $0x0,%al
call   1030 <standout_end@plt>
mov    $0x1,%edi
call   1050 <redraw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <standout_start@plt>
mov    $0x1,%edi
call   1050 <redraw@plt>
mov    %ebx,%edi
call   1040 <mysleep@plt>
xor    %eax,%eax
call   1030 <standout_end@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1050 <redraw@plt>

LLVM IR (-O0):
define void @flash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @standout_start()
%4 = call i32 @redraw(i32 1)
%5 = load i32, i32* %2
%6 = call i32 @mysleep(i32 %5)
%7 = call i32 (...) @standout_end()
%8 = call i32 @redraw(i32 1)
ret void
}

LLVM IR (-O2):
define void @flash(i32 %0) {
%2 = tail call i32 (...) @standout_start()
%3 = tail call i32 @redraw(i32 1)
%4 = tail call i32 @mysleep(i32 %0)
%5 = tail call i32 (...) @standout_end()
%6 = tail call i32 @redraw(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Printf(char *);
void idle(void *local) {
  Printf("In idle process\n");
  while (true)
    ;
}


x86 assembly (clang, -O0):
<idle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <Printf@plt>
jmp    1128 <idle+0x18>

x86 assembly (clang, -O2):
<idle>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <Printf@plt>
nopl   (%rax)
jmp    1120 <idle+0x10>

LLVM IR (-O0):
@.str = [17 x i8] c"In idle process\0A\00"
define void @idle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @Printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"In idle process\0A\00"
define void @idle(i8* nocapture readnone %0) {
%2 = tail call i32 @Printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
/* Type definitions */
struct fd_info {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int /*<<< orphan*/, void const *, size_t);
ssize_t tncc_sub_send(struct fd_info *info, const void *buf, size_t len,
                      int flags) {
  do {
  } while (0);
  return write(0, buf, len);
}


x86 assembly (clang, -O0):
<tncc_sub_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
jmp    112c <tncc_sub_send+0x1c>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fd_info = type { i32 }
define i32 @tncc_sub_send(%struct.fd_info* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca %struct.fd_info*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store %struct.fd_info* %0, %struct.fd_info** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
br label %9
9: ; preds = %4
br label %10
10: ; preds = %9
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = call i32 @write(i32 0, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.fd_info = type { i32 }
define i32 @tncc_sub_send(%struct.fd_info* nocapture readnone %0, i8* nocapture %1, i64 %2, i32 %3) {
%5 = tail call i32 @write(i32 0, i8* %1, i64 %2)
ret i32 %5
}
/* Type definitions */
struct list_node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_node *list_insert(struct list *, int /*<<< orphan*/,
                              struct list_node *);
int /*<<< orphan*/ list_size(struct list *);
struct list_node *list_push_back(struct list *self, struct list_node *n) {
  return list_insert(self, list_size(self), n);
}


x86 assembly (clang, -O0):
<list_push_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <list_size@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <list_insert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_push_back>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <list_size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_insert@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.list_node = type { i32 }
define %struct.list_node* @list_push_back(%struct.list* %0, %struct.list_node* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list_node*
store %struct.list* %0, %struct.list** %3
store %struct.list_node* %1, %struct.list_node** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load %struct.list*, %struct.list** %3
%7 = call i32 @list_size(%struct.list* %6)
%8 = load %struct.list_node*, %struct.list_node** %4
%9 = call %struct.list_node* @list_insert(%struct.list* %5, i32 %7, %struct.list_node* %8)
ret %struct.list_node* %9
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.list_node = type { i32 }
define %struct.list_node* @list_push_back(%struct.list* %0, %struct.list_node* %1) {
%3 = tail call i32 @list_size(%struct.list* %0)
%4 = tail call %struct.list_node* @list_insert(%struct.list* %0, i32 %3, %struct.list_node* %1)
ret %struct.list_node* %4
}
int subSum(int x, int y) { return x - y; }


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

x86 assembly (clang, -O2):
<subSum>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @subSum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subSum(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Heapsort(int, int *);
int /*<<< orphan*/ debug(char *, int *);
int /*<<< orphan*/ gera_vetor(int *);
int /*<<< orphan*/ system(char *);
int main(void) {
  int v[8 + 1] = {-1, 6, 1, 5, 4, 0, 2, 3, 7};
  gera_vetor(v);
  Heapsort(8, v);
  debug("Final : ", v);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x24,%edx
call   1070 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1050 <gera_vetor@plt>
lea    -0x30(%rbp),%rsi
mov    $0x8,%edi
call   1060 <Heapsort@plt>
lea    -0x30(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <debug@plt>
lea    0xe92(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xed5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9e(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gera_vetor@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
call   1060 <Heapsort@plt>
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
call   1030 <debug@plt>
lea    0xe99(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.v = [9 x i32] [i32 -1, i32 6, i32 1, i32 5, i32 4, i32 0, i32 2, i32 3, i32 7]
@.str = [9 x i8] c"Final : \00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @gera_vetor(i32* %3)
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%6 = call i32 @Heapsort(i32 8, i32* %5)
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%8 = call i32 @debug(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.v = [9 x i32] [i32 -1, i32 6, i32 1, i32 5, i32 4, i32 0, i32 2, i32 3, i32 7]
@.str = [9 x i8] c"Final : \00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @gera_vetor(i32* %3)
%5 = call i32 @Heapsort(i32 8, i32* %3)
%6 = call i32 @debug(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void fa149(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    a:
      ({
        p025A:
          goto p025A;
          goto a;
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa149>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa149+0x4>

x86 assembly (clang, -O2):
<fa149>:
jmp    1100 <fa149>

LLVM IR (-O0):
define void @fa149() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; No predecessors!
br label %22
22: ; preds = %22, %21
br label %22
23: ; preds = %23
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa149() {
br label %1
1: ; preds = %1, %0
br label %1
}