xunge/DecIR huggingface dataset:
/* Variables and functions */
double log10(int);
bool isPowerOfThree(int n) {
  double res = log10(n) / log10(3);
  return (res - (int)res) ? false : true;
}


x86 assembly (clang, -O0):
<isPowerOfThree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <log10@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x3,%edi
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
mov    $0x1,%eax
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
setp   %sil
setne  %dl
or     %sil,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfThree>:
sub    $0x18,%rsp
call   1030 <log10@plt>
movapd %xmm0,(%rsp)
mov    $0x3,%edi
call   1030 <log10@plt>
movapd (%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttpd2dq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @isPowerOfThree(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call double @log10(i32 %4)
%6 = call double @log10(i32 3)
%7 = fdiv double %5, %6
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fptosi double %9 to i32
%11 = sitofp i32 %10 to double
%12 = fsub double %8, %11
%13 = fcmp une double %12, 0.000000e+00
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @isPowerOfThree(i32 %0) {
%2 = tail call double @log10(i32 %0)
%3 = tail call double @log10(i32 3)
%4 = fdiv double %2, %3
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fsub double %4, %6
%8 = fcmp oeq double %7, 0.000000e+00
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void b() {
#pragma omp parallel num_threads(2)
  { puts("para_b"); }
  puts("b ended");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"para_b\00"
@.str.1 = [8 x i8] c"b ended\00"
define void @b() {
%1 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"para_b\00"
@.str.1 = [8 x i8] c"b ended\00"
define void @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float mus_big_endian_float(unsigned char *);
float mus_little_endian_float(unsigned char *);
float big_or_little_endian_float(unsigned char *n, int little) {
  if (little)
    return (mus_little_endian_float(n));
  return (mus_big_endian_float(n));
}


x86 assembly (clang, -O0):
<big_or_little_endian_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114c <big_or_little_endian_float+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <mus_little_endian_float@plt>
movss  %xmm0,-0x4(%rbp)
jmp    115a <big_or_little_endian_float+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <mus_big_endian_float@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_or_little_endian_float>:
test   %esi,%esi
je     1129 <big_or_little_endian_float+0x9>
jmp    1030 <mus_little_endian_float@plt>
jmp    1040 <mus_big_endian_float@plt>

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

LLVM IR (-O2):
define float @big_or_little_endian_float(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call float @mus_little_endian_float(i8* %0)
br label %8
6: ; preds = %2
%7 = tail call float @mus_big_endian_float(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi float [ %5, %4 ], [ %7, %6 ]
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset) {
  return NULL;
}


x86 assembly (clang, -O0):
<mmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @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
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
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mmap(i8* nocapture readnone %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i8* null
}
/* Type definitions */
struct RBTREE_TYPENAME {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RBTREE_CLEAR(struct RBTREE_TYPENAME *);
int /*<<< orphan*/ free(struct RBTREE_TYPENAME *);
void RBTREE_FREE(struct RBTREE_TYPENAME *target) {
  RBTREE_CLEAR(target);
  free(target);
}


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

x86 assembly (clang, -O2):
<RBTREE_FREE>:
push   %rbx
mov    %rdi,%rbx
call   1040 <RBTREE_CLEAR@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.RBTREE_TYPENAME = type { i32 }
define void @RBTREE_FREE(%struct.RBTREE_TYPENAME* %0) {
%2 = alloca %struct.RBTREE_TYPENAME*
store %struct.RBTREE_TYPENAME* %0, %struct.RBTREE_TYPENAME** %2
%3 = load %struct.RBTREE_TYPENAME*, %struct.RBTREE_TYPENAME** %2
%4 = call i32 @RBTREE_CLEAR(%struct.RBTREE_TYPENAME* %3)
%5 = load %struct.RBTREE_TYPENAME*, %struct.RBTREE_TYPENAME** %2
%6 = call i32 @free(%struct.RBTREE_TYPENAME* %5)
ret void
}

LLVM IR (-O2):
%struct.RBTREE_TYPENAME = type { i32 }
define void @RBTREE_FREE(%struct.RBTREE_TYPENAME* %0) {
%2 = tail call i32 @RBTREE_CLEAR(%struct.RBTREE_TYPENAME* %0)
%3 = tail call i32 @free(%struct.RBTREE_TYPENAME* %0)
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_h16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h16_10_sse4() {
ret void
}
int foo() {
  static int b;
  b = 1;
  return b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,0x2f16(%rip)
mov    0x2f10(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@foo.b = internal global i32 0
define i32 @foo() {
store i32 1, i32* @foo.b
%1 = load i32, i32* @foo.b
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 1
}
unsigned long int cast_uchar_ulong(unsigned char x) {
  return (unsigned long int)x;
}


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

x86 assembly (clang, -O2):
<cast_uchar_ulong>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i64 @cast_uchar_ulong(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_uchar_ulong(i8 zeroext %0) {
%2 = zext i8 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void fancy_abort() { fatal("Internal abort."); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Internal abort.\00"
define void @fancy_abort() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Internal abort.\00"
define void @fancy_abort() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_app();
int /*<<< orphan*/ scan_leds();
void main(void) {
  init_app();
  while (1) {
    scan_leds();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_app@plt>
mov    $0x0,%al
call   1040 <scan_leds@plt>
jmp    112b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_app@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <scan_leds@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @init_app()
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @scan_leds()
br label %2
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init_app()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @scan_leds()
br label %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int dir_exists(char *path) {
  struct stat st;
  return (stat(path, &st) >= 0 && S_ISDIR(st.st_mode));
}


x86 assembly (clang, -O0):
<dir_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jl     115d <dir_exists+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_exists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1143 <dir_exists+0x23>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @dir_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp sge i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dir_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp sgt i64 %4, -1
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ RanSetSeed(int *, int);
int /*<<< orphan*/ zigNorInit(int, double, double);
void RanNormalSetSeedZig(int *piSeed, int cSeed) {
  zigNorInit(128, 3.442619855899, 9.91256303526217e-3);
  RanSetSeed(piSeed, cSeed);
}


x86 assembly (clang, -O0):
<RanNormalSetSeedZig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x80,%edi
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
call   1030 <zigNorInit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <RanSetSeed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RanNormalSetSeedZig>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movsd  0xed0(%rip),%xmm0
movsd  0xed0(%rip),%xmm1
mov    $0x80,%edi
call   1030 <zigNorInit@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <RanSetSeed@plt>

LLVM IR (-O0):
define void @RanNormalSetSeedZig(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @zigNorInit(i32 128, double 0x400B8A7C476D2BE8, double 0x3F844D09B072AAA1)
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @RanSetSeed(i32* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @RanNormalSetSeedZig(i32* %0, i32 %1) {
%3 = tail call i32 @zigNorInit(i32 128, double 0x400B8A7C476D2BE8, double 0x3F844D09B072AAA1)
%4 = tail call i32 @RanSetSeed(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deiniterrors();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void takelispexit() {
  deiniterrors();
  exit(0);
}


x86 assembly (clang, -O0):
<takelispexit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <deiniterrors@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<takelispexit>:
push   %rax
xor    %eax,%eax
call   1030 <deiniterrors@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @takelispexit() {
%1 = call i32 (...) @deiniterrors()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @takelispexit() {
%1 = tail call i32 (...) @deiniterrors()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
void *zcalloc(void *opaque, unsigned items, unsigned size) {
  (void)opaque;
  return (void *)malloc(items * size);
}


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

x86 assembly (clang, -O2):
<zcalloc>:
mov    %esi,%edi
imul   %edx,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @zcalloc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul i32 %8, %9
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @zcalloc(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %1
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRCHORD_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 8, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRCHORD_swap>:
mov    %esi,%edx
mov    $0x8,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRCHORD_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 8, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a1();
void b(unsigned short data) {
  if (data & 0x8000)
    a1();
  data <<= 1;
  if (data & 0x8000)
    a1();
  data <<= 1;
  if (data & 0x8000)
    a1();
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1138 <b+0x28>
mov    $0x0,%al
call   1030 <a1@plt>
movzwl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     115c <b+0x4c>
mov    $0x0,%al
call   1030 <a1@plt>
movzwl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1180 <b+0x70>
mov    $0x0,%al
call   1030 <a1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rbx
mov    %edi,%ebx
test   %bx,%bx
js     112a <b+0x1a>
test   $0x4000,%ebx
jne    1139 <b+0x29>
test   $0x2000,%ebx
jne    1148 <b+0x38>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <a1@plt>
test   $0x4000,%ebx
je     1120 <b+0x10>
xor    %eax,%eax
call   1030 <a1@plt>
test   $0x2000,%ebx
je     1128 <b+0x18>
xor    %eax,%eax
pop    %rbx
jmp    1030 <a1@plt>

LLVM IR (-O0):
define void @b(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 32768
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @a1()
br label %9
9: ; preds = %7, %1
%10 = load i16, i16* %2
%11 = zext i16 %10 to i32
%12 = shl i32 %11, 1
%13 = trunc i32 %12 to i16
store i16 %13, i16* %2
%14 = load i16, i16* %2
%15 = zext i16 %14 to i32
%16 = and i32 %15, 32768
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %9
%19 = call i32 (...) @a1()
br label %20
20: ; preds = %18, %9
%21 = load i16, i16* %2
%22 = zext i16 %21 to i32
%23 = shl i32 %22, 1
%24 = trunc i32 %23 to i16
store i16 %24, i16* %2
%25 = load i16, i16* %2
%26 = zext i16 %25 to i32
%27 = and i32 %26, 32768
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %20
%30 = call i32 (...) @a1()
br label %31
31: ; preds = %29, %20
ret void
}

LLVM IR (-O2):
define void @b(i16 zeroext %0) {
%2 = icmp sgt i16 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @a1()
br label %5
5: ; preds = %3, %1
%6 = and i16 %0, 16384
%7 = icmp eq i16 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @a1()
br label %10
10: ; preds = %8, %5
%11 = and i16 %0, 8192
%12 = icmp eq i16 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @a1()
br label %15
15: ; preds = %13, %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void sig_handle2(int signum) {
  puts("signal INT received");
  exit(1);
}


x86 assembly (clang, -O0):
<sig_handle2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [20 x i8] c"signal INT received\00"
define void @sig_handle2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"signal INT received\00"
define void @sig_handle2(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ IPC_PRIVATE;
int /*<<< orphan*/ perror(char *);
int shmget(int /*<<< orphan*/, int, int);
int shmSegment(int size) {
  int shmid;
  if ((shmid = shmget(IPC_PRIVATE, sizeof(size), IPC_CREAT | 0666)) == -1) {
    perror("Fehler beim Segment erstellen");
  }
  return shmid;
}


x86 assembly (clang, -O0):
<shmSegment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
or     $0x1b6,%edx
mov    $0x4,%esi
call   1040 <shmget@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1165 <shmSegment+0x45>
lea    0xea0(%rip),%rdi
call   1030 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmSegment>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    $0x1b6,%edx
or     (%rax),%edx
mov    $0x4,%esi
call   1040 <shmget@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     114d <shmSegment+0x2d>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeac(%rip),%rdi
call   1030 <perror@plt>
jmp    1149 <shmSegment+0x29>

LLVM IR (-O0):
@IPC_PRIVATE = global i32 0
@IPC_CREAT = global i32 0
@.str = [30 x i8] c"Fehler beim Segment erstellen\00"
define i32 @shmSegment(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @IPC_PRIVATE
%5 = load i32, i32* @IPC_CREAT
%6 = or i32 %5, 438
%7 = call i32 @shmget(i32 %4, i32 4, i32 %6)
store i32 %7, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@IPC_PRIVATE = global i32 0
@IPC_CREAT = global i32 0
@.str = [30 x i8] c"Fehler beim Segment erstellen\00"
define i32 @shmSegment(i32 %0) {
%2 = load i32, i32* @IPC_PRIVATE
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 438
%5 = tail call i32 @shmget(i32 %2, i32 4, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i32 %5
}
/* Variables and functions */
float outBounce(float, int /*<<< orphan*/, float, float);
float inBounce(float t, float b, float c, float d) {
  return c - outBounce(d - t, 0, c, d) + b;
}


x86 assembly (clang, -O0):
<inBounce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
xor    %edi,%edi
call   1030 <outBounce@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
subss  %xmm1,%xmm0
addss  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inBounce>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
movaps %xmm3,%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
xor    %edi,%edi
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
call   1030 <outBounce@plt>
movss  (%rsp),%xmm1
subss  %xmm0,%xmm1
addss  0x4(%rsp),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @inBounce(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %8
%11 = load float, float* %5
%12 = fsub float %10, %11
%13 = load float, float* %7
%14 = load float, float* %8
%15 = call float @outBounce(float %12, i32 0, float %13, float %14)
%16 = fsub float %9, %15
%17 = load float, float* %6
%18 = fadd float %16, %17
ret float %18
}

LLVM IR (-O2):
define float @inBounce(float %0, float %1, float %2, float %3) {
%5 = fsub float %3, %0
%6 = tail call float @outBounce(float %5, i32 0, float %2, float %3)
%7 = fsub float %2, %6
%8 = fadd float %7, %1
ret float %8
}
int get_flag_weak(int *flag) { return __atomic_load_n(flag, 0); }


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

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

LLVM IR (-O0):
define i32 @get_flag_weak(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load atomic i32, i32* %4 monotonic
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_flag_weak(i32* nocapture %0) {
%2 = load atomic i32, i32* %0 monotonic
ret i32 %2
}
/* Type definitions */
struct lregexControlBlock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fillEndLineFieldOfUpperScopes(struct lregexControlBlock *,
                                                 unsigned long);
unsigned long getInputLineNumber();
extern void notifyRegexInputEnd(struct lregexControlBlock *lcb) {
  unsigned long endline = getInputLineNumber();
  fillEndLineFieldOfUpperScopes(lcb, endline);
}


x86 assembly (clang, -O0):
<notifyRegexInputEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getInputLineNumber@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fillEndLineFieldOfUpperScopes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notifyRegexInputEnd>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getInputLineNumber@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <fillEndLineFieldOfUpperScopes@plt>

LLVM IR (-O0):
%struct.lregexControlBlock = type { i32 }
define void @notifyRegexInputEnd(%struct.lregexControlBlock* %0) {
%2 = alloca %struct.lregexControlBlock*
%3 = alloca i64
store %struct.lregexControlBlock* %0, %struct.lregexControlBlock** %2
%4 = call i64 (...) @getInputLineNumber()
store i64 %4, i64* %3
%5 = load %struct.lregexControlBlock*, %struct.lregexControlBlock** %2
%6 = load i64, i64* %3
%7 = call i32 @fillEndLineFieldOfUpperScopes(%struct.lregexControlBlock* %5, i64 %6)
ret void
}

LLVM IR (-O2):
%struct.lregexControlBlock = type { i32 }
define void @notifyRegexInputEnd(%struct.lregexControlBlock* %0) {
%2 = tail call i64 (...) @getInputLineNumber()
%3 = tail call i32 @fillEndLineFieldOfUpperScopes(%struct.lregexControlBlock* %0, i64 %2)
ret void
}
int IntComp(const void *a, const void *b) {
  if (*(int *)a > *(int *)b)
    return (1);
  if (*(int *)a < *(int *)b)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<IntComp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <IntComp+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <IntComp+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <IntComp+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <IntComp+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntComp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @IntComp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int longitud_palabra(char *palabra) {
  int i = sizeof(char);
  char *puntero = palabra;
  while (*puntero) {
    puntero++;
  }
  return (puntero - palabra) / i;
}


x86 assembly (clang, -O0):
<longitud_palabra>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1135 <longitud_palabra+0x35>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <longitud_palabra+0x17>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<longitud_palabra>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <longitud_palabra+0x10>
ret

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

LLVM IR (-O2):
define i32 @longitud_palabra(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int euler_problem_9();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", euler_problem_9());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @euler_problem_9()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc > 1) {
    if (strcmp(argv[1], "123") == 0) {
      return 1;
    } else {
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1166 <main+0x56>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115a <main+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    116d <main+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    116d <main+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1137 <main+0x27>
push   %rax
mov    0x8(%rsi),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_selectznz(uintptr_t, uintptr_t, uintptr_t,
                                                uintptr_t);
void fiat_p384_selectznz(uint64_t out1[6], uint8_t arg1, const uint64_t arg2[6],
                         const uint64_t arg3[6]) {
  internal_fiat_p384_selectznz((uintptr_t)out1, (uintptr_t)arg1,
                               (uintptr_t)arg2, (uintptr_t)arg3);
}


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

x86 assembly (clang, -O2):
<fiat_p384_selectznz>:
jmp    1030 <internal_fiat_p384_selectznz@plt>

LLVM IR (-O0):
define void @fiat_p384_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = ptrtoint i32* %12 to i64
%14 = load i32*, i32** %8
%15 = ptrtoint i32* %14 to i64
%16 = call i32 @internal_fiat_p384_selectznz(i64 %10, i64 %11, i64 %13, i64 %15)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = ptrtoint i32* %0 to i64
%6 = ptrtoint i32* %2 to i64
%7 = ptrtoint i32* %3 to i64
%8 = tail call i32 @internal_fiat_p384_selectznz(i64 %5, i64 %1, i64 %6, i64 %7)
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode *generate_forest(char *);
int /*<<< orphan*/ print_forest(struct TreeNode *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Usage:\n\tforest DIRECTORY\n");
    return 0;
  }
  struct TreeNode *root = generate_forest(argv[1]);
  print_forest(root);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1189 <main+0x59>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <generate_forest@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <print_forest@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1149 <main+0x19>
mov    0x8(%rsi),%rdi
call   1040 <generate_forest@plt>
mov    %rax,%rdi
call   1050 <print_forest@plt>
jmp    1155 <main+0x25>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
@.str = [26 x i8] c"Usage:\0A\09forest DIRECTORY\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.TreeNode*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %18
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call %struct.TreeNode* @generate_forest(i8* %14)
store %struct.TreeNode* %15, %struct.TreeNode** %6
%16 = load %struct.TreeNode*, %struct.TreeNode** %6
%17 = call i32 @print_forest(%struct.TreeNode* %16)
store i32 0, i32* %3
br label %18
18: ; preds = %11, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
@str = [25 x i8] c"Usage:\0A\09forest DIRECTORY\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call %struct.TreeNode* @generate_forest(i8* %8)
%10 = tail call i32 @print_forest(%struct.TreeNode* %9)
br label %11
11: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ console_puts(char const *);
int puts(const char *fmt) {
  console_puts(fmt);
  console_puts("\n");
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <console_puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <console_puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1030 <console_puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <console_puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = tail call i32 @console_puts(i8* %0)
%3 = tail call i32 @console_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void clear_ndigits(unsigned char *a) {
  int i;
  for (i = 0; i < 10; i++) {
    a[i] = 0;
  }
}


x86 assembly (clang, -O0):
<clear_ndigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1133 <clear_ndigits+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clear_ndigits+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_ndigits>:
movw   $0x0,0x8(%rdi)
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @clear_ndigits(i8* nocapture writeonly %0) {
ret void
}
char *strcpy(char *dest, const char *src) {
  int i;
  for (i = 0; src[i]; i++)
    dest[i] = src[i];
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1149 <strcpy+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Variables and functions */
int swap_bits(int, int, int);
int next_greater(int n) {
  for (int i = 1; i < sizeof(int) * 8; i++) {
    int x = swap_bits(n, i, i - 1);
    if (n != x) {
      return x;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<next_greater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x20,%rax
jae    116e <next_greater+0x5e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <swap_bits@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     115b <next_greater+0x4b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <next_greater+0x65>
jmp    1160 <next_greater+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <next_greater+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_greater>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1,%esi
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rsi),%ebp
mov    %ebx,%edi
mov    %ebp,%edx
call   1030 <swap_bits@plt>
cmp    %ebx,%eax
jne    113f <next_greater+0x2f>
add    $0x2,%ebp
mov    %ebp,%esi
cmp    $0x20,%ebp
jne    1120 <next_greater+0x10>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @next_greater(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
br label %6
6: ; preds = %22, %1
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, 32
br i1 %9, label %10, label %25
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = call i32 @swap_bits(i32 %11, i32 %12, i32 %14)
store i32 %15, i32* %5
%16 = load i32, i32* %3
%17 = load i32, i32* %5
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = load i32, i32* %5
store i32 %20, i32* %2
br label %26
21: ; preds = %10
br label %22
22: ; preds = %21
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %6
25: ; preds = %6
store i32 -1, i32* %2
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @next_greater(i32 %0) {
br label %5
2: ; preds = %5
%3 = add nuw nsw i32 %6, 1
%4 = icmp eq i32 %3, 32
br i1 %4, label %10, label %5
5: ; preds = %1, %2
%6 = phi i32 [ 1, %1 ], [ %3, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @swap_bits(i32 %0, i32 %6, i32 %7)
%9 = icmp eq i32 %8, %0
br i1 %9, label %2, label %10
10: ; preds = %2, %5
%11 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void savescreen() { printf("\x1b[?47h"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?47h\00"
define void @savescreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?47h\00"
define void @savescreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *getaline_filehandle(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *getaline() { return getaline_filehandle(stdin); }


x86 assembly (clang, -O0):
<getaline>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getaline_filehandle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getaline>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getaline_filehandle@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i8* @getaline() {
%1 = load i32, i32* @stdin
%2 = call i8* @getaline_filehandle(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i8* @getaline() {
%1 = load i32, i32* @stdin
%2 = tail call i8* @getaline_filehandle(i32 %1)
ret i8* %2
}