xunge/DecIR huggingface dataset:
void __set_64bit(unsigned long long *ptr, unsigned int low, unsigned int high) {
  __asm__ __volatile__("\n1:\t"
                       "movl (%0), %%eax\n\t"
                       "movl 4(%0), %%edx\n\t"
                       "lock cmpxchg8b (%0)\n\t"
                       "jnz 1b" ::"D"(ptr),
                       "b"(low), "c"(high)
                       : "ax", "dx", "memory");
}


x86 assembly (clang, -O0):
<__set_64bit>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ebx
mov    -0x18(%rbp),%ecx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
lock cmpxchg8b (%rdi)
jne    1119 <__set_64bit+0x19>
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_64bit>:
push   %rbx
mov    %edx,%ecx
mov    %esi,%ebx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
lock cmpxchg8b (%rdi)
jne    1105 <__set_64bit+0x5>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__set_64bit(i64* %0, i32 %1, i32 %2) {
tail call void asm sideeffect "\0A1:\09movl ($0), %eax\0A\09movl 4($0), %edx\0A\09lock cmpxchg8b ($0)\0A\09jnz 1b", "{di},{bx},{cx},~{ax},~{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int max_sum(int *, int);
int max_sum_brute(int *, int);
int test_single_positive() {
  int input[] = {5};
  return 5 == max_sum_brute(input, 1) && 5 == max_sum(input, 1);
}


x86 assembly (clang, -O0):
<test_single_positive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1040 <max_sum_brute@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1170 <test_single_positive+0x50>
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1030 <max_sum@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_single_positive>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1040 <max_sum_brute@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
jne    115a <test_single_positive+0x3a>
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <max_sum@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@__const.test_single_positive.input = [1 x i32] [i32 5]
define i32 @test_single_positive() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%4 = call i32 @max_sum_brute(i32* %3, i32 1)
%5 = icmp eq i32 5, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%8 = call i32 @max_sum(i32* %7, i32 1)
%9 = icmp eq i32 5, %8
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_single_positive() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 5, i32* %3
%4 = call i32 @max_sum_brute(i32* %3, i32 1)
%5 = icmp eq i32 %4, 5
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @max_sum(i32* %3, i32 1)
%8 = icmp eq i32 %7, 5
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage(char *name) {
  printf("%s [-h -n number] sequence file\n", name);
  printf("-h print a detailed help\n"
         "-n print n sequences from the file\n"
         "-a print the output in fasta format (the default is fastq)\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"%s [-h -n number] sequence file\0A\00"
@.str.1 = [120 x i8] c"-h print a detailed help\0A-n print n sequences from the file\0A-a print the output in fasta format (the default is fastq)\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s [-h -n number] sequence file\0A\00"
@str = [119 x i8] c"-h print a detailed help\0A-n print n sequences from the file\0A-a print the output in fasta format (the default is fastq)\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([119 x i8], [119 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned umax(unsigned a, unsigned b) { return ((a <= b) ? b : a); }


x86 assembly (clang, -O0):
<umax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     1121 <umax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <umax+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umax>:
mov    %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @umax(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
double sin(double);
double sin_wrapper(double *arg_list) { return (sin(arg_list[0])); }


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

x86 assembly (clang, -O2):
<sin_wrapper>:
movsd  (%rdi),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @sin_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @sin_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @sin(double %2)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void decodeSecondByte(uint8_t *src, uint32_t *p32_dest) {
  uint8_t *p8_dest = (uint8_t *)p32_dest;
  *(p8_dest + 1) = *(src + 1);
}


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

x86 assembly (clang, -O2):
<decodeSecondByte>:
mov    0x4(%rdi),%eax
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
define void @decodeSecondByte(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
store i32* %6, i32** %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @decodeSecondByte(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ input();
int /*<<< orphan*/ output();
int /*<<< orphan*/ process();
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long i, t;
  scanf("%ld", &t);
  for (i = 1; i <= t; i++) {
    input();
    process();
    output();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     119b <main+0x5b>
mov    $0x0,%al
call   1030 <input@plt>
mov    $0x0,%al
call   1050 <process@plt>
mov    $0x0,%al
call   1040 <output@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1167 <main+0x27>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
cmpq   $0x0,0x8(%rsp)
jle    1180 <main+0x40>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <input@plt>
xor    %eax,%eax
call   1050 <process@plt>
xor    %eax,%eax
call   1040 <output@plt>
add    $0x1,%rbx
cmp    0x8(%rsp),%rbx
jl     1160 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 1
br i1 %5, label %14, label %6
6: ; preds = %0, %6
%7 = phi i64 [ %11, %6 ], [ 1, %0 ]
%8 = call i32 (...) @input()
%9 = call i32 (...) @process()
%10 = call i32 (...) @output()
%11 = add nuw nsw i64 %7, 1
%12 = load i64, i64* %1
%13 = icmp slt i64 %7, %12
br i1 %13, label %6, label %14
14: ; preds = %6, %0
ret i32 0
}
int _compare_fun(const void *a, const void *b) {
  return (**(int **)a - **(int **)b);
}


x86 assembly (clang, -O0):
<_compare_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_compare_fun>:
mov    (%rdi),%rax
mov    (%rax),%eax
mov    (%rsi),%rcx
sub    (%rcx),%eax
ret

LLVM IR (-O0):
define i32 @_compare_fun(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 i32**
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32**
%11 = load i32*, i32** %10
%12 = load i32, i32* %11
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @_compare_fun(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32**
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}
void SteamAPI_ISteamHTMLSurface_StopLoad(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamHTMLSurface_StopLoad>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_StopLoad = [36 x i8] c"SteamAPI_ISteamHTMLSurface_StopLoad\00"
define void @SteamAPI_ISteamHTMLSurface_StopLoad(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_StopLoad, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_StopLoad = [36 x i8] c"SteamAPI_ISteamHTMLSurface_StopLoad\00"
define void @SteamAPI_ISteamHTMLSurface_StopLoad(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_StopLoad, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ isPrime(unsigned long long);
int /*<<< orphan*/ printf(char *, unsigned long long);
int main() {
  unsigned long long int sum = 0, number = 2;
  while (number < 2000000) {
    if (isPrime(number))
      sum += number;
    number++;
  }
  printf("%llu", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
cmpq   $0x1e8480,-0x18(%rbp)
jae    117d <main+0x5d>
mov    -0x18(%rbp),%rdi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     116c <main+0x4c>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113f <main+0x1f>
mov    -0x10(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <isPrime@plt>
test   %rax,%rax
cmovne %rbx,%rax
add    %rax,%r14
add    $0x1,%rbx
cmp    $0x1e8480,%rbx
jne    1130 <main+0x10>
lea    0xeaa(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 2, %0 ], [ %8, %1 ]
%3 = phi i64 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 @isPrime(i64 %2)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 0, i64 %2
%7 = add i64 %6, %3
%8 = add nuw nsw i64 %2, 1
%9 = icmp eq i64 %8, 2000000
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
ret i32 0
}
/* Variables and functions */
int fabs(double);
double sigmoid(double x) { return (x / (1 + fabs(x))); }


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigmoid(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call i32 @fabs(double %4)
%6 = add nsw i32 1, %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %3, %7
ret double %8
}

LLVM IR (-O2):
define double @sigmoid(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = add nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = fdiv double %0, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int);
int main() {
  char x = '\0';
  int i = 0;
  while (i < 255) {
    printf("%c => %d\n", x, i);
    x++;
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jge    1162 <main+0x52>
mov    -0x5(%rbp),%al
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <main+0x1a>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%esi
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%c => %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = trunc i32 %2 to i8
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %3, i32 %2)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Type definitions */
struct feed_prompt {
  int dummy;
};

/* Variables and functions */
char feed_prompt_set(struct feed_prompt *const, unsigned char const *const,
                     unsigned long const, unsigned int);
char feed_prompt_set2(struct feed_prompt *const p_prompt,
                      unsigned char const *const p_data,
                      unsigned long int const i_data_length) {
  return feed_prompt_set(p_prompt, p_data, i_data_length, 1u);
}


x86 assembly (clang, -O0):
<feed_prompt_set2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <feed_prompt_set@plt>
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_prompt_set2>:
mov    $0x1,%ecx
jmp    1030 <feed_prompt_set@plt>

LLVM IR (-O0):
%struct.feed_prompt = type { i32 }
define signext i8 @feed_prompt_set2(%struct.feed_prompt* %0, i8* %1, i64 %2) {
%4 = alloca %struct.feed_prompt*
%5 = alloca i8*
%6 = alloca i64
store %struct.feed_prompt* %0, %struct.feed_prompt** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.feed_prompt*, %struct.feed_prompt** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call signext i8 @feed_prompt_set(%struct.feed_prompt* %7, i8* %8, i64 %9, i32 1)
ret i8 %10
}

LLVM IR (-O2):
%struct.feed_prompt = type { i32 }
define signext i8 @feed_prompt_set2(%struct.feed_prompt* %0, i8* %1, i64 %2) {
%4 = tail call signext i8 @feed_prompt_set(%struct.feed_prompt* %0, i8* %1, i64 %2, i32 1)
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char *, int);
void NotGoodfunc(char *str) {
  char buffer[256];
  strncat(buffer, str, sizeof(buffer) - 1);
  return;
}


x86 assembly (clang, -O0):
<NotGoodfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xff,%edx
call   1030 <strncat@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NotGoodfunc>:
sub    $0x108,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0xff,%edx
call   1030 <strncat@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define void @NotGoodfunc(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncat(i8* %4, i8* %5, i32 255)
ret void
}

LLVM IR (-O2):
define void @NotGoodfunc(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncat(i8* %3, i8* %0, i32 255)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void TimerControlLevel(uint32_t ui32Base, uint32_t ui32Timer, bool bInvert) {
  ;

  ;
  ui32Timer &= 0x00000040 | 0x00004000;
  (*((volatile uint32_t *)(ui32Base + 0x0000000C))) =
      (bInvert ? ((*((volatile uint32_t *)(ui32Base + 0x0000000C))) | ui32Timer)
               : ((*((volatile uint32_t *)(ui32Base + 0x0000000C))) &
                  ~(ui32Timer)));
}


x86 assembly (clang, -O0):
<TimerControlLevel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x4040,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1137 <TimerControlLevel+0x37>
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114c <TimerControlLevel+0x4c>
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerControlLevel>:
and    $0x4040,%esi
movslq %edi,%rax
mov    0xc(%rax),%ecx
mov    %esi,%edi
not    %edi
and    %ecx,%edi
or     %ecx,%esi
test   %edx,%edx
cmove  %edi,%esi
mov    %esi,0xc(%rax)
ret

LLVM IR (-O0):
define void @TimerControlLevel(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* %5
%8 = and i32 %7, 16448
store i32 %8, i32* %5
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = load i32, i32* %5
%18 = or i32 %16, %17
br label %28
19: ; preds = %3
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 12
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
%24 = load volatile i32, i32* %23
%25 = load i32, i32* %5
%26 = xor i32 %25, -1
%27 = and i32 %24, %26
br label %28
28: ; preds = %19, %11
%29 = phi i32 [ %18, %11 ], [ %27, %19 ]
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 12
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
store volatile i32 %29, i32* %33
ret void
}

LLVM IR (-O2):
define void @TimerControlLevel(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 16448
%5 = icmp eq i32 %2, 0
%6 = add nsw i32 %0, 12
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = xor i32 %4, -1
%11 = and i32 %9, %10
%12 = or i32 %9, %4
%13 = select i1 %5, i32 %11, i32 %12
store volatile i32 %13, i32* %8
ret void
}
int nod(int a, int b) { return (a ? nod(b % a, a) : b); }


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

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

LLVM IR (-O0):
define i32 @nod(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = srem i32 %8, %9
%11 = load i32, i32* %3
%12 = call i32 @nod(i32 %10, i32 %11)
br label %15
13: ; preds = %2
%14 = load i32, i32* %4
br label %15
15: ; preds = %13, %7
%16 = phi i32 [ %12, %7 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @nod(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %6, %4 ]
ret i32 %10
}
int iscntrl(int c) {
  return (((unsigned char)c >= 0) && ((unsigned char)c <= 31)) ||
         ((unsigned char)c == 127);
}


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
cmp    $0x0,%eax
jl     112a <iscntrl+0x2a>
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
mov    $0x1,%al
cmp    $0x1f,%ecx
mov    %al,-0x5(%rbp)
jle    1139 <iscntrl+0x39>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
cmp    $0x7f,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
movzbl %dil,%eax
cmp    $0x20,%eax
setb   %cl
cmp    $0x7f,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = icmp sle i32 %10, 31
br i1 %11, label %17, label %12
12: ; preds = %7, %1
%13 = load i32, i32* %2
%14 = trunc i32 %13 to i8
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 127
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ true, %7 ], [ %16, %12 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ult i32 %2, 32
%4 = icmp eq i32 %2, 127
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int volatile uint32_t;

/* Variables and functions */
void io_reg_write_dont_corrupt(volatile uint32_t *reg, uint32_t value,
                               uint32_t mask) {
  *reg = (*reg & (~mask)) | value;
}


x86 assembly (clang, -O0):
<io_reg_write_dont_corrupt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_reg_write_dont_corrupt>:
mov    %esi,-0x4(%rsp)
mov    %edx,-0x8(%rsp)
mov    (%rdi),%eax
mov    -0x8(%rsp),%ecx
not    %ecx
and    %eax,%ecx
or     -0x4(%rsp),%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @io_reg_write_dont_corrupt(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store volatile i32 %1, i32* %5
store volatile i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load volatile i32, i32* %7
%9 = load volatile i32, i32* %6
%10 = xor i32 %9, -1
%11 = and i32 %8, %10
%12 = load volatile i32, i32* %5
%13 = or i32 %11, %12
%14 = load i32*, i32** %4
store volatile i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @io_reg_write_dont_corrupt(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store volatile i32 %1, i32* %4
store volatile i32 %2, i32* %5
%6 = load volatile i32, i32* %0
%7 = load volatile i32, i32* %5
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
%10 = load volatile i32, i32* %4
%11 = or i32 %9, %10
store volatile i32 %11, i32* %0
ret void
}
int main() {
  int i;
  int res = 12;
  goto L1;
  for (i = 0; i < 100; i++) {
  L3:
    res = res + 1;
    goto L2;
    if (i > 100) {
    L1:
      res = 0;
      goto L3;
    }
    break;
  }
  for (i = 0; i < 10; i++) {
    if (i > 1000) {
    L2:
      res = 11;
      i = 0;
    }
    res++;
  }
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0xc(%rbp)
jmp    1125 <main+0x25>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x4d>
movl   $0x0,-0xc(%rbp)
jmp    1117 <main+0x17>
cmpl   $0xa,-0x8(%rbp)
jge    1172 <main+0x72>
cmpl   $0x3e8,-0x8(%rbp)
jle    115b <main+0x5b>
jmp    114d <main+0x4d>
movl   $0xb,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <main+0x31>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %3
br label %16
4: ; No predecessors!
store i32 0, i32* %2
br label %5
5: ; preds = %18, %4
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %21
8: ; preds = %5
br label %9
9: ; preds = %16, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %29
12: ; No predecessors!
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 100
br i1 %14, label %15, label %17
15: ; preds = %12
br label %16
16: ; preds = %15, %0
store i32 0, i32* %3
br label %9
17: ; preds = %12
br label %21
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %5
21: ; preds = %17, %5
store i32 0, i32* %2
br label %22
22: ; preds = %33, %21
%23 = load i32, i32* %2
%24 = icmp slt i32 %23, 10
br i1 %24, label %25, label %36
25: ; preds = %22
%26 = load i32, i32* %2
%27 = icmp sgt i32 %26, 1000
br i1 %27, label %28, label %30
28: ; preds = %25
br label %29
29: ; preds = %28, %9
store i32 11, i32* %3
store i32 0, i32* %2
br label %30
30: ; preds = %29, %25
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %33
33: ; preds = %30
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %22
36: ; preds = %22
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @main() {
ret i32 21
}
int ft_str_is_printable(char *str) {
  int x;
  x = 0;
  while (str[x]) {
    if ((str[x] < 31) || (str[x] == 127))
      return (0);
    x++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_str_is_printable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1165 <ft_str_is_printable+0x65>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x1f,%eax
jl     114b <ft_str_is_printable+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7f,%eax
jne    1157 <ft_str_is_printable+0x57>
movl   $0x0,-0x4(%rbp)
jmp    116c <ft_str_is_printable+0x6c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <ft_str_is_printable+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_str_is_printable>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <ft_str_is_printable+0x23>
add    $0x1,%rdi
nop
add    $0x81,%cl
cmp    $0x9f,%cl
jbe    1124 <ft_str_is_printable+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ft_str_is_printable+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_str_is_printable(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -127
%12 = icmp ult i8 %11, -96
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
const char *f_engine_website() { return "opensnc.sourceforge.net"; }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"opensnc.sourceforge.net\00"
define i8* @f_engine_website() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"opensnc.sourceforge.net\00"
define i8* @f_engine_website() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ F1(int);
void F0() {
  F1(2.1);
  F1(2);
}


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

x86 assembly (clang, -O2):
<F0>:
push   %rax
mov    $0x2,%edi
call   1030 <F1@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <F1@plt>

LLVM IR (-O0):
define void @F0() {
%1 = call i32 @F1(i32 2)
%2 = call i32 @F1(i32 2)
ret void
}

LLVM IR (-O2):
define void @F0() {
%1 = tail call i32 @F1(i32 2)
%2 = tail call i32 @F1(i32 2)
ret void
}
unsigned long _4bytesToULong(const unsigned char *_4bytes) {
  return (_4bytes[3] * 0x1000000 + _4bytes[2] * 0x10000 + _4bytes[1] * 0x100 +
          _4bytes[0]);
}


x86 assembly (clang, -O0):
<_4bytesToULong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @_4bytesToULong(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = shl nuw nsw i64 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i64
%9 = shl nuw nsw i64 %8, 16
%10 = or i64 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = shl nuw nsw i64 %13, 8
%15 = or i64 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int pipe_init(char *name) {
  int handle;
  handle = open(name, O_RDWR, 0666);
  if (handle < 0) {
    handle = 0;
    printf("Open FIFO[%s] Error\n", name);
  }
  return handle;
}


x86 assembly (clang, -O0):
<pipe_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    $0x1b6,%edx
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1167 <pipe_init+0x47>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_init>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    $0x1b6,%edx
call   1040 <open@plt>
test   %eax,%eax
js     113d <pipe_init+0x1d>
pop    %rbx
ret
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [21 x i8] c"Open FIFO[%s] Error\0A\00"
define i32 @pipe_init(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5, i32 438)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
store i32 0, i32* %3
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@.str = [21 x i8] c"Open FIFO[%s] Error\0A\00"
define i32 @pipe_init(i8* %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2, i32 438)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %1
%8 = phi i32 [ 0, %5 ], [ %3, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ input(int, ...);
int /*<<< orphan*/ output(int, ...);
main() {
  int x, y;
  input(x);
  output(x);
  input(x, y);
  output(x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <input@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <output@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <input@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1040 <output@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = call i32 (i32, ...) @input(i32 %3)
%5 = load i32, i32* %1
%6 = call i32 (i32, ...) @output(i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i32, ...) @input(i32 %7, i32 %8)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i32, ...) @output(i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) @input(i32 undef)
%2 = tail call i32 (i32, ...) @output(i32 undef)
%3 = tail call i32 (i32, ...) @input(i32 undef, i32 undef)
%4 = tail call i32 (i32, ...) @output(i32 undef, i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ create_direct(int, int);
void create_arc_b(float radius, float omega) {
  int lspeed = (int)(omega * (3.14159265359 / 180.0) * (radius - 129.0));
  int rspeed = (int)(omega * (3.14159265359 / 180.0) * (radius + 129.0));
  create_direct(rspeed, lspeed);
}


x86 assembly (clang, -O0):
<create_arc_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb8(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe83(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <create_direct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_arc_b>:
cvtss2sd %xmm1,%xmm1
mulsd  0xee4(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xee0(%rip),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
cvttsd2si %xmm2,%esi
addsd  0xed4(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <create_direct@plt>

LLVM IR (-O0):
define void @create_arc_b(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fmul double %8, 0x3F91DF46A2529E84
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fsub double %11, 1.290000e+02
%13 = fmul double %9, %12
%14 = fptosi double %13 to i32
store i32 %14, i32* %5
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = fmul double %16, 0x3F91DF46A2529E84
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = fadd double %19, 1.290000e+02
%21 = fmul double %17, %20
%22 = fptosi double %21 to i32
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = call i32 @create_direct(i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @create_arc_b(float %0, float %1) {
%3 = fpext float %1 to double
%4 = fmul double %3, 0x3F91DF46A2529E84
%5 = fpext float %0 to double
%6 = fadd double %5, -1.290000e+02
%7 = fmul double %6, %4
%8 = fptosi double %7 to i32
%9 = fadd double %5, 1.290000e+02
%10 = fmul double %9, %4
%11 = fptosi double %10 to i32
%12 = tail call i32 @create_direct(i32 %11, i32 %8)
ret void
}
void __svgalib_laguna_outatt(int index, int val) {}


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

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

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

LLVM IR (-O2):
define void @__svgalib_laguna_outatt(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int commonFunction() { printf("second sons\n"); }


x86 assembly (clang, -O0):
<commonFunction>:
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):
<commonFunction>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [12 x i8] c"second sons\00"
define i32 @commonFunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int XInit(char *, int, int);
int oz_InitProgram(char *WndTitle, int Width, int Height) {
  return XInit(WndTitle, Width, Height);
}


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

x86 assembly (clang, -O2):
<oz_InitProgram>:
jmp    1030 <XInit@plt>

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

LLVM IR (-O2):
define i32 @oz_InitProgram(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @XInit(i8* %0, i32 %1, i32 %2)
ret i32 %4
}