xunge/DecIR huggingface dataset:
/* Variables and functions */
int registerDeregisterRun(char const *, char *, int);
int registerDeregister(const char *argv0, bool reg) {
  int ec, rv = 0;
  if ((ec = registerDeregisterRun(argv0, "64", reg)))
    rv = ec;
  if ((ec = registerDeregisterRun(argv0, "32", reg)))
    rv = ec;
  return rv;
}


x86 assembly (clang, -O0):
<registerDeregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xecc(%rip),%rsi
call   1030 <registerDeregisterRun@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     114b <registerDeregister+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeaa(%rip),%rsi
call   1030 <registerDeregisterRun@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1170 <registerDeregister+0x60>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<registerDeregister>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xee0(%rip),%rsi
mov    %ebp,%edx
call   1030 <registerDeregisterRun@plt>
mov    %eax,%r14d
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1030 <registerDeregisterRun@plt>
test   %eax,%eax
cmove  %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"64\00"
@.str.1 = [3 x i8] c"32\00"
define i32 @registerDeregister(i8* %0, i32 %1) {
%3 = tail call i32 @registerDeregisterRun(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @registerDeregisterRun(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 %3, i32 %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ lirerr(int);
void split_two(void) { lirerr(999998); }


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

x86 assembly (clang, -O2):
<split_two>:
mov    $0xf423e,%edi
jmp    1030 <lirerr@plt>

LLVM IR (-O0):
define void @split_two() {
%1 = call i32 @lirerr(i32 999998)
ret void
}

LLVM IR (-O2):
define void @split_two() {
%1 = tail call i32 @lirerr(i32 999998)
ret void
}
/* Variables and functions */
scalar_t__ fabsl(long double);
int /*<<< orphan*/ link_failure_fabsl();
void test_fabsl(long double ld) {
  if (fabsl(ld) != fabsl(ld))
    link_failure_fabsl();
}


x86 assembly (clang, -O0):
<test_fabsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <fabsl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <fabsl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_fabsl+0x43>
mov    $0x0,%al
call   1040 <link_failure_fabsl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fabsl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <fabsl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <fabsl@plt>
cmp    %rax,%rbx
jne    1151 <test_fabsl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_fabsl@plt>

LLVM IR (-O0):
define void @test_fabsl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @fabsl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @fabsl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_fabsl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_fabsl(x86_fp80 %0) {
%2 = tail call i64 @fabsl(x86_fp80 %0)
%3 = tail call i64 @fabsl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_fabsl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *MemRealloc(void *old, size_t size) {
  void *p;
  p = realloc(old, size);
  if (!p) {
    fprintf(stderr, "***** Out of memory! *****\n");
    return NULL;
  }
  return p;
}


x86 assembly (clang, -O0):
<MemRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116e <MemRealloc+0x4e>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1176 <MemRealloc+0x56>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemRealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <MemRealloc+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"***** Out of memory! *****\0A\00"
define i8* @MemRealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"***** Out of memory! *****\0A\00"
define noalias i8* @MemRealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret i8* %3
}
char *strcpy(char *dest, const char *src) {
  do {
    *dest++ = *src;
  } while (*src++ != '\0');
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
add    $0x1,%rax
cmpb   $0x0,(%rsi)
lea    0x1(%rsi),%rsi
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %7
}
/* Variables and functions */
void Default_DebugMon_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_DebugMon_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_DebugMon_Handler+0x9>
jmp    1109 <Default_DebugMon_Handler+0x9>

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

LLVM IR (-O0):
define void @Default_DebugMon_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_DebugMon_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ W_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int errno;
int write_permission_p(const char *filename) {
  if (access(filename, W_OK) == 0)
    return (0);
  return (errno);
}


x86 assembly (clang, -O0):
<write_permission_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1144 <write_permission_p+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1150 <write_permission_p+0x40>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_permission_p>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1132 <write_permission_p+0x22>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@W_OK = global i32 0
@errno = global i32 0
define i32 @write_permission_p(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @W_OK
%6 = call i64 @access(i8* %4, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* @errno
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@W_OK = global i32 0
@errno = global i32 0
define i32 @write_permission_p(i8* nocapture %0) {
%2 = load i32, i32* @W_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* @errno
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ io_read_004x(int);
void io_read_0041() { io_read_004x(1); }


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

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

LLVM IR (-O0):
define void @io_read_0041() {
%1 = call i32 @io_read_004x(i32 1)
ret void
}

LLVM IR (-O2):
define void @io_read_0041() {
%1 = tail call i32 @io_read_004x(i32 1)
ret void
}
/* Variables and functions */
double atan(double);
double qATan(double a) { return atan(a); }


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

x86 assembly (clang, -O2):
<qATan>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define double @qATan(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
/* Variables and functions */
int random();
long casual(long inf, long sup) {
  double value;
  value = ((double)(random() & 0x7fffffff)) / (0x7fffffff * 1.0);
  return (inf + (sup - inf) * value);
}


x86 assembly (clang, -O0):
<casual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0x7fffffff,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<casual>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <random@plt>
and    $0x7fffffff,%eax
cvtsi2sd %eax,%xmm0
divsd  0xece(%rip),%xmm0
cvtsi2sd %r14,%xmm1
sub    %r14,%rbx
cvtsi2sd %rbx,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @casual(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = call i32 (...) @random()
%7 = and i32 %6, 2147483647
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 0x41DFFFFFFFC00000
store double %9, double* %5
%10 = load i64, i64* %3
%11 = sitofp i64 %10 to double
%12 = load i64, i64* %4
%13 = load i64, i64* %3
%14 = sub nsw i64 %12, %13
%15 = sitofp i64 %14 to double
%16 = load double, double* %5
%17 = call double @llvm.fmuladd.f64(double %15, double %16, double %11)
%18 = fptosi double %17 to i64
ret i64 %18
}

LLVM IR (-O2):
define i64 @casual(i64 %0, i64 %1) {
%3 = tail call i32 (...) @random()
%4 = and i32 %3, 2147483647
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 0x41DFFFFFFFC00000
%7 = sitofp i64 %0 to double
%8 = sub nsw i64 %1, %0
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double %6, double %7)
%11 = fptosi double %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ _log(int /*<<< orphan*/);
int /*<<< orphan*/ bformat(char *, char const *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void block_permanent(const char *message) {
  printf("E553 sorry, %s (#5.7.1)\n", message);
  _log(bformat("blocked with: %s", message));
  exit(0);
}


x86 assembly (clang, -O0):
<block_permanent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1050 <bformat@plt>
mov    %eax,%edi
call   1030 <_log@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<block_permanent>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1050 <bformat@plt>
mov    %eax,%edi
call   1030 <_log@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"E553 sorry, %s (.7.1)\0A\00"
@.str.1 = [17 x i8] c"blocked with: %s\00"
define void @block_permanent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @bformat(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @_log(i32 %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"E553 sorry, %s (.7.1)\0A\00"
@.str.1 = [17 x i8] c"blocked with: %s\00"
define void @block_permanent(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @bformat(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @_log(i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
pid_t getpid(void) {
  ;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @getpid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getpid() {
ret i32 1
}
/* Variables and functions */
scalar_t__ isprint(int);
int isgraph(int c) { return (isprint(c) && c != ' '); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     113f <isgraph+0x2f>
cmpl   $0x20,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
push   %rbx
mov    %edi,%ebx
call   1030 <isprint@plt>
test   %rax,%rax
setne  %al
cmp    $0x20,%ebx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp ne i32 %0, 32
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void VisualizarMatriz(int m[], int n) {
  int i = 0;
  for (i = 0; i < n; i++)
    printf("%d ", m[i]);
}


x86 assembly (clang, -O0):
<VisualizarMatriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <VisualizarMatriz+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <VisualizarMatriz+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VisualizarMatriz>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <VisualizarMatriz+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <VisualizarMatriz+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @VisualizarMatriz(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
void heap_cancel(void *, size_t *, size_t, int /*<<< orphan*/,
                 int (*)(void *, void *), void (*)(void *, size_t));
void heap_take(void *array, size_t *size, size_t elemsize,
               int (*compare)(void *a, void *b),
               void (*update)(void *array, size_t pos)) {
  return heap_cancel(array, size, elemsize, 0, compare, update);
}


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

x86 assembly (clang, -O2):
<heap_take>:
mov    %r8,%r9
mov    %rcx,%r8
xor    %ecx,%ecx
jmp    1030 <heap_cancel@plt>

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

LLVM IR (-O2):
define void @heap_take(i8* %0, i64* %1, i64 %2, i32 (i8*, i8*)* %3, void (i8*, i64)* %4) {
tail call void @heap_cancel(i8* %0, i64* %1, i64 %2, i32 0, i32 (i8*, i8*)* %3, void (i8*, i64)* %4)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int create_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(152, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<create_homotopy>:
mov    $0x98,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @create_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 152, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @create_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 152, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void __sulong_fp80_add(long double *out, long double *x, long double *y) {
  *out = *x + *y;
}


x86 assembly (clang, -O0):
<__sulong_fp80_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
fldt   (%rax)
mov    -0x18(%rbp),%rax
fldt   (%rax)
faddp  %st,%st(1)
mov    -0x8(%rbp),%rax
fstpt  (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_fp80_add>:
fldt   (%rsi)
fldt   (%rdx)
faddp  %st,%st(1)
fstpt  (%rdi)
ret

LLVM IR (-O0):
define void @__sulong_fp80_add(x86_fp80* %0, x86_fp80* %1, x86_fp80* %2) {
%4 = alloca x86_fp80*
%5 = alloca x86_fp80*
%6 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %4
store x86_fp80* %1, x86_fp80** %5
store x86_fp80* %2, x86_fp80** %6
%7 = load x86_fp80*, x86_fp80** %5
%8 = load x86_fp80, x86_fp80* %7
%9 = load x86_fp80*, x86_fp80** %6
%10 = load x86_fp80, x86_fp80* %9
%11 = fadd x86_fp80 %8, %10
%12 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %11, x86_fp80* %12
ret void
}

LLVM IR (-O2):
define void @__sulong_fp80_add(x86_fp80* nocapture writeonly %0, x86_fp80* nocapture %1, x86_fp80* nocapture %2) {
%4 = load x86_fp80, x86_fp80* %1
%5 = load x86_fp80, x86_fp80* %2
%6 = fadd x86_fp80 %4, %5
store x86_fp80 %6, x86_fp80* %0
ret void
}
int stlong(val, p)
register long val;
register char *p;
{
  int i;
  p += 32 / 8;
  for (i = 0; i < 32 / 8; i++)
    *--p = (val >> 8 * i) & 255;
  return (0);
}


x86 assembly (clang, -O0):
<stlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1160 <stlong+0x60>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
sar    %cl,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111f <stlong+0x1f>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stlong>:
bswap  %edi
mov    %edi,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stlong(i64 %0, i8* nocapture writeonly %1) {
%3 = trunc i64 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %3, i8* %4
%5 = lshr i64 %0, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %6, i8* %7
%8 = lshr i64 %0, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %9, i8* %10
%11 = lshr i64 %0, 24
%12 = trunc i64 %11 to i8
store i8 %12, i8* %1
ret i32 0
}
void XkbGetNames() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetNames() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strdup(char *);
char *find_savage_game(char *gametype) {
  if (0 == strcmp("RTSS", gametype)) {
    return strdup("RTSS");
  } else {
    return strdup("Unknown");
  }
}


x86 assembly (clang, -O0):
<find_savage_game>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    115f <find_savage_game+0x3f>
lea    0xeaf(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    116f <find_savage_game+0x4f>
lea    0xe9f(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_savage_game>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1142 <find_savage_game+0x22>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <strdup@plt>
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1040 <strdup@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"RTSS\00"
@.str.1 = [8 x i8] c"Unknown\00"
define i8* @find_savage_game(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i64 0, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %2
br label %11
9: ; preds = %1
%10 = call i8* @strdup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i8* %10, i8** %2
br label %11
11: ; preds = %9, %7
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"RTSS\00"
@.str.1 = [8 x i8] c"Unknown\00"
define noalias i8* @find_savage_game(i8* %0) {
%2 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call dereferenceable_or_null(8) i8* @strdup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
ret i8* %9
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t reverseBits_fun_int16_t(int16_t x) {
  int16_t r = x;
  int i = 15;
  for (x = x >> 1 & 0x7fff; x; x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x7fff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <reverseBits_fun_int16_t+0x54>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <reverseBits_fun_int16_t+0x22>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_int16_t>:
mov    %edi,%eax
mov    %edi,%edx
shr    %edx
mov    $0xf,%ecx
and    $0x7fff,%edx
je     1134 <reverseBits_fun_int16_t+0x34>
mov    %edx,%esi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edx,%edi
and    $0x1,%edi
lea    (%rdi,%rax,2),%eax
add    $0xffffffff,%ecx
shr    %esi
cmp    $0x1,%edx
mov    %esi,%edx
ja     1120 <reverseBits_fun_int16_t+0x20>
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @reverseBits_fun_int16_t(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 32767
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %12, %5 ], [ 15, %1 ]
%7 = phi i32 [ %11, %5 ], [ %0, %1 ]
%8 = phi i32 [ %13, %5 ], [ %3, %1 ]
%9 = shl i32 %7, 1
%10 = and i32 %8, 1
%11 = or i32 %9, %10
%12 = add nsw i32 %6, -1
%13 = lshr i32 %8, 1
%14 = icmp ult i32 %8, 2
br i1 %14, label %15, label %5
15: ; preds = %5, %1
%16 = phi i32 [ %0, %1 ], [ %11, %5 ]
%17 = phi i32 [ 15, %1 ], [ %12, %5 ]
%18 = shl i32 %16, %17
ret i32 %18
}
int jsw_cmp_ulong(const void *a, const void *b) {
  const unsigned long *ua = a;
  const unsigned long *ub = b;
  return ((*ua) < (*ub) ? -1 : (*ua) > (*ub));
}


x86 assembly (clang, -O0):
<jsw_cmp_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
jae    113d <jsw_cmp_ulong+0x3d>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <jsw_cmp_ulong+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsw_cmp_ulong>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @jsw_cmp_ulong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
%8 = icmp ugt i64 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ forward();
int /*<<< orphan*/ linear_distance_mm(unsigned int);
void forward_mm(unsigned int DistanceInMM) {
  forward();
  linear_distance_mm(DistanceInMM);
}


x86 assembly (clang, -O0):
<forward_mm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <forward@plt>
mov    -0x4(%rbp),%edi
call   1040 <linear_distance_mm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forward_mm>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <forward@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <linear_distance_mm@plt>

LLVM IR (-O0):
define void @forward_mm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @forward()
%4 = load i32, i32* %2
%5 = call i32 @linear_distance_mm(i32 %4)
ret void
}

LLVM IR (-O2):
define void @forward_mm(i32 %0) {
%2 = tail call i32 (...) @forward()
%3 = tail call i32 @linear_distance_mm(i32 %0)
ret void
}
/* Variables and functions */
int isatty(int);
__attribute__((__weak__, __always___)) int softboundcets_isatty(int desc) {
  return isatty(desc);
}


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

x86 assembly (clang, -O2):
<softboundcets_isatty>:
jmp    1030 <isatty@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_isatty(i32 %0) {
%2 = tail call i32 @isatty(i32 %0)
ret i32 %2
}
int test_imm_25uint8_reg(unsigned char val) {
  return ((val) & (0x25 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_25uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x25,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_25uint8_reg>:
test   $0x25,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_25uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 37
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t high_size_bit(int);
size_t splitvexists_bit_LaceKVE_size() { return high_size_bit(1); }


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

x86 assembly (clang, -O2):
<splitvexists_bit_LaceKVE_size>:
mov    $0x1,%edi
jmp    1030 <high_size_bit@plt>

LLVM IR (-O0):
define i64 @splitvexists_bit_LaceKVE_size() {
%1 = call i64 @high_size_bit(i32 1)
ret i64 %1
}

LLVM IR (-O2):
define i64 @splitvexists_bit_LaceKVE_size() {
%1 = tail call i64 @high_size_bit(i32 1)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ch, a;
  int alph;
  scanf("%c", &ch);
  alph = 'a' + 'z';
  a = alph - ch;
  printf("\n%c", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed2(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0xdb,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
lea    0xeae(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"\0A%c\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
store i32 219, i32* %3
%5 = load i32, i32* %3
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %5, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
%10 = load i8, i8* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"\0A%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
char *outnum(char *p, int n) {
  if (n >= 10)
    p = outnum(p, n / 10);
  *p++ = (char)(n % 10 + '0');
  return p;
}


x86 assembly (clang, -O0):
<outnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jl     1143 <outnum+0x33>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <outnum@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outnum>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rax
cmp    $0xa,%esi
jl     1132 <outnum+0x22>
mov    %ebx,%ecx
mov    $0xcccccccd,%esi
imul   %rcx,%rsi
shr    $0x23,%rsi
mov    %rax,%rdi
call   1030 <outnum@plt>
movslq %ebx,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%ebx
add    $0x30,%bl
mov    %bl,(%rax)
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @outnum(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 = icmp sge i32 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 10
%11 = call i8* @outnum(i8* %8, i32 %10)
store i8* %11, i8** %3
br label %12
12: ; preds = %7, %2
%13 = load i32, i32* %4
%14 = srem i32 %13, 10
%15 = add nsw i32 %14, 48
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
store i8 %16, i8* %17
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @outnum(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 9
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = udiv i32 %1, 10
%6 = tail call i8* @outnum(i8* %0, i32 %5)
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ %0, %2 ]
%9 = srem i32 %1, 10
%10 = trunc i32 %9 to i8
%11 = add nsw i8 %10, 48
%12 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %11, i8* %8
ret i8* %12
}
void sprintf_putch(int ch, void **data) {
  char **pstr = (char **)data;
  **pstr = ch;
  (*pstr)++;
}


x86 assembly (clang, -O0):
<sprintf_putch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprintf_putch>:
mov    (%rsi),%rax
mov    %dil,(%rax)
addq   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @sprintf_putch(i32 %0, i8** nocapture %1) {
%3 = trunc i32 %0 to i8
%4 = load i8*, i8** %1
store i8 %3, i8* %4
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %1
ret void
}
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }


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

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

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
void clts() { __asm volatile("clts"); }


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

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

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

LLVM IR (-O2):
define void @clts() {
tail call void asm sideeffect "clts", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *pname) {
  fprintf(stderr, "Usage: %s chmfile outdir\n", pname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: %s chmfile outdir\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ uvarint_decode64(int /*<<< orphan*/ *, int,
                                    int /*<<< orphan*/ *);
uint64_t *Varint_To_Num_64(uint8_t TON64INPUT[60]) {
  static uint64_t varintdecode_001 = 0;
  uvarint_decode64(TON64INPUT, 60, &varintdecode_001);
  return &varintdecode_001;
}


x86 assembly (clang, -O0):
<Varint_To_Num_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3c,%esi
lea    0x2f00(%rip),%rdx
call   1030 <uvarint_decode64@plt>
lea    0x2ef4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Varint_To_Num_64>:
push   %rbx
lea    0x2f14(%rip),%rbx
mov    $0x3c,%esi
mov    %rbx,%rdx
call   1030 <uvarint_decode64@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@Varint_To_Num_64.varintdecode_001 = internal global i32 0
define i32* @Varint_To_Num_64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @uvarint_decode64(i32* %3, i32 60, i32* @Varint_To_Num_64.varintdecode_001)
ret i32* @Varint_To_Num_64.varintdecode_001
}

LLVM IR (-O2):
@Varint_To_Num_64.varintdecode_001 = internal global i32 0
define i32* @Varint_To_Num_64(i32* %0) {
%2 = tail call i32 @uvarint_decode64(i32* %0, i32 60, i32* @Varint_To_Num_64.varintdecode_001)
ret i32* @Varint_To_Num_64.varintdecode_001
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Hello() {
  printf("Hello World\n");
  printf("Daniel Lenarczyk\n");
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [18 x i8] c"Daniel Lenarczyk\0A\00"
define void @Hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
@str.2 = [17 x i8] c"Daniel Lenarczyk\00"
define void @Hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
ret void
}