xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char *, char *);
int descend(const void *a, const void *b) {
  return -1 * strcmp((char *)a, (char *)b);
}


x86 assembly (clang, -O0):
<descend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
imul   $0xffffffff,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<descend>:
push   %rax
call   1030 <strcmp@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @descend(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 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = mul nsw i32 -1, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @descend(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putch(unsigned char);
int strlen(char const *);
void puts(unsigned char *text) {
  int i;
  for (i = 0; i < strlen((const char *)text); i++) {
    putch(text[i]);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    116e <puts+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1040 <putch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <puts+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    115d <puts+0x3d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1040 <putch@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <puts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @putch(i8 zeroext %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @putch(i8 zeroext %7)
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
void sum_gabor(int *gabor, int n) {
  int sum;
  int i;
  sum = 0;
  for (i = 0; i < n * n; i++)
    sum += gabor[i];
}


x86 assembly (clang, -O0):
<sum_gabor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    114a <sum_gabor+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <sum_gabor+0x19>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sum_gabor(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
size_t align_to_power_of_two(size_t size, size_t alignment) {
  return (size + alignment - 1) & ~(alignment - 1);
}


x86 assembly (clang, -O0):
<align_to_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_to_power_of_two>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @align_to_power_of_two(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 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @align_to_power_of_two(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
int main() {
  int i, j;
  int c = 0;
  for (i = 0; i < 100; i++)
    c = c + 1;
  for (j = 5; j < 21; j += 3)
    c = c + 1;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    113a <main+0x3a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
movl   $0x5,-0xc(%rbp)
cmpl   $0x15,-0xc(%rbp)
jge    1162 <main+0x62>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <main+0x41>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 106
}
/* Variables and functions */
int /*<<< orphan*/ passageParCopie(int);
int /*<<< orphan*/ passageParReference(int *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int valeur = 5;
  passageParCopie(valeur);
  printf("Valeur apres un passage par copie : %d\n", valeur);
  passageParReference(&valeur);
  printf("Valeur apres un passage par reference : %d\n", valeur);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <passageParCopie@plt>
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1050 <passageParReference@plt>
mov    -0x14(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
mov    $0x5,%edi
call   1040 <passageParCopie@plt>
lea    0xeb6(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1050 <passageParReference@plt>
mov    0x4(%rsp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Valeur apres un passage par copie : %d\0A\00"
@.str.1 = [44 x i8] c"Valeur apres un passage par reference : %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @passageParCopie(i32 %7)
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @passageParReference(i32* %6)
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Valeur apres un passage par copie : %d\0A\00"
@.str.1 = [44 x i8] c"Valeur apres un passage par reference : %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 5, i32* %3
%5 = tail call i32 @passageParCopie(i32 5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 5)
%7 = call i32 @passageParReference(i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_bits(int num, int digits) {
  int temp;
  temp = 1 << (digits - 1);
  while (temp > 0) {
    if (num & temp) {
      printf("1");
    } else {
      printf("0");
    }
    temp >>= 1;
  }
  return;
}


x86 assembly (clang, -O0):
<print_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1172 <print_bits+0x62>
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1158 <print_bits+0x48>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1164 <print_bits+0x54>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <print_bits+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bits>:
push   %rbp
push   %r14
push   %rbx
add    $0xffffffff,%esi
cmp    $0x1f,%esi
je     114e <print_bits+0x3e>
mov    %edi,%r14d
mov    $0x1,%ebx
mov    %esi,%ecx
shl    %cl,%ebx
mov    %ebx,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%eax
and    %r14d,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
shr    %ebp
cmp    $0x1,%ebx
mov    %ebp,%ebx
ja     1130 <print_bits+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @print_bits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = shl i32 1, %7
store i32 %8, i32* %5
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = and i32 %13, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %21
19: ; preds = %12
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
%22 = load i32, i32* %5
%23 = ashr i32 %22, 1
store i32 %23, i32* %5
br label %9
24: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @print_bits(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = icmp eq i32 %3, 31
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = shl nuw i32 1, %3
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %13, %7 ], [ %6, %5 ]
%9 = and i32 %8, %0
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 48, i32 49
%12 = tail call i32 @putchar(i32 %11)
%13 = lshr i32 %8, 1
%14 = icmp ult i32 %8, 2
br i1 %14, label %15, label %7
15: ; preds = %7, %2
ret void
}
void foo(void) {
#pragma omp target defaultmap(alloc) defaultmap(alloc)
  ;
#pragma omp target defaultmap(to) defaultmap(from)
  ;
#pragma omp target defaultmap(tofrom) defaultmap(firstprivate : scalar)
  ;
#pragma omp target defaultmap(none                                             \
                              : aggregate) defaultmap(alloc                    \
                                                      : scalar)                \
    defaultmap(none                                                            \
               : scalar)
  ;
#pragma omp target defaultmap(none : pointer) defaultmap(none)
  ;
#pragma omp target defaultmap()
  ;
#pragma omp target defaultmap(for)
  ;
#pragma omp target defaultmap(blah)
  ;
#pragma omp target defaultmap(tofrom:)
  ;
#pragma omp target defaultmap(tofrom scalar)
  ;
#pragma omp target defaultmap(tofrom, scalar)
  ;
#pragma omp target defaultmap(default;)
  ;
#pragma omp target defaultmap(default : qux)
  ;
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ romdisk_fd_free(void *);
void romdisk_close(void *fh) { romdisk_fd_free(fh); }


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

x86 assembly (clang, -O2):
<romdisk_close>:
jmp    1030 <romdisk_fd_free@plt>

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

LLVM IR (-O2):
define void @romdisk_close(i8* %0) {
%2 = tail call i32 @romdisk_fd_free(i8* %0)
ret void
}
/* Variables and functions */
unsigned int const RAND_MAX;
unsigned int random();
unsigned int getRandomIndex(unsigned int min, unsigned int max) {
  unsigned int r;
  const unsigned int range = max - min;
  const unsigned int buckets = RAND_MAX / range;
  const unsigned int limit = buckets * range;
  do {
    r = random();
  } while (r >= limit);
  return min + (r / buckets);
}


x86 assembly (clang, -O0):
<getRandomIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1142 <getRandomIndex+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomIndex>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
jmp    1120 <getRandomIndex+0x10>

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

LLVM IR (-O2):
@RAND_MAX = constant i32 0
define i32 @getRandomIndex(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @random()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ alignof(short);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  short x;
  printf("%zu\n", alignof(x));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = tail call i32 @alignof(i16 signext undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
double crossing(double A, double B, double C, double D) {
  return (C - A) / ((B - A) - (D - C));
}


x86 assembly (clang, -O0):
<crossing>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<crossing>:
subsd  %xmm2,%xmm3
subsd  %xmm0,%xmm2
subsd  %xmm0,%xmm1
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @crossing(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fsub double %12, %13
%15 = load double, double* %8
%16 = load double, double* %7
%17 = fsub double %15, %16
%18 = fsub double %14, %17
%19 = fdiv double %11, %18
ret double %19
}

LLVM IR (-O2):
define double @crossing(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = fsub double %1, %0
%7 = fsub double %3, %2
%8 = fsub double %6, %7
%9 = fdiv double %5, %8
ret double %9
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void getRfc822Time(struct tm *time, char *timeTxt) {
  strftime(timeTxt, 47, "%a, %d %b %Y %H:%M:%S %z", time);
}


x86 assembly (clang, -O0):
<getRfc822Time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x2f,%esi
lea    0xecc(%rip),%rdx
call   1030 <strftime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRfc822Time>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdx
mov    %rsi,%rdi
mov    $0x2f,%esi
jmp    1030 <strftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [25 x i8] c"%a, %d %b %Y %H:%M:%S %z\00"
define void @getRfc822Time(%struct.tm* %0, i8* %1) {
%3 = alloca %struct.tm*
%4 = alloca i8*
store %struct.tm* %0, %struct.tm** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load %struct.tm*, %struct.tm** %3
%7 = call i32 @strftime(i8* %5, i32 47, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [25 x i8] c"%a, %d %b %Y %H:%M:%S %z\00"
define void @getRfc822Time(%struct.tm* %0, i8* %1) {
%3 = tail call i32 @strftime(i8* %1, i32 47, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %struct.tm* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar0(int /*<<< orphan*/);
int _write(int fd, char *ptr, int len) {
  for (; len > 0; --len)
    putchar0(*ptr++);
  return len;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1151 <_write+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <putchar0@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1122 <_write+0x12>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
test   %edx,%edx
jle    1136 <_write+0x26>
mov    %rsi,%rbx
add    $0x1,%ebp
nop
movsbl (%rbx),%edi
add    $0x1,%rbx
call   1030 <putchar0@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <_write+0x10>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %12, %5 ], [ %2, %3 ]
%7 = phi i8* [ %8, %5 ], [ %1, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar0(i32 %10)
%12 = add nsw i32 %6, -1
%13 = icmp ugt i32 %6, 1
br i1 %13, label %5, label %14
14: ; preds = %5, %3
%15 = phi i32 [ %2, %3 ], [ 0, %5 ]
ret i32 %15
}
R0R1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (r0 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0R1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     113b <R0R1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <R0R1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0R1>:
shl    $0x10,%edi
shl    $0x10,%esi
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

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

LLVM IR (-O2):
define i32 @R0R1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = shl i32 %0, 16
%8 = shl i32 %1, 16
%9 = icmp sle i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
unsigned char DecEsa(unsigned char dec) {
  return dec / 10 * 16 + dec - (dec / 10) * 10;
}


x86 assembly (clang, -O0):
<DecEsa>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
movzbl -0x1(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0xa,%ecx,%ecx
sub    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecEsa>:
imul   $0xcd,%edi,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,2),%eax
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @DecEsa(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 10
%6 = mul nsw i32 %5, 16
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = sdiv i32 %11, 10
%13 = mul nsw i32 %12, 10
%14 = sub nsw i32 %9, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @DecEsa(i8 zeroext %0) {
%2 = udiv i8 %0, 10
%3 = mul nuw i8 %2, 6
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void convert(char *str[]) {
  int i = 0;
  int j = 1;
  printf("\n_HERE_\n%s\n_HERE_\n", str[j]);
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
mov    0x8(%rdi),%rsi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0A_HERE_\0A%s\0A_HERE_\0A\00"
define void @convert(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
store i32 1, i32* %4
%5 = load i8**, i8*** %2
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0A_HERE_\0A%s\0A_HERE_\0A\00"
define void @convert(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void FogetInitialize() {
  int x, y, z;
  printf("%d, %d, %d\n", x, y, z);
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d, %d, %d\0A\00"
define void @FogetInitialize() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef, i32 undef)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void split_addr(char *src, char **host, char **service) {
  *host = src;
  if ((*service = strchr(src, ':')) != NULL)
    *((*service)++) = '\0';
}


x86 assembly (clang, -O0):
<split_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     1162 <split_addr+0x52>
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_addr>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,(%rsi)
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1136 <split_addr+0x26>
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,(%rbx)
movb   $0x0,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @split_addr(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2) {
store i8* %0, i8** %1
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
store i8* %4, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %2
store i8 0, i8* %4
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_CULL_FACE;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void Init(void) {
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glEnable(GL_CULL_FACE);
}


x86 assembly (clang, -O0):
<Init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glEnable@plt>

LLVM IR (-O0):
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_CULL_FACE = global i32 0
define void @Init() {
%1 = load i32, i32* @GL_LIGHTING
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHT0
%4 = call i32 @glEnable(i32 %3)
%5 = load i32, i32* @GL_CULL_FACE
%6 = call i32 @glEnable(i32 %5)
ret void
}

LLVM IR (-O2):
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_CULL_FACE = global i32 0
define void @Init() {
%1 = load i32, i32* @GL_LIGHTING
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHT0
%4 = tail call i32 @glEnable(i32 %3)
%5 = load i32, i32* @GL_CULL_FACE
%6 = tail call i32 @glEnable(i32 %5)
ret void
}
/* Variables and functions */
char getch();
char lireSansEntree(void) {
  char c;
  c = getch();
  return c;
}


x86 assembly (clang, -O0):
<lireSansEntree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @lireSansEntree() {
%1 = alloca i8
%2 = call signext i8 (...) @getch()
store i8 %2, i8* %1
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @lireSansEntree() {
%1 = tail call signext i8 (...) @getch()
ret i8 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  const time_t timer = time(NULL);
  printf("%s\n", ctime(&timer));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int gagne(int tableauGagne[]) {
  int i = 0;
  int joueurGagne = 1;
  for (i = 0; i < 6; i++) {
    if (tableauGagne[i] == 0)
      joueurGagne = 0;
  }
  return joueurGagne;
}


x86 assembly (clang, -O0):
<gagne>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1153 <gagne+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1140 <gagne+0x40>
movl   $0x0,-0x10(%rbp)
jmp    1145 <gagne+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <gagne+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gagne>:
cmpl   $0x0,(%rdi)
setne  %al
cmpl   $0x0,0x4(%rdi)
setne  %cl
movdqu 0x8(%rdi),%xmm0
pxor   %xmm1,%xmm1
pcmpeqd %xmm0,%xmm1
movmskps %xmm1,%edx
test   %edx,%edx
sete   %dl
and    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @gagne(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = bitcast i32* %7 to <4 x i32>*
%9 = load <4 x i32>, <4 x i32>* %8
%10 = freeze <4 x i32> %9
%11 = icmp eq <4 x i32> %10, zeroinitializer
%12 = bitcast <4 x i1> %11 to i4
%13 = icmp eq i4 %12, 0
%14 = select i1 %13, i1 %6, i1 false
%15 = select i1 %14, i1 %3, i1 false
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ Print_Symbol(char);
void Print_State(void) {
  for (;;) {
    Print_Symbol('-');
    Print_Symbol('\\');
    Print_Symbol('|');
    Print_Symbol('/');
  }
}


x86 assembly (clang, -O0):
<Print_State>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <Print_State+0x9>
mov    $0x2d,%edi
call   1030 <Print_Symbol@plt>
mov    $0x5c,%edi
call   1030 <Print_Symbol@plt>
mov    $0x7c,%edi
call   1030 <Print_Symbol@plt>
mov    $0x2f,%edi
call   1030 <Print_Symbol@plt>
jmp    1119 <Print_State+0x9>

x86 assembly (clang, -O2):
<Print_State>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <Print_Symbol@plt>
mov    $0x5c,%edi
call   1030 <Print_Symbol@plt>
mov    $0x7c,%edi
call   1030 <Print_Symbol@plt>
mov    $0x2f,%edi
call   1030 <Print_Symbol@plt>
jmp    1120 <Print_State+0x10>

LLVM IR (-O0):
define void @Print_State() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @Print_Symbol(i8 signext 45)
%3 = call i32 @Print_Symbol(i8 signext 92)
%4 = call i32 @Print_Symbol(i8 signext 124)
%5 = call i32 @Print_Symbol(i8 signext 47)
br label %1
}

LLVM IR (-O2):
define void @Print_State() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @Print_Symbol(i8 signext 45)
%3 = tail call i32 @Print_Symbol(i8 signext 92)
%4 = tail call i32 @Print_Symbol(i8 signext 124)
%5 = tail call i32 @Print_Symbol(i8 signext 47)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ printf(char *);
void abort() {
  printf("abort");
  _exit(1);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"abort\00"
define void @abort() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_exit(i32 1)
unreachable
}
void av_format_set_video_codec() {}


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

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

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

LLVM IR (-O2):
define void @av_format_set_video_codec() {
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IWGRP;
scalar_t__ stat(char *, struct stat *);
int files_iswrite(char *filename) {
  struct stat buf;
  if (stat(filename, &buf) < 0) {
    return -1;
  }
  return ((buf.st_mode & S_IWGRP) != 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<files_iswrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <files_iswrite+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <files_iswrite+0x4b>
mov    -0x18(%rbp),%edx
mov    0x2e9f(%rip),%rax
and    (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<files_iswrite>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1131 <files_iswrite+0x21>
mov    0x2ec3(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rsp)
setne  %al
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IWGRP = global i32 0
define i32 @files_iswrite(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %17
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IWGRP
%13 = and i32 %11, %12
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
store i32 %16, i32* %2
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IWGRP = global i32 0
define i32 @files_iswrite(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IWGRP
%10 = and i32 %9, %8
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %1, %6
%14 = phi i32 [ %12, %6 ], [ -1, %1 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ die(char *, int, int);
int fgetc(int /*<<< orphan*/ *);
void d_match_type(FILE *stream, int type) {
  int gottype = fgetc(stream);
  if (gottype != type)
    die("Deserialization type error: expected %c, got %c\n", type, gottype);
}


x86 assembly (clang, -O0):
<d_match_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1159 <d_match_type+0x39>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_match_type>:
push   %rbx
mov    %esi,%ebx
call   1030 <fgetc@plt>
cmp    %ebx,%eax
jne    112e <d_match_type+0xe>
pop    %rbx
ret
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <die@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Deserialization type error: expected %c, got %c\0A\00"
define void @d_match_type(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @fgetc(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @die(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Deserialization type error: expected %c, got %c\0A\00"
define void @d_match_type(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fgetc(i32* %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
br label %7
7: ; preds = %5, %2
ret void
}
long long plugin_library_minimum_version(void) {
  return 0 * 100000000 + 0 * 100000 + 0;
}


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

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

LLVM IR (-O0):
define i64 @plugin_library_minimum_version() {
ret i64 0
}

LLVM IR (-O2):
define i64 @plugin_library_minimum_version() {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ sclass_univ_delete_entry(int /*<<< orphan*/,
                                            int /*<<< orphan*/ const *,
                                            int /*<<< orphan*/);
uint8_t sclass_mr_delete_entry(uint8_t nleng, const uint8_t *name,
                               uint16_t esclassid) {
  return sclass_univ_delete_entry(nleng, name, esclassid);
}


x86 assembly (clang, -O0):
<sclass_mr_delete_entry>:
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 <sclass_univ_delete_entry@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sclass_mr_delete_entry>:
jmp    1030 <sclass_univ_delete_entry@plt>

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

LLVM IR (-O2):
define i32 @sclass_mr_delete_entry(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @sclass_univ_delete_entry(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int fclose_file_func(void *opaque, void *stream) {
  return fclose((FILE *)stream);
}


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

x86 assembly (clang, -O2):
<fclose_file_func>:
mov    %rsi,%rdi
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define i32 @fclose_file_func(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @fclose(i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "find_eventproc <dumpfile.bin> <base address> <name1> <name1> ...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"find_eventproc <dumpfile.bin> <base address> <name1> <name1> ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"find_eventproc <dumpfile.bin> <base address> <name1> <name1> ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}