xunge/DecIR huggingface dataset:
/* Variables and functions */
int clock();
int /*<<< orphan*/ printf(char *, int);
int main1() {
  for (;;) {
    printf("%d \n", clock());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main1+0x9>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
jmp    1129 <main1+0x9>

x86 assembly (clang, -O2):
<main1>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    1130 <main1+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main1() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @clock()
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main1() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @clock()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %1
}
void av_samples_fill_arrays() {}


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

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

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

LLVM IR (-O2):
define void @av_samples_fill_arrays() {
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int main(int argc, char **argv) {
  char buff[255];
  char c;
  int f, t;
  int x;
  while (1) {
    c = getchar();
    if ((c >= '0') && (c <= '9'))
      putchar(++c);
    else
      putchar('x');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x111(%rbp)
movsbl -0x111(%rbp),%eax
cmp    $0x30,%eax
jl     1181 <main+0x61>
movsbl -0x111(%rbp),%eax
cmp    $0x39,%eax
jg     1181 <main+0x61>
mov    -0x111(%rbp),%al
add    $0x1,%al
mov    %al,-0x111(%rbp)
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    118b <main+0x6b>
mov    $0x78,%edi
call   1030 <putchar@plt>
jmp    1139 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x78,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
lea    -0x30(%rax),%ecx
add    $0x1,%al
cmp    $0xa,%cl
movzbl %al,%eax
cmovae %ebx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [255 x i8]
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %11
11: ; preds = %2, %26
%12 = call signext i8 (...) @getchar()
store i8 %12, i8* %7
%13 = load i8, i8* %7
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 48
br i1 %15, label %16, label %24
16: ; preds = %11
%17 = load i8, i8* %7
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 57
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i8, i8* %7
%22 = add i8 %21, 1
store i8 %22, i8* %7
%23 = call i32 @putchar(i8 signext %22)
br label %26
24: ; preds = %16, %11
%25 = call i32 @putchar(i8 signext 120)
br label %26
26: ; preds = %24, %20
br label %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call signext i8 (...) @getchar()
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = add nuw nsw i8 %4, 1
%8 = select i1 %6, i8 %7, i8 120
%9 = tail call i32 @putchar(i8 signext %8)
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long get_inifile_size(char *filename) {
  FILE *fp = fopen(filename, "rb");
  fseek(fp, 0, SEEK_END);
  long length = ftell(fp);
  fclose(fp);
  return length;
}


x86 assembly (clang, -O0):
<get_inifile_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_inifile_size>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i64 @get_inifile_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %3
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
%14 = load i64, i64* %4
ret i64 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i64 @get_inifile_size(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %2, i32 0, i32 %3)
%5 = tail call i64 @ftell(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
ret i64 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265hvcc_get_bitdepth_chroma_8(const uint8_t *p) { return p[17] & 0x7; }


x86 assembly (clang, -O0):
<h265hvcc_get_bitdepth_chroma_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_get_bitdepth_chroma_8>:
mov    0x44(%rdi),%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @h265hvcc_get_bitdepth_chroma_8(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 17
%5 = load i32, i32* %4
%6 = and i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @h265hvcc_get_bitdepth_chroma_8(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 17
%3 = load i32, i32* %2
%4 = and i32 %3, 7
ret i32 %4
}
void L_guiinit() {}


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

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

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

LLVM IR (-O2):
define void @L_guiinit() {
ret void
}
void g_key_file_set_integer_list() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_set_integer_list() {
ret void
}
int do_208() { return 208; }


x86 assembly (clang, -O0):
<do_208>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_208() {
ret i32 208
}

LLVM IR (-O2):
define i32 @do_208() {
ret i32 208
}
void convint(unsigned char *result, unsigned int data) {
  result[0] = data & 0xff;
  result[1] = (data >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<convint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convint>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @convint(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @convint(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ao();
void lib_ao() { ao(); }


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

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

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

LLVM IR (-O2):
define void @lib_ao() {
%1 = tail call i32 (...) @ao()
ret void
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int __iswcntrl_ascii(wint_t c) { return ((unsigned int)c < 32u || c == 127); }


x86 assembly (clang, -O0):
<__iswcntrl_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1120 <__iswcntrl_ascii+0x20>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__iswcntrl_ascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__iswcntrl_ascii(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_mmap;
long syscall(int /*<<< orphan*/, void *, size_t, int, int, int,
             int /*<<< orphan*/);
void *gotcha_mmap(void *addr, size_t length, int prot, int flags, int fd,
                  off_t offset) {
  long result;
  result = syscall(SYS_mmap, addr, length, prot, flags, fd, offset);
  return (void *)result;
}


x86 assembly (clang, -O0):
<gotcha_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotcha_mmap>:
push   %rax
mov    %r8d,%eax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2eba(%rip),%rdi
mov    (%rdi),%edi
mov    %r9d,(%rsp)
mov    %eax,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SYS_mmap = global i32 0
define i8* @gotcha_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i32, i32* @SYS_mmap
%15 = load i8*, i8** %7
%16 = load i64, i64* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = call i64 @syscall(i32 %14, i8* %15, i64 %16, i32 %17, i32 %18, i32 %19, i32 %20)
store i64 %21, i64* %13
%22 = load i64, i64* %13
%23 = inttoptr i64 %22 to i8*
ret i8* %23
}

LLVM IR (-O2):
@SYS_mmap = global i32 0
define i8* @gotcha_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = load i32, i32* @SYS_mmap
%8 = tail call i64 @syscall(i32 %7, i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
/* Variables and functions */
double tan(double);
double tand_(double x) { return tan(x); }


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

x86 assembly (clang, -O2):
<tand_>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define double @tand_(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_number_of_standard_solutions(int *length) {
  int *a, fail;
  double *c;
  fail = _ada_use_c2phc4c(32, a, length, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_number_of_standard_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x20,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_number_of_standard_solutions>:
mov    %rdi,%rdx
mov    $0x20,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_number_of_standard_solutions(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %3
%7 = load i32*, i32** %2
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 32, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_number_of_standard_solutions(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 32, i32* undef, i32* %0, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ecef2ned_matrix(double const *, double **);
int /*<<< orphan*/ matrix_multiply(int, int, int, double *, double const *,
                                   double *);
void wgsecef2ned(const double ecef[3], const double ref_ecef[3],
                 double ned[3]) {
  double M[3][3];
  ecef2ned_matrix(ref_ecef, M);
  matrix_multiply(3, 3, 1, (double *)M, ecef, ned);
}


x86 assembly (clang, -O0):
<wgsecef2ned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <ecef2ned_matrix@plt>
lea    -0x60(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x3,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <matrix_multiply@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wgsecef2ned>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %rsi,%rdi
mov    %r15,%rsi
call   1040 <ecef2ned_matrix@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r15,%rcx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <matrix_multiply@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @wgsecef2ned(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x [3 x double]]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %5
%9 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %7, i64 0, i64 0
%10 = bitcast [3 x double]* %9 to double**
%11 = call i32 @ecef2ned_matrix(double* %8, double** %10)
%12 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %7, i64 0, i64 0
%13 = bitcast [3 x double]* %12 to double*
%14 = load double*, double** %4
%15 = load double*, double** %6
%16 = call i32 @matrix_multiply(i32 3, i32 3, i32 1, double* %13, double* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @wgsecef2ned(double* %0, double* %1, double* %2) {
%4 = alloca [3 x [3 x double]]
%5 = bitcast [3 x [3 x double]]* %4 to i8*
%6 = bitcast [3 x [3 x double]]* %4 to double**
%7 = call i32 @ecef2ned_matrix(double* %1, double** %6)
%8 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %4, i64 0, i64 0, i64 0
%9 = call i32 @matrix_multiply(i32 3, i32 3, i32 1, double* %8, double* %0, double* %2)
ret void
}
double min_colordifference_ch(const double x, const double y,
                              const double alphas) {
  const double black = x - y, white = black + alphas;
  return ((black * black) < (white * white) ? (black * black)
                                            : (white * white)) *
         2.f;
}


x86 assembly (clang, -O0):
<min_colordifference_ch>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1163 <min_colordifference_ch+0x63>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1172 <min_colordifference_ch+0x72>
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_colordifference_ch>:
subsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm2
minsd  %xmm2,%xmm0
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @min_colordifference_ch(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fsub double %9, %10
store double %11, double* %7
%12 = load double, double* %7
%13 = load double, double* %6
%14 = fadd double %12, %13
store double %14, double* %8
%15 = load double, double* %7
%16 = load double, double* %7
%17 = fmul double %15, %16
%18 = load double, double* %8
%19 = load double, double* %8
%20 = fmul double %18, %19
%21 = fcmp olt double %17, %20
br i1 %21, label %22, label %26
22: ; preds = %3
%23 = load double, double* %7
%24 = load double, double* %7
%25 = fmul double %23, %24
br label %30
26: ; preds = %3
%27 = load double, double* %8
%28 = load double, double* %8
%29 = fmul double %27, %28
br label %30
30: ; preds = %26, %22
%31 = phi double [ %25, %22 ], [ %29, %26 ]
%32 = fmul double %31, 2.000000e+00
ret double %32
}

LLVM IR (-O2):
define double @min_colordifference_ch(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fadd double %4, %2
%6 = fmul double %4, %4
%7 = fmul double %5, %5
%8 = fcmp olt double %6, %7
%9 = select i1 %8, double %6, double %7
%10 = fmul double %9, 2.000000e+00
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void main() {
  int i = 0;
  while (1) {
    int j = 0;
    for (; j < 10; j++)
      ;
    i = i + 11 - j;
    assert(i >= 0);
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1143 <main+0x33>
jmp    1135 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0xb,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xfffffffe,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
shr    $0x1f,%edi
call   1030 <assert@plt>
add    $0xffffffff,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %11
store i32 0, i32* %2
br label %4
4: ; preds = %8, %3
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 11
%14 = load i32, i32* %2
%15 = sub nsw i32 %13, %14
store i32 %15, i32* %1
%16 = load i32, i32* %1
%17 = icmp sge i32 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
br label %3
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add i32 %2, 1
%4 = sub i32 -2, %2
%5 = lshr i32 %4, 31
%6 = tail call i32 @assert(i32 %5)
br label %1
}
void f1(char a) {}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret void
}

LLVM IR (-O2):
define void @f1(i8 signext %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UINT32_C(int);
int float_as_uint(float);
float uint_as_float(int);
float kill_denormal(float f) {
  uint32_t i = float_as_uint(f);
  if (i & UINT32_C(0x7F800000))
    return f;
  else {
    return uint_as_float(i & UINT32_C(0xFF800000));
  }
}


x86 assembly (clang, -O0):
<kill_denormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <float_as_uint@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x7f800000,%edi
call   1050 <UINT32_C@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
je     1179 <kill_denormal+0x49>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1198 <kill_denormal+0x68>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0xff800000,%edi
call   1050 <UINT32_C@plt>
mov    -0x14(%rbp),%edi
and    %eax,%edi
call   1040 <uint_as_float@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_denormal>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <float_as_uint@plt>
mov    %eax,%ebx
mov    $0x7f800000,%edi
call   1050 <UINT32_C@plt>
test   %ebx,%eax
je     115c <kill_denormal+0x2c>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret
mov    $0xff800000,%edi
call   1050 <UINT32_C@plt>
and    %eax,%ebx
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <uint_as_float@plt>

LLVM IR (-O0):
define float @kill_denormal(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = load float, float* %3
%6 = call i32 @float_as_uint(float %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @UINT32_C(i32 2139095040)
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load float, float* %3
store float %12, float* %2
br label %18
13: ; preds = %1
%14 = load i32, i32* %4
%15 = call i32 @UINT32_C(i32 -8388608)
%16 = and i32 %14, %15
%17 = call float @uint_as_float(i32 %16)
store float %17, float* %2
br label %18
18: ; preds = %13, %11
%19 = load float, float* %2
ret float %19
}

LLVM IR (-O2):
define float @kill_denormal(float %0) {
%2 = tail call i32 @float_as_uint(float %0)
%3 = tail call i32 @UINT32_C(i32 2139095040)
%4 = and i32 %3, %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @UINT32_C(i32 -8388608)
%8 = and i32 %7, %2
%9 = tail call float @uint_as_float(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi float [ %9, %6 ], [ %0, %1 ]
ret float %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
char *user_name(uid_t uid) {
  struct passwd *pw;
  pw = getpwuid(uid);
  if (pw == NULL)
    return NULL;
  return pw->pw_name;
}


x86 assembly (clang, -O0):
<user_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113f <user_name+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    114a <user_name+0x3a>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_name>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1120 <user_name+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @user_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.passwd*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call %struct.passwd* @getpwuid(i32 %5)
store %struct.passwd* %6, %struct.passwd** %4
%7 = load %struct.passwd*, %struct.passwd** %4
%8 = icmp eq %struct.passwd* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %14
10: ; preds = %1
%11 = load %struct.passwd*, %struct.passwd** %4
%12 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i32 0, i32 0
%13 = load i8*, i8** %12
store i8* %13, i8** %2
br label %14
14: ; preds = %10, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @user_name(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ mix_major0(unsigned int *, unsigned int);
void enc_type_2(unsigned int *key, unsigned int seed) { mix_major0(key, seed); }


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

x86 assembly (clang, -O2):
<enc_type_2>:
jmp    1030 <mix_major0@plt>

LLVM IR (-O0):
define void @enc_type_2(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 = call i32 @mix_major0(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @enc_type_2(i32* %0, i32 %1) {
%3 = tail call i32 @mix_major0(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int hassuffix(char *name, char *suffix) {
  int nlen, slen;
  nlen = strlen(name);
  slen = strlen(suffix);
  if (slen > nlen)
    return (0);
  return (strcmp(&name[nlen - slen], suffix) == 0);
}


x86 assembly (clang, -O0):
<hassuffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1160 <hassuffix+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1187 <hassuffix+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hassuffix>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%ebp
jl     115d <hassuffix+0x3d>
movslq %ebp,%rax
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hassuffix(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %6
%10 = load i8*, i8** %5
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %27
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = sub nsw i32 %18, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %17, i64 %21
%23 = load i8*, i8** %5
%24 = call i64 @strcmp(i8* %22, i8* %23)
%25 = icmp eq i64 %24, 0
%26 = zext i1 %25 to i32
store i32 %26, i32* %3
br label %27
27: ; preds = %16, %15
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @hassuffix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = sub nsw i32 %3, %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i64 @strcmp(i8* %9, i8* %1)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %6
%14 = phi i32 [ %12, %6 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ isalnum(char);
int /*<<< orphan*/ printf(char *);
char tolower(char);
int playagain() {
  char input;
  printf("\nDo you wish to continue? (y\\n) ");
  while (!isalnum(input = getchar()))
    ;
  if (tolower(input) != 'n')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<playagain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1040 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117b <playagain+0x3b>
jmp    1180 <playagain+0x40>
jmp    1154 <playagain+0x14>
movsbl -0x5(%rbp),%edi
call   1060 <tolower@plt>
movsbl %al,%eax
cmp    $0x6e,%eax
je     11a1 <playagain+0x61>
movl   $0x1,-0x4(%rbp)
jmp    11a8 <playagain+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playagain>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1040 <isalnum@plt>
test   %eax,%eax
je     1150 <playagain+0x10>
mov    %ebx,%edi
call   1060 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x6e,%al
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0ADo you wish to continue? (y\\n) \00"
define i32 @playagain() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %9, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = call i32 @isalnum(i8 signext %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 110
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %1
br label %17
16: ; preds = %10
store i32 0, i32* %1
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0ADo you wish to continue? (y\\n) \00"
define i32 @playagain() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 @isalnum(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call signext i8 @tolower(i8 signext %3)
%8 = icmp ne i8 %7, 110
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
char *append_cmd(char *, char *);
char *close_cmd(char *cmd) {
  cmd = append_cmd(cmd, "(run)");
  cmd = append_cmd(cmd, "STOP_RUN");
  cmd = append_cmd(cmd, "(facts)");
  cmd = append_cmd(cmd, "(exit)");
  return cmd;
}


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

x86 assembly (clang, -O2):
<close_cmd>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <append_cmd@plt>
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
call   1030 <append_cmd@plt>
lea    0xedc(%rip),%rsi
mov    %rax,%rdi
call   1030 <append_cmd@plt>
lea    0xed5(%rip),%rsi
mov    %rax,%rdi
pop    %rax
jmp    1030 <append_cmd@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"(run)\00"
@.str.1 = [9 x i8] c"STOP_RUN\00"
@.str.2 = [8 x i8] c"(facts)\00"
@.str.3 = [7 x i8] c"(exit)\00"
define i8* @close_cmd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @append_cmd(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @append_cmd(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i8* @append_cmd(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = call i8* @append_cmd(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store i8* %10, i8** %2
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"(run)\00"
@.str.1 = [9 x i8] c"STOP_RUN\00"
@.str.2 = [8 x i8] c"(facts)\00"
@.str.3 = [7 x i8] c"(exit)\00"
define i8* @close_cmd(i8* %0) {
%2 = tail call i8* @append_cmd(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @append_cmd(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* @append_cmd(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i8* @append_cmd(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret i8* %5
}
/* Variables and functions */
size_t countDigits(size_t);
size_t bulklen(size_t len) { return 1 + countDigits(len) + 2 + len + 2; }


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

x86 assembly (clang, -O2):
<bulklen>:
push   %rbx
mov    %rdi,%rbx
call   1030 <countDigits@plt>
add    %rbx,%rax
add    $0x5,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @bulklen(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @countDigits(i64 %3)
%5 = add i64 1, %4
%6 = add i64 %5, 2
%7 = load i64, i64* %2
%8 = add i64 %6, %7
%9 = add i64 %8, 2
ret i64 %9
}

LLVM IR (-O2):
define i64 @bulklen(i64 %0) {
%2 = tail call i64 @countDigits(i64 %0)
%3 = add i64 %0, 5
%4 = add i64 %3, %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ cstring_free(void *);
void free_callback(void *privdata, void *val) {
  ((void)privdata);
  cstring_free(val);
}


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

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

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

LLVM IR (-O2):
define void @free_callback(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @cstring_free(i8* %1)
ret void
}
double discount(double d, double chan) { return (d * chan + 1 - d); }


x86 assembly (clang, -O0):
<discount>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xedc(%rip),%xmm1
addsd  %xmm1,%xmm0
subsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<discount>:
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @discount(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.fmuladd.f64(double %5, double %6, double 1.000000e+00)
%8 = load double, double* %3
%9 = fsub double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @discount(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double %1, double 1.000000e+00)
%4 = fsub double %3, %0
ret double %4
}
/* Type definitions */
struct task_struct {
  int dummy;
};

/* Variables and functions */
scalar_t__ __fatal_signal_pending(struct task_struct *);
scalar_t__ signal_pending(struct task_struct *);
__attribute__((always_)) int fatal_signal_pending(struct task_struct *p) {
  return signal_pending(p) && __fatal_signal_pending(p);
}


x86 assembly (clang, -O0):
<fatal_signal_pending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <signal_pending@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <fatal_signal_pending+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <__fatal_signal_pending@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal_signal_pending>:
push   %rbx
mov    %rdi,%rbx
call   1030 <signal_pending@plt>
test   %rax,%rax
je     1143 <fatal_signal_pending+0x23>
mov    %rbx,%rdi
call   1040 <__fatal_signal_pending@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.task_struct = type { i32 }
define i32 @fatal_signal_pending(%struct.task_struct* %0) {
%2 = tail call i64 @signal_pending(%struct.task_struct* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @__fatal_signal_pending(%struct.task_struct* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void gtk_notebook_get_type() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
void __ghdl_fprintf_g(FILE *stream, double val) { fprintf(stream, "%g", val); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define void @__ghdl_fprintf_g(i32* nocapture %0, double %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}
/* Type definitions */
struct process {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int get_proc_info(struct process *p, pid_t pid) { return 0; }


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

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

LLVM IR (-O0):
%struct.process = type { i32 }
define i32 @get_proc_info(%struct.process* %0, i32 %1) {
%3 = alloca %struct.process*
%4 = alloca i32
store %struct.process* %0, %struct.process** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.process = type { i32 }
define i32 @get_proc_info(%struct.process* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= 2 * n; i += 2)
    printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jg     1174 <main+0x54>
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1167 <main+0x47>
mov    $0x2,%ebx
lea    0xebb(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x2,%ebx
mov    0x4(%rsp),%eax
add    %eax,%eax
cmp    %eax,%ebx
jle    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %7, %0
ret i32 0
7: ; preds = %0, %7
%8 = phi i32 [ %10, %7 ], [ 2, %0 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = add nuw nsw i32 %8, 2
%11 = load i32, i32* %1
%12 = shl nsw i32 %11, 1
%13 = icmp sgt i32 %10, %12
br i1 %13, label %6, label %7
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t sk_atomic_add(int32_t *addr, int32_t inc) {
  int32_t value = *addr;
  *addr = value + inc;
  return value;
}


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

x86 assembly (clang, -O2):
<sk_atomic_add>:
mov    (%rdi),%rax
add    %rax,%rsi
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define i64 @sk_atomic_add(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = add nsw i64 %8, %9
%11 = load i64*, i64** %3
store i64 %10, i64* %11
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @sk_atomic_add(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
%4 = add nsw i64 %3, %1
store i64 %4, i64* %0
ret i64 %3
}