xunge/DecIR huggingface dataset:
void swap(char **a, int i, int j) {
  char *tmp = a[i];
  a[i] = a[j];
  a[j] = tmp;
}


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

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}
int main() {
  printf("%s", "Hello world!\n");
  printf("%d + %d = %d\n", 1, 1, 2);
  asm volatile(".byte 0xd6" : : "a"(0));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
(bad)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c"Hello world!\0A\00"
@.str.2 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 1, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [14 x i8] c"%d + %d = %d\0A\00"
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 1, i32 2)
tail call void asm sideeffect ".byte 0xd6", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printUsage(char *fname) {
  printf("\nUsage:\n"
         "   %s <input directory> <output file>\n",
         fname);
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"\0AUsage:\0A %s <input directory> <output file>\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0AUsage:\0A %s <input directory> <output file>\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int syscall(int, unsigned int, unsigned int, unsigned int);
int sys_close_range(unsigned int fd, unsigned int max_fd, unsigned int flags) {
  return syscall(436, fd, max_fd, flags);
}


x86 assembly (clang, -O0):
<sys_close_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1b4,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_close_range>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1b4,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @sys_close_range(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 @syscall(i32 436, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_close_range(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 436, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int __syscall2(int, long, int /*<<< orphan*/);
int gettimeofday(struct timeval *tv) { return __syscall2(96, (long)tv, 0); }


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

x86 assembly (clang, -O2):
<gettimeofday>:
mov    %rdi,%rsi
mov    $0x60,%edi
xor    %edx,%edx
jmp    1030 <__syscall2@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @gettimeofday(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = ptrtoint %struct.timeval* %3 to i64
%5 = call i32 @__syscall2(i32 96, i64 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @gettimeofday(%struct.timeval* %0) {
%2 = ptrtoint %struct.timeval* %0 to i64
%3 = tail call i32 @__syscall2(i32 96, i64 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
int int_crypto_stream_xor(unsigned char *, unsigned char const *,
                          unsigned long long, unsigned char const *,
                          unsigned char const *);
int long_crypto_stream_xor(unsigned char *, unsigned char const *,
                           unsigned long long, unsigned char const *,
                           unsigned char const *);
int crypto_stream_chacha20_tinynacl_xor(unsigned char *c,
                                        const unsigned char *m,
                                        unsigned long long l,
                                        const unsigned char *n,
                                        const unsigned char *k) {
  if (sizeof(int) == 4)
    return int_crypto_stream_xor(c, m, l, n, k);
  return long_crypto_stream_xor(c, m, l, n, k);
}


x86 assembly (clang, -O0):
<crypto_stream_chacha20_tinynacl_xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <int_crypto_stream_xor@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_stream_chacha20_tinynacl_xor>:
jmp    1030 <int_crypto_stream_xor@plt>

LLVM IR (-O0):
define i32 @crypto_stream_chacha20_tinynacl_xor(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @int_crypto_stream_xor(i8* %11, i8* %12, i64 %13, i8* %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @crypto_stream_chacha20_tinynacl_xor(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4) {
%6 = tail call i32 @int_crypto_stream_xor(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4)
ret i32 %6
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

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

LLVM IR (-O0):
define i32 @cmp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, float);
void main(void) {
  int x;
  float y;
  foo(x, y);
  return;
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = load i32, i32* %1
%4 = load float, float* %2
%5 = call i32 @foo(i32 %3, float %4)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @foo(i32 undef, float undef)
ret void
}
int euclid_gcd_recursive(int dividend, int divisor) {
  return divisor == 0 ? dividend
                      : euclid_gcd_recursive(divisor, dividend % divisor);
}


x86 assembly (clang, -O0):
<euclid_gcd_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <euclid_gcd_recursive+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <euclid_gcd_recursive+0x37>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <euclid_gcd_recursive@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_gcd_recursive>:
mov    %edi,%eax
test   %esi,%esi
je     111d <euclid_gcd_recursive+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <euclid_gcd_recursive+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @euclid_gcd_recursive(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
void m68k_write_memory_8(unsigned int address, unsigned int value) {
  (void)address;
  (void)value;
}


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

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

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

LLVM IR (-O2):
define void @m68k_write_memory_8(i32 %0, i32 %1) {
ret void
}
void definir_arrete(int **graphe, int nb_sommet, int *sommetapm, int *sommetbpm,
                    int poid) {
  graphe[*sommetapm][*sommetbpm] = poid;
  graphe[*sommetbpm][*sommetapm] = poid;
}


x86 assembly (clang, -O0):
<definir_arrete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x24(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<definir_arrete>:
movslq (%rdx),%rax
mov    (%rdi,%rax,8),%rax
movslq (%rcx),%rsi
mov    %r8d,(%rax,%rsi,4)
movslq (%rcx),%rax
mov    (%rdi,%rax,8),%rax
movslq (%rdx),%rcx
mov    %r8d,(%rax,%rcx,4)
ret

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

LLVM IR (-O2):
define void @definir_arrete(i32** nocapture %0, i32 %1, i32* nocapture %2, i32* nocapture %3, i32 %4) {
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = load i32*, i32** %8
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store i32 %4, i32* %12
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32*, i32** %0, i64 %14
%16 = load i32*, i32** %15
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %4, i32* %19
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(unsigned int);
void ft_putnbr_o(unsigned int n) {
  if (n > 7)
    ft_putnbr_o(n / 8);
  ft_putchar(n % 8 + 48);
}


x86 assembly (clang, -O0):
<ft_putnbr_o>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jbe    1140 <ft_putnbr_o+0x20>
mov    -0x4(%rbp),%edi
shr    $0x3,%edi
call   1030 <ft_putnbr_o@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
add    $0x30,%edi
call   1040 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_o>:
push   %rbx
mov    %edi,%ebx
cmp    $0x8,%edi
jb     1132 <ft_putnbr_o+0x12>
mov    %ebx,%edi
shr    $0x3,%edi
call   1030 <ft_putnbr_o@plt>
and    $0x7,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putnbr_o(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 7
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = udiv i32 %6, 8
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 8
%11 = add i32 %10, 48
%12 = call i32 @ft_putchar(i32 %11)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_o(i32 %0) {
%2 = icmp ugt i32 %0, 7
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i32 %0, 3
tail call void @ft_putnbr_o(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = and i32 %0, 7
%7 = or i32 %6, 48
%8 = tail call i32 @ft_putchar(i32 %7)
ret void
}
/* Variables and functions */
unsigned char getchar();
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char);
int main() {
  unsigned char c;
  c = getchar();
  printf("Le charactère %c est saisi sont code est %d\n", c, c);
  c = 200;
  printf("c=200 ==>c=%c d=%d\n", c, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
lea    0xec4(%rip),%rdi
movzbl %al,%esi
movzbl -0x1(%rbp),%edx
call   1030 <printf@plt>
movb   $0xc8,-0x1(%rbp)
mov    -0x1(%rbp),%al
lea    0xed8(%rip),%rdi
movzbl %al,%esi
movzbl -0x1(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
movzbl %al,%edx
lea    0xece(%rip),%rdi
mov    %edx,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0xc8,%esi
mov    $0xc8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Le charact\C3\A8re %c est saisi sont code est %d\0A\00"
@.str.1 = [20 x i8] c"c=200 ==>c=%c d=%d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call zeroext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = load i8, i8* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8 zeroext %3, i8 zeroext %4)
store i8 -56, i8* %1
%6 = load i8, i8* %1
%7 = load i8, i8* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %6, i8 zeroext %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"Le charact\C3\A8re %c est saisi sont code est %d\0A\00"
@.str.1 = [20 x i8] c"c=200 ==>c=%c d=%d\0A\00"
define i32 @main() {
%1 = tail call zeroext i8 (...) @getchar()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8 zeroext %1, i8 zeroext %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -56, i8 zeroext -56)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_flist_pop() {
  printf("NOT IMPLEMENTED:"
         "pa_flist_pop"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"NOT IMPLEMENTED:pa_flist_pop\0A\00"
define i32 @pa_flist_pop() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [29 x i8] c"NOT IMPLEMENTED:pa_flist_pop\00"
define i32 @pa_flist_pop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void set_pmu_sleep_clk_low() {}


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

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

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

LLVM IR (-O2):
define void @set_pmu_sleep_clk_low() {
ret void
}
/* Type definitions */
typedef scalar_t__ mem;

/* Variables and functions */
int /*<<< orphan*/ __zfree(void *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ tree_set_parent(void *, int /*<<< orphan*/ *);
void *tree_zfree(void *mem) {
  if (!mem)
    return NULL;
  tree_set_parent(mem, NULL);
  __zfree((((void **)(mem))[-3]));
  free((void *)((void **)(mem)-3));
  return NULL;
}


x86 assembly (clang, -O0):
<tree_zfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <tree_zfree+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1183 <tree_zfree+0x53>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <tree_set_parent@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rax),%rdi
call   1050 <__zfree@plt>
mov    -0x10(%rbp),%rdi
add    $0xffffffffffffffe8,%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_zfree>:
test   %rdi,%rdi
je     1156 <tree_zfree+0x26>
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <tree_set_parent@plt>
mov    -0x18(%rbx),%rdi
add    $0xffffffffffffffe8,%rbx
call   1050 <__zfree@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
pop    %rbx
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @tree_zfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @tree_set_parent(i8* %0, i32* null)
%5 = getelementptr inbounds i8, i8* %0, i64 -24
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = tail call i32 @__zfree(i8* %7)
%9 = tail call i32 @free(i8* %5)
br label %10
10: ; preds = %1, %3
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int /*<<< orphan*/ test5();
int /*<<< orphan*/ test6();
int /*<<< orphan*/ test7();
int /*<<< orphan*/ test8();
int main() {
  test1();
  test2();
  test3();
  test4();
  test5();
  test6();
  test7();
  test8();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test1@plt>
mov    $0x0,%al
call   1090 <test2@plt>
mov    $0x0,%al
call   1050 <test3@plt>
mov    $0x0,%al
call   1080 <test4@plt>
mov    $0x0,%al
call   1040 <test5@plt>
mov    $0x0,%al
call   1070 <test6@plt>
mov    $0x0,%al
call   1030 <test7@plt>
mov    $0x0,%al
call   10a0 <test8@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test1@plt>
xor    %eax,%eax
call   1090 <test2@plt>
xor    %eax,%eax
call   1050 <test3@plt>
xor    %eax,%eax
call   1080 <test4@plt>
xor    %eax,%eax
call   1040 <test5@plt>
xor    %eax,%eax
call   1070 <test6@plt>
xor    %eax,%eax
call   1030 <test7@plt>
xor    %eax,%eax
call   10a0 <test8@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2()
%4 = call i32 (...) @test3()
%5 = call i32 (...) @test4()
%6 = call i32 (...) @test5()
%7 = call i32 (...) @test6()
%8 = call i32 (...) @test7()
%9 = call i32 (...) @test8()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
%5 = tail call i32 (...) @test5()
%6 = tail call i32 (...) @test6()
%7 = tail call i32 (...) @test7()
%8 = tail call i32 (...) @test8()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(int const, int const, int const, int);
void glWindowPos3iv(const int v[3]) { glWindowPos4f(v[0], v[1], v[2], 1); }


x86 assembly (clang, -O0):
<glWindowPos3iv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edx
mov    $0x1,%ecx
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos3iv>:
mov    (%rdi),%eax
mov    0x4(%rdi),%esi
mov    0x8(%rdi),%edx
mov    %eax,%edi
mov    $0x1,%ecx
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos3iv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = call i32 @glWindowPos4f(i32 %5, i32 %8, i32 %11, i32 1)
ret void
}

LLVM IR (-O2):
define void @glWindowPos3iv(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = tail call i32 @glWindowPos4f(i32 %2, i32 %4, i32 %6, i32 1)
ret void
}
/* Variables and functions */
int f36(int *);
int f37(int *p) { return f36(p); }


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

x86 assembly (clang, -O2):
<f37>:
jmp    1030 <f36@plt>

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

LLVM IR (-O2):
define i32 @f37(i32* %0) {
%2 = tail call i32 @f36(i32* %0)
ret i32 %2
}
void foo815() {}


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

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

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

LLVM IR (-O2):
define void @foo815() {
ret void
}
/* Variables and functions */
scalar_t__ sqrt(int);
int prime(int x) {
  int i;
  for (i = 2; i < (int)sqrt(x); i++)
    if (x % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    116d <prime+0x5d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115a <prime+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1174 <prime+0x64>
jmp    115f <prime+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <prime+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
call   1030 <sqrt@plt>
mov    $0x1,%r14d
cmp    $0x3,%eax
jl     114c <prime+0x3c>
mov    $0x2,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%eax
cltd
idiv   %ebx
test   %edx,%edx
je     1149 <prime+0x39>
add    $0x1,%ebx
mov    %ebp,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebx
jl     1130 <prime+0x20>
jmp    114c <prime+0x3c>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = tail call i64 @sqrt(i32 %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 2
br i1 %4, label %9, label %14
5: ; preds = %9
%6 = tail call i64 @sqrt(i32 %0)
%7 = trunc i64 %6 to i32
%8 = icmp slt i32 %13, %7
br i1 %8, label %9, label %14
9: ; preds = %1, %5
%10 = phi i32 [ %13, %5 ], [ 2, %1 ]
%11 = srem i32 %0, %10
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i32 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %1
%15 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ deviceInit();
int /*<<< orphan*/ platformInit();
void machineInit() {
  platformInit();
  deviceInit();
}


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

x86 assembly (clang, -O2):
<machineInit>:
push   %rax
xor    %eax,%eax
call   1030 <platformInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <deviceInit@plt>

LLVM IR (-O0):
define void @machineInit() {
%1 = call i32 (...) @platformInit()
%2 = call i32 (...) @deviceInit()
ret void
}

LLVM IR (-O2):
define void @machineInit() {
%1 = tail call i32 (...) @platformInit()
%2 = tail call i32 (...) @deviceInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, unsigned int, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void sleep(unsigned int time) { int80(10, time, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xa,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <int80@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rax
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0xa,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @sleep(i32 %0) {
%2 = tail call i32 @int80(i32 10, i32 %0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void fftwf_assertion_failed(const char *s, int line, const char *file) {
  fflush(stdout);
  fprintf(stderr, "fftw: %s:%d: assertion failed: %s\n", file, line, s);
  abort();
}


x86 assembly (clang, -O0):
<fftwf_assertion_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<fftwf_assertion_failed>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %r14,%r8
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [35 x i8] c"fftw: %s:%d: assertion failed: %s\0A\00"
define void @fftwf_assertion_failed(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i32, i32* %5
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12)
%14 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [35 x i8] c"fftw: %s:%d: assertion failed: %s\0A\00"
define void @fftwf_assertion_failed(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %1, i8* %0)
%8 = tail call i32 (...) @abort()
unreachable
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xfocus;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xfocus_type(void *_p) {
  return (int)((XEvent *)_p)->xfocus.type;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xfocus_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void malloc_free_ok() {
  int *p = (int *)malloc(sizeof(int));
  free(p);
}


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

x86 assembly (clang, -O2):
<malloc_free_ok>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @malloc_free_ok() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @free(i32* %4)
ret void
}

LLVM IR (-O2):
define void @malloc_free_ok() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
char *dict_lookup(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *translate(char *word) {
  static char buf[1024];
  char *res;
  res = dict_lookup(word);
  if (res) {
    strcpy(buf, res);
    return buf;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <dict_lookup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <translate+0x44>
mov    -0x18(%rbp),%rsi
lea    0x2ef1(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2ee5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <translate+0x4c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate>:
push   %rbx
call   1040 <dict_lookup@plt>
test   %rax,%rax
je     113f <translate+0x1f>
lea    0x2f0e(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
jmp    1141 <translate+0x21>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@translate.buf = internal global [1024 x i8] zeroinitializer
define i8* @translate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @dict_lookup(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @translate.buf, i64 0, i64 0), i8* %10)
store i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @translate.buf, i64 0, i64 0), i8** %2
br label %13
12: ; preds = %1
store i8* null, i8** %2
br label %13
13: ; preds = %12, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@translate.buf = internal global [1024 x i8] zeroinitializer
define i8* @translate(i8* %0) {
%2 = tail call i8* @dict_lookup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @strcpy(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @translate.buf, i64 0, i64 0), i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ getelementptr inbounds ([1024 x i8], [1024 x i8]* @translate.buf, i64 0, i64 0), %4 ], [ null, %1 ]
ret i8* %7
}
int my_isdigit(int c) { return (unsigned)c - '0' < 10; }


x86 assembly (clang, -O0):
<my_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @my_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 48
%5 = icmp ult i32 %4, 10
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @my_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ db_open(char const *);
int /*<<< orphan*/ db_read();
scalar_t__ sdb_has_errors();
int sdb_init_fasta(const char *fasta_file_name) {
  db_open(fasta_file_name);
  if (sdb_has_errors()) {
    return 1;
  }
  db_read();
  if (sdb_has_errors()) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sdb_init_fasta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <db_open@plt>
mov    $0x0,%al
call   1050 <sdb_has_errors@plt>
cmp    $0x0,%rax
je     1162 <sdb_init_fasta+0x32>
movl   $0x1,-0x4(%rbp)
jmp    118d <sdb_init_fasta+0x5d>
mov    $0x0,%al
call   1040 <db_read@plt>
mov    $0x0,%al
call   1050 <sdb_has_errors@plt>
cmp    $0x0,%rax
je     1186 <sdb_init_fasta+0x56>
movl   $0x1,-0x4(%rbp)
jmp    118d <sdb_init_fasta+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdb_init_fasta>:
push   %rax
call   1030 <db_open@plt>
xor    %eax,%eax
call   1050 <sdb_has_errors@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     114c <sdb_init_fasta+0x1c>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <db_read@plt>
xor    %eax,%eax
call   1050 <sdb_has_errors@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sdb_init_fasta(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @db_open(i8* %4)
%6 = call i64 (...) @sdb_has_errors()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %15
9: ; preds = %1
%10 = call i32 (...) @db_read()
%11 = call i64 (...) @sdb_has_errors()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %2
br label %15
14: ; preds = %9
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @sdb_init_fasta(i8* %0) {
%2 = tail call i32 @db_open(i8* %0)
%3 = tail call i64 (...) @sdb_has_errors()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = tail call i32 (...) @db_read()
%7 = tail call i64 (...) @sdb_has_errors()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_load_spr(int);
void spr_read_ureg(void *opaque, int sprn) { gen_op_load_spr(sprn + 0x10); }


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

x86 assembly (clang, -O2):
<spr_read_ureg>:
lea    0x10(%rsi),%edi
jmp    1030 <gen_op_load_spr@plt>

LLVM IR (-O0):
define void @spr_read_ureg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 16
%7 = call i32 @gen_op_load_spr(i32 %6)
ret void
}

LLVM IR (-O2):
define void @spr_read_ureg(i8* nocapture readnone %0, i32 %1) {
%3 = add nsw i32 %1, 16
%4 = tail call i32 @gen_op_load_spr(i32 %3)
ret void
}
void trivial_Bad() {
  int a[10];
  a[10] = 0;
}


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

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

LLVM IR (-O0):
define void @trivial_Bad() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 10
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
define void @trivial_Bad() {
ret void
}
int deleteMov() {
  int res;
  __asm__ volatile("xor   %0,%0;"
                   "mov   $-1,%0"
                   : "=r"(res));
  return res;
}


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

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

LLVM IR (-O0):
define i32 @deleteMov() {
%1 = alloca i32
%2 = call i32 asm sideeffect "xor $0,$0;mov $$-1,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @deleteMov() {
%1 = tail call i32 asm sideeffect "xor $0,$0;mov $$-1,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
char *astrcpy(char const *);
size_t strlen(char const *);
char *astrright(const char *src, size_t count) {
  if (count >= strlen(src)) {
    return astrcpy(src);
  } else {
    return astrcpy(&src[strlen(src) - count]);
  }
}


x86 assembly (clang, -O0):
<astrright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jb     1163 <astrright+0x43>
mov    -0x10(%rbp),%rdi
call   1040 <astrcpy@plt>
mov    %rax,-0x8(%rbp)
jmp    1188 <astrright+0x68>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
sub    -0x18(%rbp),%rax
add    %rax,%rdi
call   1040 <astrcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astrright>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %edi,%edi
sub    %r14,%rax
cmovae %rax,%rdi
add    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <astrcpy@plt>

LLVM IR (-O0):
define i8* @astrright(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = icmp uge i64 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i8* @astrcpy(i8* %11)
store i8* %12, i8** %3
br label %21
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i8*, i8** %4
%16 = call i64 @strlen(i8* %15)
%17 = load i64, i64* %5
%18 = sub i64 %16, %17
%19 = getelementptr inbounds i8, i8* %14, i64 %18
%20 = call i8* @astrcpy(i8* %19)
store i8* %20, i8** %3
br label %21
21: ; preds = %13, %10
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @astrright(i8* %0, i64 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = call i64 @llvm.usub.sat.i64(i64 %3, i64 %1)
%5 = getelementptr i8, i8* %0, i64 %4
%6 = tail call i8* @astrcpy(i8* %5)
ret i8* %6
}
void gtk_widget_is_focus() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_is_focus() {
ret void
}
/* Variables and functions */
size_t align_size(size_t s) {
  size_t aligned = s & (~(sizeof(void *) - 1));
  if (aligned != s) {
    aligned += sizeof(void *);
  }
  return aligned;
}


x86 assembly (clang, -O0):
<align_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     112e <align_size+0x2e>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_size>:
mov    %rdi,%rcx
and    $0xfffffffffffffff8,%rcx
lea    0x8(%rcx),%rax
cmp    %rdi,%rcx
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @align_size(i64 %0) {
%2 = and i64 %0, -8
%3 = icmp eq i64 %2, %0
%4 = add i64 %2, 8
%5 = select i1 %3, i64 %2, i64 %4
ret i64 %5
}