xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoSaveMolfile(int, int);
int indigoWriteFile(char const *);
__attribute__((visibility("default"))) int
indigoSaveMolfileToFile(int molecule, const char *filename) {
  int f = indigoWriteFile(filename);
  int res;
  if (f == -1)
    return -1;
  res = indigoSaveMolfile(molecule, f);
  indigoFree(f);
  return res;
}


x86 assembly (clang, -O0):
<indigoSaveMolfileToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <indigoWriteFile@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1161 <indigoSaveMolfileToFile+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <indigoSaveMolfileToFile+0x4d>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <indigoSaveMolfile@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <indigoFree@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoSaveMolfileToFile>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <indigoWriteFile@plt>
cmp    $0xffffffff,%eax
je     115a <indigoSaveMolfileToFile+0x2a>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <indigoSaveMolfile@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <indigoFree@plt>
mov    %ebp,%eax
jmp    115f <indigoSaveMolfileToFile+0x2f>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @indigoSaveMolfileToFile(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @indigoWriteFile(i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = call i32 @indigoSaveMolfile(i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = call i32 @indigoFree(i32 %17)
%19 = load i32, i32* %7
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @indigoSaveMolfileToFile(i32 %0, i8* %1) {
%3 = tail call i32 @indigoWriteFile(i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @indigoSaveMolfile(i32 %0, i32 %3)
%7 = tail call i32 @indigoFree(i32 %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %9
}
unsigned short GDT3(int idx) { return (idx << 3) | 3; }


x86 assembly (clang, -O0):
<GDT3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
or     $0x3,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GDT3>:
lea    0x3(,%rdi,8),%eax
ret

LLVM IR (-O0):
define zeroext i16 @GDT3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 3
%5 = or i32 %4, 3
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @GDT3(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = shl i16 %2, 3
%4 = or i16 %3, 3
ret i16 %4
}
/* Variables and functions */
char *malloc(int);
int main(void) {
  int i;
  char *chunk;
  while (1) {
    chunk = malloc(3000 * sizeof(*chunk));
    if (chunk == NULL) {
      return 1;
    }
    for (i = 0; i < 3000; i++) {
      chunk[i] = i;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xbb8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <main+0x33>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret
movl   $0x0,-0x8(%rbp)
cmpl   $0xbb8,-0x8(%rbp)
jge    1175 <main+0x65>
mov    -0x8(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <main+0x3a>
jmp    111f <main+0xf>

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
float prv_process_fpa_sub_real32(float a, float b) { return a - b; }


x86 assembly (clang, -O0):
<prv_process_fpa_sub_real32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_process_fpa_sub_real32>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @prv_process_fpa_sub_real32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @prv_process_fpa_sub_real32(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void z(int x) { fprintf(stderr, "%c%d\n", 'z', x); }


x86 assembly (clang, -O0):
<z>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x7a,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<z>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x7a,%edx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @z(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 122, i32 %0)
ret void
}
void finn_root_draw_text(const char *text, double x, double y) {}


x86 assembly (clang, -O0):
<finn_root_draw_text>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @finn_root_draw_text(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %4
store double %1, double* %5
store double %2, double* %6
ret void
}

LLVM IR (-O2):
define void @finn_root_draw_text(i8* nocapture %0, double %1, double %2) {
ret void
}
/* Variables and functions */
int match(char const *, char *);
int is_sym_link(const char *rawString) {
  char *regexString = "[a-zA-Z0-9] -> [/a-zA-Z]";
  return match(rawString, regexString);
}


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

x86 assembly (clang, -O2):
<is_sym_link>:
lea    0xee9(%rip),%rsi
jmp    1030 <match@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"[a-zA-Z0-9] -> [/a-zA-Z]\00"
define i32 @is_sym_link(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @match(i8* %4, i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [25 x i8] c"[a-zA-Z0-9] -> [/a-zA-Z]\00"
define i32 @is_sym_link(i8* %0) {
%2 = tail call i32 @match(i8* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
unsigned long long cpu_stats_get_value_with_pattern(char *, int /*<<< orphan*/);
unsigned long long cpu_stats_get_softirq() {
  return cpu_stats_get_value_with_pattern("softirq ", 0);
}


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

x86 assembly (clang, -O2):
<cpu_stats_get_softirq>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <cpu_stats_get_value_with_pattern@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"softirq \00"
define i64 @cpu_stats_get_softirq() {
%1 = call i64 @cpu_stats_get_value_with_pattern(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
ret i64 %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"softirq \00"
define i64 @cpu_stats_get_softirq() {
%1 = tail call i64 @cpu_stats_get_value_with_pattern(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
ret i64 %1
}
/* Variables and functions */
void *sbrk(long);
void *__morecore(long size) {
  void *result;
  result = sbrk(size);
  if (result == (void *)-1)
    return NULL;
  return result;
}


x86 assembly (clang, -O0):
<__morecore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sbrk@plt>
mov    %rax,-0x18(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x18(%rbp)
jne    1147 <__morecore+0x37>
movq   $0x0,-0x8(%rbp)
jmp    114f <__morecore+0x3f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__morecore>:
push   %rax
call   1030 <sbrk@plt>
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @__morecore(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @sbrk(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, inttoptr (i64 -1 to i8*)
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %12
10: ; preds = %1
%11 = load i8*, i8** %4
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %9
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @__morecore(i64 %0) {
%2 = tail call i8* @sbrk(i64 %0)
%3 = icmp eq i8* %2, inttoptr (i64 -1 to i8*)
%4 = select i1 %3, i8* null, i8* %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void STPhandler(int sig) {
  printf("\b\b  \b\b");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<STPhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STPhandler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\08\08 \08\08\00"
@stdout = global i32 0
define void @STPhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\08\08 \08\08\00"
@stdout = global i32 0
define void @STPhandler(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
int test_imm_B9uint32_mem(unsigned int *val) {
  return ((*val) & (0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xb9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B9uint32_mem>:
testb  $0xb9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B9uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 185
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_B9uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 185
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *dlsym(void *, char *);
void *dynlolib_GetFunctionByName(void *pLibrary, char *pszFunctionName) {
  return dlsym(pLibrary, pszFunctionName);
}


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

x86 assembly (clang, -O2):
<dynlolib_GetFunctionByName>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @dynlolib_GetFunctionByName(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 1; i <= 100; i++) {
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 101
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int sqrt(int);
int fun(int m) {
  int i, n;
  n = sqrt(m);
  for (i = 2; i <= n; i++)
    if (m % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1168 <fun+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1155 <fun+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116f <fun+0x5f>
jmp    115a <fun+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <fun+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    $0x1,%ecx
cmp    $0x2,%eax
jl     114f <fun+0x3f>
mov    %eax,%esi
neg    %esi
mov    $0x2,%edi
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     114d <fun+0x3d>
lea    (%rsi,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x1,%eax
jne    1130 <fun+0x20>
jmp    114f <fun+0x3f>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %11, label %7
4: ; preds = %7
%5 = add nuw i32 %8, 1
%6 = icmp eq i32 %8, %2
br i1 %6, label %11, label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ 2, %1 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ path_to_url(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void get_filename(char *cvspath, char *filename, char *result) {
  strcpy(result, cvspath);
  strcat(result, filename);
  path_to_url(result);
}


x86 assembly (clang, -O0):
<get_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x18(%rbp),%rdi
call   1030 <path_to_url@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rdx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <path_to_url@plt>

LLVM IR (-O0):
define void @get_filename(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 @path_to_url(i8* %13)
ret void
}

LLVM IR (-O2):
define void @get_filename(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %2, i8* %0)
%5 = tail call i32 @strcat(i8* %2, i8* %1)
%6 = tail call i32 @path_to_url(i8* %2)
ret void
}
int bitscanforward(int source) {
  int i;
  for (i = 0; i < 32; i++)
    if (source & (1 << i))
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<bitscanforward>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1150 <bitscanforward+0x50>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     113d <bitscanforward+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <bitscanforward+0x57>
jmp    1142 <bitscanforward+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <bitscanforward+0xe>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitscanforward>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
bt     %eax,%edi
jb     114b <bitscanforward+0x4b>
lea    0x1(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jb     1144 <bitscanforward+0x44>
lea    0x2(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jb     1148 <bitscanforward+0x48>
lea    0x3(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jb     114c <bitscanforward+0x4c>
add    $0x4,%eax
cmp    $0x20,%eax
jne    1110 <bitscanforward+0x10>
mov    $0xffffffff,%eax
ret
add    $0x1,%eax
ret
add    $0x2,%eax
ret
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @bitscanforward(i32 %0) {
br label %2
2: ; preds = %22, %1
%3 = phi i32 [ 0, %1 ], [ %23, %22 ]
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %2
%8 = or i32 %3, 1
%9 = shl nuw i32 1, %8
%10 = and i32 %9, %0
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %7
%13 = or i32 %3, 2
%14 = shl nuw i32 1, %13
%15 = and i32 %14, %0
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %12
%18 = or i32 %3, 3
%19 = shl nuw i32 1, %18
%20 = and i32 %19, %0
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = add nuw nsw i32 %3, 4
%24 = icmp eq i32 %23, 32
br i1 %24, label %25, label %2
25: ; preds = %22, %17, %12, %7, %2
%26 = phi i32 [ %3, %2 ], [ %8, %7 ], [ %13, %12 ], [ %18, %17 ], [ -1, %22 ]
ret i32 %26
}
/* Variables and functions */
long double fabs(long double);
long double fabsl(long double a1) { return fabs(a1); }


x86 assembly (clang, -O0):
<fabsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <fabs@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsl>:
fldt   0x8(%rsp)
fabs
ret

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

LLVM IR (-O2):
define x86_fp80 @fabsl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fabs.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
scalar_t__ ask_about_save();
int /*<<< orphan*/ quit();
void ask_about_save_and_quit(void) {
  if (ask_about_save())
    quit();
}


x86 assembly (clang, -O0):
<ask_about_save_and_quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ask_about_save@plt>
cmp    $0x0,%rax
je     113c <ask_about_save_and_quit+0x1c>
mov    $0x0,%al
call   1030 <quit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_about_save_and_quit>:
push   %rax
xor    %eax,%eax
call   1040 <ask_about_save@plt>
test   %rax,%rax
je     1135 <ask_about_save_and_quit+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <quit@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ask_about_save_and_quit() {
%1 = call i64 (...) @ask_about_save()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @quit()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @ask_about_save_and_quit() {
%1 = tail call i64 (...) @ask_about_save()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @quit()
br label %5
5: ; preds = %3, %0
ret void
}
int set_hw_offset(struct ssp_data *data) { return 0; }


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

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

LLVM IR (-O0):
%struct.ssp_data = type opaque
define i32 @set_hw_offset(%struct.ssp_data* %0) {
%2 = alloca %struct.ssp_data*
store %struct.ssp_data* %0, %struct.ssp_data** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @set_hw_offset(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
void benchSVML256_SPTrig() {}


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

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

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

LLVM IR (-O2):
define void @benchSVML256_SPTrig() {
ret void
}
int guppy_misc_post_setup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @guppy_misc_post_setup() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ driver_cleanup(int /*<<< orphan*/);
void FS460_cleanup(void) { driver_cleanup(0); }


x86 assembly (clang, -O0):
<FS460_cleanup>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <driver_cleanup@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @FS460_cleanup() {
%1 = call i32 @driver_cleanup(i32 0)
ret void
}

LLVM IR (-O2):
define void @FS460_cleanup() {
%1 = tail call i32 @driver_cleanup(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_all_lsda();
void lsdafreeall() { free_all_lsda(); }


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

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

LLVM IR (-O0):
define void @lsdafreeall() {
%1 = call i32 (...) @free_all_lsda()
ret void
}

LLVM IR (-O2):
define void @lsdafreeall() {
%1 = tail call i32 (...) @free_all_lsda()
ret void
}
void task_cpu(int x, char y, int z) {
#pragma starpu wait
}


x86 assembly (clang, -O0):
<task_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @task_cpu(i32 %0, i8 signext %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
store i32 %0, i32* %4
store i8 %1, i8* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @task_cpu(i32 %0, i8 signext %1, i32 %2) {
ret void
}
int Bematech_FI_Autenticacao(Retorno) {
  char Var[3];
  return Formata("\x1b|16|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_Autenticacao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x7(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_Autenticacao>:
push   %rax
mov    %edi,%edx
lea    0xee6(%rip),%rdi
lea    0x5(%rsp),%rsi
xor    %eax,%eax
call   1030 <Formata@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|16|\1B\00"
define i32 @Bematech_FI_Autenticacao(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|16|\1B\00"
define i32 @Bematech_FI_Autenticacao(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %0)
ret i32 %4
}
void test_44_1(short *mem) { __atomic_fetch_nand(mem, -1, 4); }


x86 assembly (clang, -O0):
<test_44_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0xffff,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x28(%rbp)
and    %esi,%edx
mov    %edx,-0x24(%rbp)
not    %edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1162 <test_44_1+0x62>
jmp    1125 <test_44_1+0x25>
mov    -0x1a(%rbp),%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_44_1>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
not    %ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <test_44_1+0x10>
ret

LLVM IR (-O0):
define void @test_44_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 -1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw nand i16* %5, i16 %6 acq_rel
store i16 %7, i16* %4
%8 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test_44_1(i16* nocapture %0) {
%2 = atomicrmw nand i16* %0, i16 -1 acq_rel
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ console_puts(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void console_cur_right(int n) {
  char buf[32] = "\033[C";
  if (n)
    snprintf(buf, sizeof(buf), "\033[%dC", n);
  console_puts(buf);
}


x86 assembly (clang, -O0):
<console_cur_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1179 <console_cur_right+0x59>
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x20,%esi
lea    0xeac(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <console_puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_cur_right>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
test   %edi,%edi
je     1155 <console_cur_right+0x35>
mov    %edi,%ecx
lea    0xed8(%rip),%rdx
mov    %rsp,%rdi
mov    $0x20,%esi
call   1040 <snprintf@plt>
mov    %rsp,%rdi
call   1030 <console_puts@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.console_cur_right.buf = [32 x i8] c"\1B[C\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [6 x i8] c"\1B[%dC\00"
define void @console_cur_right(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i8]
store i32 %0, i32* %2
%4 = bitcast [32 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @snprintf(i8* %8, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%13 = call i32 @console_puts(i8* %12)
ret void
}

LLVM IR (-O2):
@__const.console_cur_right.buf = [32 x i8] c"\1B[C\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [6 x i8] c"\1B[%dC\00"
define void @console_cur_right(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @snprintf(i8* %3, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %1
%8 = call i32 @console_puts(i8* %3)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ cli_addr;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int accept_connection(int listen_socket) {
  struct sockaddr_in cli_addr;
  socklen_t clilen = sizeof(cli_addr);
  if (listen_socket == -1) {
    return -1;
  }
  return accept(listen_socket, (struct sockaddr *)&cli_addr, &clilen);
}


x86 assembly (clang, -O0):
<accept_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1138 <accept_connection+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <accept_connection+0x3b>
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_connection>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
cmp    $0xffffffff,%edi
je     1135 <accept_connection+0x25>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <accept@plt>
add    $0x18,%rsp
ret
mov    $0xffffffff,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @accept_connection(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%12 = call i32 @accept(i32 %10, %struct.sockaddr* %11, i32* %5)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @accept_connection(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = icmp eq i32 %0, -1
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%9 = call i32 @accept(i32 %0, %struct.sockaddr* %8, i32* %3)
br label %10
10: ; preds = %1, %7
%11 = phi i32 [ %9, %7 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ write_stderr(char *);
void warn_file(char *s) {
  write_stderr("error while processing file '");
  write_stderr(s);
  write_stderr("'\n");
}


x86 assembly (clang, -O0):
<warn_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <write_stderr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <write_stderr@plt>
lea    0xee6(%rip),%rdi
call   1030 <write_stderr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <write_stderr@plt>
mov    %rbx,%rdi
call   1030 <write_stderr@plt>
lea    0xeef(%rip),%rdi
pop    %rbx
jmp    1030 <write_stderr@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"error while processing file '\00"
@.str.1 = [3 x i8] c"'\0A\00"
define void @warn_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write_stderr(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @write_stderr(i8* %4)
%6 = call i32 @write_stderr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"error while processing file '\00"
@.str.1 = [3 x i8] c"'\0A\00"
define void @warn_file(i8* %0) {
%2 = tail call i32 @write_stderr(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write_stderr(i8* %0)
%4 = tail call i32 @write_stderr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int *toArray(int a) {
  int s[8];
  int i;
  for (i = 0; a; i++) {
    s[i] = a % 10;
    a = a / 10;
  }
  return &s;
}


x86 assembly (clang, -O0):
<toArray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1147 <toArray+0x47>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq -0x34(%rbp),%rax
mov    %edx,-0x30(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    110e <toArray+0xe>
lea    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toArray>:
test   %edi,%edi
je     113f <toArray+0x3f>
lea    -0x28(%rsp),%rax
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
mov    %esi,(%rax)
add    $0x9,%ecx
add    $0x4,%rax
cmp    $0x12,%ecx
ja     1110 <toArray+0x10>
lea    -0x28(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @toArray(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = icmp eq i32 %0, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %11, %5 ], [ 0, %1 ]
%7 = phi i32 [ %10, %5 ], [ %0, %1 ]
%8 = srem i32 %7, 10
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %6
store i32 %8, i32* %9
%10 = sdiv i32 %7, 10
%11 = add nuw i64 %6, 1
%12 = add i32 %7, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
ret i32* %15
}
void f4(unsigned short a) {}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f4(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
ret void
}

LLVM IR (-O2):
define void @f4(i16 zeroext %0) {
ret void
}
int base_digits(num, base) { return (int)(1 + floor(log(num) / log(base))); }


x86 assembly (clang, -O0):
<base_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <floor@plt>
movaps %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_digits>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
cvtsi2sd %edi,%xmm0
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <floor@plt>
addsd  0xea3(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @base_digits(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 = sitofp i32 %5 to double
%7 = call double @log(double %6)
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = call double @log(double %9)
%11 = fdiv double %7, %10
%12 = call double @llvm.floor.f64(double %11)
%13 = fadd double 1.000000e+00, %12
%14 = fptosi double %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @base_digits(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = tail call double @log(double %3)
%5 = sitofp i32 %1 to double
%6 = tail call double @log(double %5)
%7 = fdiv double %4, %6
%8 = tail call double @llvm.floor.f64(double %7)
%9 = fadd double %8, 1.000000e+00
%10 = fptosi double %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void partial_save_error() {
  fputs("Some (but not all) terminal setting changes were not correctly"
        " saved",
        stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<partial_save_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<partial_save_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [69 x i8] c"Some (but not all) terminal setting changes were not correctly saved\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @partial_save_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [69 x i8] c"Some (but not all) terminal setting changes were not correctly saved\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @partial_save_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void g_free(void *ptr) {
  if (ptr != 0) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<g_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <g_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @g_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int DRV_SDMMC_GET_STATUS(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_SDMMC_GET_STATUS() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ closelog_intern(int /*<<< orphan*/);
void sigpipe_handler(__attribute__((unused)) int sig) { closelog_intern(0); }


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

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

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

LLVM IR (-O2):
define void @sigpipe_handler(i32 %0) {
%2 = tail call i32 @closelog_intern(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
void RDA_pin_to_high(int fd) {
  int bt_on_off = 1;
  ioctl(fd, _IO(234, 102), &bt_on_off);
}


x86 assembly (clang, -O0):
<RDA_pin_to_high>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xea,%edi
mov    $0x66,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
lea    -0x8(%rbp),%rdx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RDA_pin_to_high>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x1,0xc(%rsp)
mov    $0xea,%edi
mov    $0x66,%esi
call   1030 <_IO@plt>
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @RDA_pin_to_high(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @_IO(i32 234, i32 102)
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
ret void
}

LLVM IR (-O2):
define void @RDA_pin_to_high(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = tail call i32 @_IO(i32 234, i32 102)
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
ret void
}
void gtk_tree_selection_get_mode() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_selection_get_mode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ loadModule(char *);
void loadSpiModules() {
  loadModule("spidev");
  loadModule("spi_bcm2708");
}


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

x86 assembly (clang, -O2):
<loadSpiModules>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <loadModule@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <loadModule@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"spidev\00"
@.str.1 = [12 x i8] c"spi_bcm2708\00"
define void @loadSpiModules() {
%1 = call i32 @loadModule(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @loadModule(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"spidev\00"
@.str.1 = [12 x i8] c"spi_bcm2708\00"
define void @loadSpiModules() {
%1 = tail call i32 @loadModule(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @loadModule(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}