xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
loop:
  printf("loop\n");
  goto loop;
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [6 x i8] c"loop\0A\00"
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
br label %6
6: ; preds = %6, %2
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
}

LLVM IR (-O2):
@str = [5 x i8] c"loop\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_alloc__(int);
void *EC_KEY_new(void) { __coverity_alloc__(10); }


x86 assembly (clang, -O0):
<EC_KEY_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <__coverity_alloc__@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EC_KEY_new>:
mov    $0xa,%edi
jmp    1030 <__coverity_alloc__@plt>

LLVM IR (-O0):
define i8* @EC_KEY_new() {
%1 = alloca i8*
%2 = call i32 @__coverity_alloc__(i32 10)
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @EC_KEY_new() {
%1 = tail call i32 @__coverity_alloc__(i32 10)
ret i8* undef
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x != y) {
    if (x > y) {
      y = y + 1;
    } else {
      x = x + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1167 <main+0x57>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1159 <main+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <main+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void BIO_next(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_next() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ compare(int, unsigned int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  unsigned int i, j, k, l;
  i = 5;
  j = 2;
  k = 0;
  l = 2;
  if (compare(5 % (~(unsigned)2), i % ~j) || compare(0, k % ~l))
    abort();
  else
    exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%esi
mov    $0x5,%edi
call   1050 <compare@plt>
cmp    $0x0,%rax
jne    119e <main+0x6e>
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%esi
xor    %edi,%edi
call   1050 <compare@plt>
cmp    $0x0,%rax
je     11a5 <main+0x75>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x5,%esi
call   1050 <compare@plt>
test   %rax,%rax
jne    115a <main+0x2a>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <compare@plt>
test   %rax,%rax
jne    115a <main+0x2a>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 2, i32* %3
store i32 0, i32* %4
store i32 2, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = xor i32 %7, -1
%9 = urem i32 %6, %8
%10 = call i64 @compare(i32 5, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %0
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = xor i32 %14, -1
%16 = urem i32 %13, %15
%17 = call i64 @compare(i32 0, i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %12, %0
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %12
%22 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @compare(i32 5, i32 5)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 @compare(i32 0, i32 0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _delay_ms(int);
void lcd_longDelay() { _delay_ms(6); }


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

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

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

LLVM IR (-O2):
define void @lcd_longDelay() {
%1 = tail call i32 @_delay_ms(i32 6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
unsigned int pthread_mutex_unlock(int /*<<< orphan*/ *);
unsigned int OSAL_MutexPut(pthread_mutex_t *mutex) {
  return pthread_mutex_unlock(mutex);
}


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

x86 assembly (clang, -O2):
<OSAL_MutexPut>:
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define i32 @OSAL_MutexPut(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ divby2(int);
scalar_t__ divby5(int);
__attribute__((no)) int divby10(int i) { return divby2(i) && divby5(i); }


x86 assembly (clang, -O0):
<divby10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <divby2@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <divby10+0x37>
mov    -0x4(%rbp),%edi
call   1030 <divby5@plt>
cmp    $0x0,%rax
setne  %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):
<divby10>:
push   %rbx
mov    %edi,%ebx
call   1040 <divby2@plt>
test   %rax,%rax
je     1141 <divby10+0x21>
mov    %ebx,%edi
call   1030 <divby5@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @divby10(i32 %0) {
%2 = tail call i64 @divby2(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @divby5(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ main1(int, int);
int main(void) {
  main1(2000, 2000);
  main1(0, 1599);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7d0,%esi
mov    %esi,%edi
call   1030 <main1@plt>
xor    %edi,%edi
mov    $0x63f,%esi
call   1030 <main1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7d0,%edi
mov    $0x7d0,%esi
call   1030 <main1@plt>
xor    %edi,%edi
mov    $0x63f,%esi
call   1030 <main1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @main1(i32 2000, i32 2000)
%3 = call i32 @main1(i32 0, i32 1599)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @main1(i32 2000, i32 2000)
%2 = tail call i32 @main1(i32 0, i32 1599)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  int c;
  do {
    c = a % b;
    a = b;
    b = c;
  } while (b != 0);
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1143 <main+0x23>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
nopl   0x0(%rax)
mov    %esi,%eax
mov    %edx,%esi
cltd
idiv   %esi
test   %edx,%edx
jne    1140 <main+0x20>
mov    %esi,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %8, %0
%9 = phi i32 [ %11, %8 ], [ %7, %0 ]
%10 = phi i32 [ %9, %8 ], [ %6, %0 ]
%11 = srem i32 %10, %9
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8
store i32 %9, i32* %1
store i32 0, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
void init_add_rel_pixel_mask_pt_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_rel_pixel_mask_pt_funcs_c() {
ret void
}
/* Variables and functions */
unsigned long CANRegRead(unsigned long);
int /*<<< orphan*/ CANRegWrite(unsigned long, unsigned long);
void CANIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  ;
  CANRegWrite(ulBase + 0x00000000,
              CANRegRead(ulBase + 0x00000000) | ulIntFlags);
}


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

x86 assembly (clang, -O2):
<CANIntEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <CANRegRead@plt>
or     %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <CANRegWrite@plt>

LLVM IR (-O0):
define void @CANIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 0
%7 = load i64, i64* %3
%8 = add i64 %7, 0
%9 = call i64 @CANRegRead(i64 %8)
%10 = load i64, i64* %4
%11 = or i64 %9, %10
%12 = call i32 @CANRegWrite(i64 %6, i64 %11)
ret void
}

LLVM IR (-O2):
define void @CANIntEnable(i64 %0, i64 %1) {
%3 = tail call i64 @CANRegRead(i64 %0)
%4 = or i64 %3, %1
%5 = tail call i32 @CANRegWrite(i64 %0, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closedown();
void sighup(int sig) {
  sig = sig;
  closedown();
}


x86 assembly (clang, -O0):
<sighup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <closedown@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sighup(i32 %0) {
%2 = tail call i32 (...) @closedown()
ret void
}
void genbltz_test() {}


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

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

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

LLVM IR (-O2):
define void @genbltz_test() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ vetor;

/* Variables and functions */
int maximoR1(int, int *);
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int vetor[] = {4, 2, 1, 99, 12, 49};
  int y = sizeof(vetor) / sizeof(int);
  printf("%d\n", maximoR1(y, vetor));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1040 <maximoR1@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x6,%edi
call   1040 <maximoR1@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.vetor = [6 x i32] [i32 4, i32 2, i32 1, i32 99, i32 12, i32 49]
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @maximoR1(i32 6, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void Error(char *prefixErrMesg, char *errMesg) {
  fprintf(stderr, "%s: %s.\n", prefixErrMesg, errMesg);
}


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Error>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"%s: %s.\0A\00"
define void @Error(i8* %0, i8* %1) {
%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), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeBookshelfNodes(char *);
int /*<<< orphan*/ writeBookshelfPl(char *);
void writeBookshelf(const char *filename) {
  writeBookshelfNodes("out.nodes");
  writeBookshelfPl("out.pl");
}


x86 assembly (clang, -O0):
<writeBookshelf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <writeBookshelfNodes@plt>
lea    0xecb(%rip),%rdi
call   1040 <writeBookshelfPl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeBookshelf>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writeBookshelfNodes@plt>
lea    0xed6(%rip),%rdi
pop    %rax
jmp    1040 <writeBookshelfPl@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"out.nodes\00"
@.str.1 = [7 x i8] c"out.pl\00"
define void @writeBookshelf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @writeBookshelfNodes(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @writeBookshelfPl(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"out.nodes\00"
@.str.1 = [7 x i8] c"out.pl\00"
define void @writeBookshelf(i8* nocapture readnone %0) {
%2 = tail call i32 @writeBookshelfNodes(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @writeBookshelfPl(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long double, long double);
int main(void) {
  long double x = 1.0;
  printf("%Lf %Lf\n", x, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
fld1
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fld    %st(0)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
fld1
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%Lf %Lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
char *quitcmd(char *arg __attribute__((unused))) {
  printf("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<quitcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quitcmd>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define noalias i8* @quitcmd(i8* nocapture readnone %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ c_init();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("main\n");
  c_init();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <c_init@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @c_init()
ret i32 0
}
/* Variables and functions */
int fun1();
int fun2();
int fun3();
int main(void) { return fun1() + fun2() + fun3(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fun1@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <fun2@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <fun3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <fun1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <fun2@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1050 <fun3@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fun1()
%3 = call i32 (...) @fun2()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @fun3()
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fun1()
%2 = tail call i32 (...) @fun2()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @fun3()
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *, char *);
int /*<<< orphan*/ pop_labelstack();
void retF(void) {
  pop_labelstack();
  pA("PCP(P3F, %s);", "P03");
}


x86 assembly (clang, -O0):
<retF>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pop_labelstack@plt>
lea    0xece(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <pA@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<retF>:
push   %rax
xor    %eax,%eax
call   1030 <pop_labelstack@plt>
lea    0xed1(%rip),%rdi
lea    0xed8(%rip),%rsi
pop    %rax
jmp    1040 <pA@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"PCP(P3F, %s);\00"
@.str.1 = [4 x i8] c"P03\00"
define void @retF() {
%1 = call i32 (...) @pop_labelstack()
%2 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"PCP(P3F, %s);\00"
@.str.1 = [4 x i8] c"P03\00"
define void @retF() {
%1 = tail call i32 (...) @pop_labelstack()
%2 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int DIV_CEIL(long n, int k) { return (n + k - 1) / k; }


x86 assembly (clang, -O0):
<DIV_CEIL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
sub    $0x1,%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<DIV_CEIL>:
movslq %esi,%rcx
lea    (%rdi,%rcx,1),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     111d <DIV_CEIL+0x1d>
cqto
idiv   %rcx
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i32 @DIV_CEIL(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = add nsw i64 %5, %7
%9 = sub nsw i64 %8, 1
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = sdiv i64 %9, %11
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @DIV_CEIL(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = add i64 %0, -1
%5 = add i64 %4, %3
%6 = sdiv i64 %5, %3
%7 = trunc i64 %6 to i32
ret i32 %7
}
int main(void) {
  void func(__builtin_ms_va_list * args);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void fixed_point_set_sign(unsigned long long *fd, unsigned width,
                          unsigned sign) {
  if (fd)
    *fd |= (sign << (width - 1));
}


x86 assembly (clang, -O0):
<fixed_point_set_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1132 <fixed_point_set_sign+0x32>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_point_set_sign>:
test   %rdi,%rdi
je     1110 <fixed_point_set_sign+0x10>
add    $0xff,%sil
mov    %esi,%ecx
shl    %cl,%edx
or     %rdx,(%rdi)
ret

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

LLVM IR (-O2):
define void @fixed_point_set_sign(i64* %0, i32 %1, i32 %2) {
%4 = icmp eq i64* %0, null
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = add i32 %1, -1
%7 = shl i32 %2, %6
%8 = zext i32 %7 to i64
%9 = load i64, i64* %0
%10 = or i64 %9, %8
store i64 %10, i64* %0
br label %11
11: ; preds = %5, %3
ret void
}
const char *pkgSourceArchivePath() {
  return "%R"
         "var/cache/mingw-get/source"
         "%/M/%F";
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"%Rvar/cache/mingw-get/source%/M/%F\00"
define i8* @pkgSourceArchivePath() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [35 x i8] c"%Rvar/cache/mingw-get/source%/M/%F\00"
define i8* @pkgSourceArchivePath() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}
void BASM_InitSig() {}


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

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

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

LLVM IR (-O2):
define void @BASM_InitSig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int write(int, char *, int);
void write_dongle(int fd, char *data, int len) {
  int n;
  n = write(fd, data, len);
  if (n < 0) {
    perror("write failed");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<write_dongle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1174 <write_dongle+0x44>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dongle>:
push   %rax
call   1030 <write@plt>
test   %eax,%eax
js     113c <write_dongle+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"write failed\00"
define void @write_dongle(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
void cvcc_led_cv(void) {
  *(unsigned char *)0x5000 &= ~(1 << 3);
  *(unsigned char *)0x5002 |= (1 << 3);
}


x86 assembly (clang, -O0):
<cvcc_led_cv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5000,%eax
movzbl (%rax),%eax
and    $0xfffffff7,%eax
mov    %al,%cl
mov    $0x5000,%eax
mov    %cl,(%rax)
mov    $0x5002,%eax
movzbl (%rax),%eax
or     $0x8,%eax
mov    %al,%cl
mov    $0x5002,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvcc_led_cv>:
andb   $0xf7,0x5000
f7
orb    $0x8,0x5002
08
ret

LLVM IR (-O0):
define void @cvcc_led_cv() {
%1 = load i8, i8* inttoptr (i64 20480 to i8*)
%2 = zext i8 %1 to i32
%3 = and i32 %2, -9
%4 = trunc i32 %3 to i8
store i8 %4, i8* inttoptr (i64 20480 to i8*)
%5 = load i8, i8* inttoptr (i64 20482 to i8*)
%6 = zext i8 %5 to i32
%7 = or i32 %6, 8
%8 = trunc i32 %7 to i8
store i8 %8, i8* inttoptr (i64 20482 to i8*)
ret void
}

LLVM IR (-O2):
define void @cvcc_led_cv() {
%1 = load i8, i8* inttoptr (i64 20480 to i8*)
%2 = and i8 %1, -9
store i8 %2, i8* inttoptr (i64 20480 to i8*)
%3 = load i8, i8* inttoptr (i64 20482 to i8*)
%4 = or i8 %3, 8
store i8 %4, i8* inttoptr (i64 20482 to i8*)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rcx;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
bool cpuid_mperf_and_aperf_avail(void) {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 6;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  if ((((uint64_t)(rcx) &
        ((((uint64_t)1 << (((0)) - ((0)) + 1)) - 1) << ((0)))) >>
       (0)) == 1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<cpuid_mperf_and_aperf_avail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x6,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x10(%rbp),%eax
and    $0x1,%eax
sar    $0x0,%eax
cmp    $0x1,%eax
jne    1155 <cpuid_mperf_and_aperf_avail+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <cpuid_mperf_and_aperf_avail+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_mperf_and_aperf_avail>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x6,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_mperf_and_aperf_avail() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 6, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @cpuid(i32 %7, i32* %2, i32* %3, i32* %4, i32* %5)
%9 = load i32, i32* %4
%10 = and i32 %9, 1
%11 = ashr i32 %10, 0
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %1
br label %15
14: ; preds = %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @cpuid_mperf_and_aperf_avail() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 6, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = and i32 %10, 1
ret i32 %11
}
char toLowerCase(c) { return ('A' <= c && c <= 'Z') ? (c - 'A' + 'a') : c; }


x86 assembly (clang, -O0):
<toLowerCase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1130 <toLowerCase+0x30>
cmpl   $0x5a,-0x4(%rbp)
jg     1130 <toLowerCase+0x30>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <toLowerCase+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLowerCase>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%eax
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @toLowerCase(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 97
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @toLowerCase(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void loop() {
  do {
    sleep(1);
  } while (1);
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <loop+0x9>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1119 <loop+0x9>
jmp    1132 <loop+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <loop+0x10>

LLVM IR (-O0):
define void @loop() {
br label %1
1: ; preds = %3, %0
%2 = call i32 @sleep(i32 1)
br label %3
3: ; preds = %1
br i1 true, label %1, label %4
4: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @loop() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ readRequest(int);
void *threadCallback(void *data) {
  int sfd = *(int *)data;
  readRequest(sfd);
  close(sfd);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<threadCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <readRequest@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadCallback>:
push   %rbx
mov    (%rdi),%ebx
mov    %ebx,%edi
call   1030 <readRequest@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %edi,%edi
pop    %rbx
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @threadCallback(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @readRequest(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @close(i32 %10)
%12 = call i32 @pthread_exit(i32* null)
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @threadCallback(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @readRequest(i32 %3)
%5 = tail call i32 @close(i32 %3)
%6 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
const char *sep(const char *p) {
  int c;
  while ((c = *p)) {
    if (c == '/')
      return p;
    p++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1143 <sep+0x43>
cmpl   $0x2f,-0x14(%rbp)
jne    1132 <sep+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114b <sep+0x4b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <sep+0x8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sep>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <sep+0x22>
cmp    $0x2f,%cl
je     1124 <sep+0x24>
add    $0x1,%rax
jmp    1110 <sep+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @sep(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 47, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i8* [ %3, %7 ], [ null, %2 ]
ret i8* %9
}
void XListFontsWithInfo() {}


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

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

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

LLVM IR (-O2):
define void @XListFontsWithInfo() {
ret void
}
unsigned int bitcount(unsigned int n) {
  unsigned int m;
  n -= (n >> 1) & 0x55555555;
  m = n & 0x33333333;
  n = m + ((n ^ m) >> 2);
  n = (n + (n >> 4)) & 0x0F0F0F0F;
  n = (n * 0x01010101) >> 24;
  return (n);
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
imul   $0x1010101,-0x4(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @bitcount(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = load i32, i32* %2
%8 = sub i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 858993459
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = xor i32 %12, %13
%15 = lshr i32 %14, 2
%16 = add i32 %11, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = load i32, i32* %2
%19 = lshr i32 %18, 4
%20 = add i32 %17, %19
%21 = and i32 %20, 252645135
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = mul i32 %22, 16843009
%24 = lshr i32 %23, 24
store i32 %24, i32* %2
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
/* Variables and functions */
double fminf(double a, double b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<fminf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fminf+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <fminf+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminf>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fminf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @fminf(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ giveup(char *);
void noReadMacros(void) { giveup("Can't support read-macros"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Can't support read-macros\00"
define void @noReadMacros() {
%1 = call i32 @giveup(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Can't support read-macros\00"
define void @noReadMacros() {
%1 = tail call i32 @giveup(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int fpeek(FILE *stream) {
  int c;
  c = fgetc(stream);
  ungetc(c, stream);
  return c;
}


x86 assembly (clang, -O0):
<fpeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpeek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fpeek(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @ungetc(i32 %6, i32* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @fpeek(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @ungetc(i32 %2, i32* %0)
ret i32 %2
}
void RTCircBufUsed(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ default_ai_get_self();
scalar_t__ unit_ai_data(struct unit const *, int /*<<< orphan*/);
struct unit_ai *def_ai_unit_data(const struct unit *punit) {
  return (struct unit_ai *)unit_ai_data(punit, default_ai_get_self());
}


x86 assembly (clang, -O0):
<def_ai_unit_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <default_ai_get_self@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <unit_ai_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_ai_unit_data>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <default_ai_get_self@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <unit_ai_data@plt>

LLVM IR (-O0):
%struct.unit_ai = type { i32 }
%struct.unit = type { i32 }
define %struct.unit_ai* @def_ai_unit_data(%struct.unit* %0) {
%2 = alloca %struct.unit*
store %struct.unit* %0, %struct.unit** %2
%3 = load %struct.unit*, %struct.unit** %2
%4 = call i32 (...) @default_ai_get_self()
%5 = call i64 @unit_ai_data(%struct.unit* %3, i32 %4)
%6 = inttoptr i64 %5 to %struct.unit_ai*
ret %struct.unit_ai* %6
}

LLVM IR (-O2):
%struct.unit_ai = type { i32 }
%struct.unit = type { i32 }
define %struct.unit_ai* @def_ai_unit_data(%struct.unit* %0) {
%2 = tail call i32 (...) @default_ai_get_self()
%3 = tail call i64 @unit_ai_data(%struct.unit* %0, i32 %2)
%4 = inttoptr i64 %3 to %struct.unit_ai*
ret %struct.unit_ai* %4
}