xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t btol(const uint8_t *b) {
  return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | (b[3] << 0);
}


x86 assembly (clang, -O0):
<btol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btol>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @btol(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = shl i32 %19, 0
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @btol(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ OpcodeNotDone();
void ble(void) { OpcodeNotDone(); }


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

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

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

LLVM IR (-O2):
define void @ble() {
%1 = tail call i32 (...) @OpcodeNotDone()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_err_msg(char *errmsg) { free(errmsg); }


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

x86 assembly (clang, -O2):
<free_err_msg>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_err_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @free_err_msg(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
char *jsonLampInternal(int, char *, char *, int, char *, char *, int, int, int,
                       int, int, int);
char *jsonLamp(int id, char *mac, char *nm, int rm, char *ty, char *cmd,
               int lvl, int rgb, int kelvin, int joined) {
  return (jsonLampInternal(id, mac, nm, rm, ty, cmd, lvl, rgb, kelvin, -1, -1,
                           joined));
}


x86 assembly (clang, -O0):
<jsonLamp>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x68,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%ebx
mov    0x18(%rbp),%r11d
mov    0x20(%rbp),%r10d
mov    0x28(%rbp),%eax
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
movl   $0xffffffff,0x18(%rsp)
ff
movl   $0xffffffff,0x20(%rsp)
ff
mov    %eax,0x28(%rsp)
call   1030 <jsonLampInternal@plt>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonLamp>:
push   %rbx
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%r11d
mov    0x20(%rsp),%eax
mov    0x28(%rsp),%ebx
push   %rbx
push   $0xffffffffffffffff
push   $0xffffffffffffffff
push   %rax
push   %r11
push   %r10
call   1030 <jsonLampInternal@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @jsonLamp(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %11
store i8* %1, i8** %12
store i8* %2, i8** %13
store i32 %3, i32* %14
store i8* %4, i8** %15
store i8* %5, i8** %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%21 = load i32, i32* %11
%22 = load i8*, i8** %12
%23 = load i8*, i8** %13
%24 = load i32, i32* %14
%25 = load i8*, i8** %15
%26 = load i8*, i8** %16
%27 = load i32, i32* %17
%28 = load i32, i32* %18
%29 = load i32, i32* %19
%30 = load i32, i32* %20
%31 = call i8* @jsonLampInternal(i32 %21, i8* %22, i8* %23, i32 %24, i8* %25, i8* %26, i32 %27, i32 %28, i32 %29, i32 -1, i32 -1, i32 %30)
ret i8* %31
}

LLVM IR (-O2):
define i8* @jsonLamp(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = tail call i8* @jsonLampInternal(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5, i32 %6, i32 %7, i32 %8, i32 -1, i32 -1, i32 %9)
ret i8* %11
}
void sighup(int p) {
  reopen_logfiles();
  ast_log(2,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/vma/chan_ss7/refs/heads/master/mtp3d.c",
          661, __PRETTY_FUNCTION__, "Log file reopened\n");
}


x86 assembly (clang, -O0):
<sighup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <reopen_logfiles@plt>
mov    $0x2,%edi
lea    0xec2(%rip),%rsi
mov    $0x295,%edx
lea    0xf37(%rip),%rcx
lea    0xf41(%rip),%r8
mov    $0x0,%al
call   1030 <ast_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup>:
push   %rax
xor    %eax,%eax
call   1040 <reopen_logfiles@plt>
lea    0xed1(%rip),%rsi
lea    0xf4b(%rip),%rcx
lea    0xf55(%rip),%r8
mov    $0x2,%edi
mov    $0x295,%edx
xor    %eax,%eax
pop    %r9
jmp    1030 <ast_log@plt>

LLVM IR (-O0):
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vma/chan_ss7/refs/heads/master/mtp3d.c\00"
@__PRETTY_FUNCTION__.sighup = [17 x i8] c"void sighup(int)\00"
@.str.1 = [19 x i8] c"Log file reopened\0A\00"
define void @sighup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @reopen_logfiles()
%4 = call i32 (i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @ast_log to i32 (i32, i8*, i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 661, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__PRETTY_FUNCTION__.sighup, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vma/chan_ss7/refs/heads/master/mtp3d.c\00"
@__PRETTY_FUNCTION__.sighup = [17 x i8] c"void sighup(int)\00"
@.str.1 = [19 x i8] c"Log file reopened\0A\00"
define void @sighup(i32 %0) {
%2 = tail call i32 (...) @reopen_logfiles()
%3 = tail call i32 (i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @ast_log to i32 (i32, i8*, i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 661, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__PRETTY_FUNCTION__.sighup, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double abs_v(double x) {
  if (x < 0) {
    x = -x;
  }
  return x;
}


x86 assembly (clang, -O0):
<abs_v>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1138 <abs_v+0x38>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_v>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @abs_v(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @abs_v(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
unsigned long reflect(unsigned long crc, int bitnum) {
  unsigned long i, j = 1, crcout = 0;
  for (i = (unsigned long)1 << (bitnum - 1); i; i >>= 1) {
    if (crc & i)
      crcout |= j;
    j <<= 1;
  }
  return (crcout);
}


x86 assembly (clang, -O0):
<reflect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x1,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <reflect+0x77>
mov    -0x8(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
je     115a <reflect+0x5a>
mov    -0x20(%rbp),%rax
or     -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1131 <reflect+0x31>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reflect>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%edx
mov    $0x1,%r8d
shl    %cl,%r8
xor    %eax,%eax
mov    %r8,%rcx
cs nopw 0x0(%rax,%rax,1)
mov    %r8,%rsi
and    %rdi,%rsi
cmovne %rdx,%rsi
or     %rsi,%rax
add    %rdx,%rdx
shr    %rcx
cmp    $0x1,%r8
mov    %rcx,%r8
ja     1120 <reflect+0x20>
ret

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

LLVM IR (-O2):
define i64 @reflect(i64 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
br label %6
6: ; preds = %2, %6
%7 = phi i64 [ 0, %2 ], [ %13, %6 ]
%8 = phi i64 [ 1, %2 ], [ %14, %6 ]
%9 = phi i64 [ %5, %2 ], [ %15, %6 ]
%10 = and i64 %9, %0
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i64 0, i64 %8
%13 = or i64 %12, %7
%14 = shl i64 %8, 1
%15 = lshr i64 %9, 1
%16 = icmp ult i64 %9, 2
br i1 %16, label %17, label %6
17: ; preds = %6
ret i64 %13
}
const char *Swap_Description(void) {
  return "The `Swap` class can be used to override the behaviour of swapping "
         "two "
         "objects. By default the `Swap` class simply swaps the memory of the "
         "two objects passed in as parameters making use of the `Size` class. "
         "In almost all cases this default behaviour should be fine, even if "
         "the "
         "objects have custom assignment functions."
         "\n\n"
         "Swapping can be used internally by various collections and "
         "algorithms.";
}


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

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

LLVM IR (-O0):
@.str = [392 x i8] c"The `Swap` class can be used to override the behaviour of swapping two objects. By default the `Swap` class simply swaps the memory of the two objects passed in as parameters making use of the `Size` class. In almost all cases this default behaviour should be fine, even if the objects have custom assignment functions.\0A\0ASwapping can be used internally by various collections and algorithms.\00"
define i8* @Swap_Description() {
ret i8* getelementptr inbounds ([392 x i8], [392 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [392 x i8] c"The `Swap` class can be used to override the behaviour of swapping two objects. By default the `Swap` class simply swaps the memory of the two objects passed in as parameters making use of the `Size` class. In almost all cases this default behaviour should be fine, even if the objects have custom assignment functions.\0A\0ASwapping can be used internally by various collections and algorithms.\00"
define i8* @Swap_Description() {
ret i8* getelementptr inbounds ([392 x i8], [392 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32r9(uint32_t x) { return (x >> 9) | (x << 23); }


x86 assembly (clang, -O0):
<rot32r9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x9,%eax
mov    -0x4(%rbp),%ecx
shl    $0x17,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32r9>:
mov    %edi,%eax
sar    $0x9,%eax
shl    $0x17,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32r9(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 9
%5 = load i32, i32* %2
%6 = shl i32 %5, 23
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32r9(i32 %0) {
%2 = ashr i32 %0, 9
%3 = shl i32 %0, 23
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void parImpar(int n) {
  if (n % 2 == 0)
    printf("E par\n");
  else
    printf("E impar\n");
}


x86 assembly (clang, -O0):
<parImpar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1140 <parImpar+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    114c <parImpar+0x3c>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parImpar>:
test   $0x1,%dil
lea    0xeed(%rip),%rax
lea    0xede(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"E par\0A\00"
@.str.1 = [9 x i8] c"E impar\0A\00"
define void @parImpar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"E impar\00"
@str.2 = [6 x i8] c"E par\00"
define void @parImpar(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("usage: ligtoqe [-u] sourcefile.lig output_ligature_file\n"
         "Build a ligature resource file for qemacs\n"
         "\n"
         "-u : output an UTF8 encode summy on stdout\n");
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [143 x i8] c"usage: ligtoqe [-u] sourcefile.lig output_ligature_file\0ABuild a ligature resource file for qemacs\0A\0A-u : output an UTF8 encode summy on stdout\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [142 x i8] c"usage: ligtoqe [-u] sourcefile.lig output_ligature_file\0ABuild a ligature resource file for qemacs\0A\0A-u : output an UTF8 encode summy on stdout\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([142 x i8], [142 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hci_event_synchronous_connection_complete_get_air_mode(const uint8_t *event) {
  return event[18];
}


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

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

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

LLVM IR (-O2):
define i32 @hci_event_synchronous_connection_complete_get_air_mode(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 18
%3 = load i32, i32* %2
ret i32 %3
}
extern __attribute__((gnu_)) double carmen_clamp(double X, double Y, double Z) {
  if (Y < X)
    return X;
  else if (Y > Z)
    return Z;
  return Y;
}


x86 assembly (clang, -O0):
<carmen_clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <carmen_clamp+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1164 <carmen_clamp+0x64>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <carmen_clamp+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1164 <carmen_clamp+0x64>
jmp    115a <carmen_clamp+0x5a>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_clamp>:
minsd  %xmm1,%xmm2
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @carmen_clamp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %6
%9 = load double, double* %5
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %5
store double %12, double* %4
br label %22
13: ; preds = %3
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %22
19: ; preds = %13
br label %20
20: ; preds = %19
%21 = load double, double* %6
store double %21, double* %4
br label %22
22: ; preds = %20, %17, %11
%23 = load double, double* %4
ret double %23
}

LLVM IR (-O2):
define double @carmen_clamp(double %0, double %1, double %2) {
%4 = fcmp olt double %1, %0
%5 = fcmp ogt double %1, %2
%6 = select i1 %5, double %2, double %1
%7 = select i1 %4, double %0, double %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ database_close();
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void die(const char *message) {
  database_close();
  if (errno)
    perror(message);
  else
    fprintf(stderr, "ERROR: %s.\n", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <database_close@plt>
mov    0x2e7e(%rip),%rax
cmpq   $0x0,(%rax)
je     1172 <die+0x32>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
jmp    118b <die+0x4b>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe7a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <database_close@plt>
mov    0x2e86(%rip),%rax
cmpq   $0x0,(%rax)
je     116e <die+0x2e>
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
lea    0xe82(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
jmp    1160 <die+0x20>

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
@.str = [12 x i8] c"ERROR: %s.\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @database_close()
%4 = load i64, i64* @errno
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @perror(i8* %7)
br label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %9, %6
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
@.str = [12 x i8] c"ERROR: %s.\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = tail call i32 (...) @database_close()
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* %0)
br label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xe5() {
  Assert_real((isbdigit(229) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1150, ("isbdigit should be 0 for 0xe5"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0xe5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe5,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x47e,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0xe5>:
push   %rax
mov    $0xe5,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x47e,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe5\00"
define void @t_isbdigit_0xe5() {
%1 = call i64 @isbdigit(i32 229)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe5\00"
define void @t_isbdigit_0xe5() {
%1 = tail call i64 @isbdigit(i32 229)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ escape_buf(int, char *);
int /*<<< orphan*/ m_clear(int);
int m_create(int, int);
int /*<<< orphan*/ m_putc(int, int /*<<< orphan*/);
int escape_str(int buf, char *src) {
  if (!buf)
    buf = m_create(100, 1);
  else
    m_clear(buf);
  escape_buf(buf, src);
  m_putc(buf, 0);
  return buf;
}


x86 assembly (clang, -O0):
<escape_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1170 <escape_str+0x30>
mov    $0x64,%edi
mov    $0x1,%esi
call   1050 <m_create@plt>
mov    %eax,-0x4(%rbp)
jmp    1178 <escape_str+0x38>
mov    -0x4(%rbp),%edi
call   1060 <m_clear@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <escape_buf@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <m_putc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
test   %edi,%edi
je     1153 <escape_str+0x13>
mov    %edi,%ebp
call   1060 <m_clear@plt>
jmp    1164 <escape_str+0x24>
mov    $0x64,%edi
mov    $0x1,%esi
call   1050 <m_create@plt>
mov    %eax,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <escape_buf@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <m_putc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @escape_str(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @m_create(i32 100, i32 1)
store i32 %8, i32* %3
br label %12
9: ; preds = %2
%10 = load i32, i32* %3
%11 = call i32 @m_clear(i32 %10)
br label %12
12: ; preds = %9, %7
%13 = load i32, i32* %3
%14 = load i8*, i8** %4
%15 = call i32 @escape_buf(i32 %13, i8* %14)
%16 = load i32, i32* %3
%17 = call i32 @m_putc(i32 %16, i32 0)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @escape_str(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @m_create(i32 100, i32 1)
br label %8
6: ; preds = %2
%7 = tail call i32 @m_clear(i32 %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %0, %6 ], [ %5, %4 ]
%10 = tail call i32 @escape_buf(i32 %9, i8* %1)
%11 = tail call i32 @m_putc(i32 %9, i32 0)
ret i32 %9
}
long int gcdlint(long int x, long int y) {
  if (y == 0)
    return x;
  else
    gcdlint(y, x % y);
}


x86 assembly (clang, -O0):
<gcdlint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <gcdlint+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <gcdlint+0x3e>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcdlint@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcdlint>:
test   %rsi,%rsi
je     1132 <gcdlint+0x32>
mov    %rsi,%rdx
mov    %rdi,%rax
jmp    111d <gcdlint+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcdlint+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcdlint+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcdlint+0x15>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @gcdlint(i64 returned %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i64 %0
}
void __attribute__((weak)) tim8_up_tim13_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tim8_up_tim13_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tim8_up_tim13_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim8_up_tim13_isr = [18 x i8] c"tim8_up_tim13_isr\00"
define weak void @tim8_up_tim13_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.tim8_up_tim13_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim8_up_tim13_isr = [18 x i8] c"tim8_up_tim13_isr\00"
define weak void @tim8_up_tim13_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.tim8_up_tim13_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ actual();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("starting\n");
  actual();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"starting\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @actual()
ret i32 0
}
/* Variables and functions */
size_t right(size_t i) { return (i + 1) << 1; }


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
shl    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
lea    (%rdi,%rdi,1),%rax
add    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @right(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1
%5 = shl i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @right(i64 %0) {
%2 = shl i64 %0, 1
%3 = add i64 %2, 2
ret i64 %3
}
/* Variables and functions */
int f448(int *);
int f449(int *p) { return f448(p); }


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

x86 assembly (clang, -O2):
<f449>:
jmp    1030 <f448@plt>

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

LLVM IR (-O2):
define i32 @f449(i32* %0) {
%2 = tail call i32 @f448(i32* %0)
ret i32 %2
}
unsigned int mem_read(unsigned int addr) {
  unsigned int *mem_p = (unsigned int *)addr;
  return mem_p[0];
}


x86 assembly (clang, -O0):
<mem_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mem_read(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @mem_read(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
void fa165(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    p02C:
      goto p02C;
      goto a;
    a:
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa165>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa165+0x4>

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

LLVM IR (-O0):
define void @fa165() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa165() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  int *x;
  int y;
  x = (int *)malloc(4);
  *x = 5;
  y = ++*x;
  return y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x6,(%rax)
mov    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
store i32 5, i32* %6
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 6, i32* %2
ret i32 6
}
char *printFunc(void *toBePrinted) { return (char *)toBePrinted; }


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

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

LLVM IR (-O0):
define i8* @printFunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @printFunc(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(scalar_t__ volatile);
void UARTDMADisable(uint32_t ui32Base, uint32_t ui32DMAFlags) {
  ASSERT(_UARTBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000048))) &= ~ui32DMAFlags;
}


x86 assembly (clang, -O0):
<UARTDMADisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x48(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMADisable>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
mov    0x8(%rsp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    0x10(%rsp),%rax
not    %rax
mov    0x8(%rsp),%rcx
and    %rax,0x48(%rcx)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @UARTDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = call i32 @_UARTBaseValid(i64 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = xor i64 %8, -1
%10 = load volatile i64, i64* %3
%11 = add nsw i64 %10, 72
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @UARTDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = tail call i32 @_UARTBaseValid(i64 %5)
%7 = tail call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = xor i64 %8, -1
%10 = load volatile i64, i64* %3
%11 = add nsw i64 %10, 72
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void printCPUTotalLoadInfo(const char *cmd) {
  (void)cmd;
  output("CPU Total Load\t0\t100\t%%\n");
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"CPU Total Load\090\09100\09%%\0A\00"
define void @printCPUTotalLoadInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"CPU Total Load\090\09100\09%%\0A\00"
define void @printCPUTotalLoadInfo(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_uid(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
void gain_root_privilege(void) {
  setuid(0);
  assert_uid(0, 0);
}


x86 assembly (clang, -O0):
<gain_root_privilege>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <setuid@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <assert_uid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gain_root_privilege>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <assert_uid@plt>

LLVM IR (-O0):
define void @gain_root_privilege() {
%1 = call i32 @setuid(i32 0)
%2 = call i32 @assert_uid(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @gain_root_privilege() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @assert_uid(i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct helium_ctx {
  int dummy;
};
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int helium_poll_token(struct helium_ctx *, int /*<<< orphan*/,
                      int /*<<< orphan*/ *, int, int /*<<< orphan*/ *,
                      int /*<<< orphan*/);
int helium_poll_result(struct helium_ctx *ctx, uint16_t token, int8_t *result,
                       uint32_t retries) {
  return helium_poll_token(ctx, token, result, sizeof(*result), NULL, retries);
}


x86 assembly (clang, -O0):
<helium_poll_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r9d
mov    $0x4,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <helium_poll_token@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helium_poll_result>:
mov    %ecx,%r9d
mov    $0x4,%ecx
xor    %r8d,%r8d
jmp    1030 <helium_poll_token@plt>

LLVM IR (-O0):
%struct.helium_ctx = type { i32 }
define i32 @helium_poll_result(%struct.helium_ctx* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca %struct.helium_ctx*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store %struct.helium_ctx* %0, %struct.helium_ctx** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load %struct.helium_ctx*, %struct.helium_ctx** %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @helium_poll_token(%struct.helium_ctx* %9, i32 %10, i32* %11, i32 4, i32* null, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.helium_ctx = type { i32 }
define i32 @helium_poll_result(%struct.helium_ctx* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @helium_poll_token(%struct.helium_ctx* %0, i32 %1, i32* %2, i32 4, i32* null, i32 %3)
ret i32 %5
}
/* Type definitions */
struct parsed_opr {
  int dummy;
};
struct parsed_op {
  int dummy;
};

/* Variables and functions */
char *out_opr_float(char *, size_t, struct parsed_op *, struct parsed_opr *,
                    int, int);
char *out_src_opr_float(char *buf, size_t buf_size, struct parsed_op *po,
                        struct parsed_opr *popr, int need_float_stack) {
  return out_opr_float(buf, buf_size, po, popr, 1, need_float_stack);
}


x86 assembly (clang, -O0):
<out_src_opr_float>:
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    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r9d
mov    $0x1,%r8d
call   1030 <out_opr_float@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_src_opr_float>:
mov    %r8d,%r9d
mov    $0x1,%r8d
jmp    1030 <out_opr_float@plt>

LLVM IR (-O0):
%struct.parsed_op = type { i32 }
%struct.parsed_opr = type { i32 }
define i8* @out_src_opr_float(i8* %0, i64 %1, %struct.parsed_op* %2, %struct.parsed_opr* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.parsed_op*
%9 = alloca %struct.parsed_opr*
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store %struct.parsed_op* %2, %struct.parsed_op** %8
store %struct.parsed_opr* %3, %struct.parsed_opr** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load %struct.parsed_op*, %struct.parsed_op** %8
%14 = load %struct.parsed_opr*, %struct.parsed_opr** %9
%15 = load i32, i32* %10
%16 = call i8* @out_opr_float(i8* %11, i64 %12, %struct.parsed_op* %13, %struct.parsed_opr* %14, i32 1, i32 %15)
ret i8* %16
}

LLVM IR (-O2):
%struct.parsed_op = type { i32 }
%struct.parsed_opr = type { i32 }
define i8* @out_src_opr_float(i8* %0, i64 %1, %struct.parsed_op* %2, %struct.parsed_opr* %3, i32 %4) {
%6 = tail call i8* @out_opr_float(i8* %0, i64 %1, %struct.parsed_op* %2, %struct.parsed_opr* %3, i32 1, i32 %4)
ret i8* %6
}
/* Variables and functions */
double sqrt(double);
double x_right(double y) { return sqrt(1.0 - y * y); }


x86 assembly (clang, -O0):
<x_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_right>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <x_right+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @x_right(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = call double @sqrt(double %6)
ret double %7
}

LLVM IR (-O2):
define double @x_right(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = tail call double @sqrt(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ __NR_linkat;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, char const *,
            int /*<<< orphan*/, char const *, int /*<<< orphan*/);
__attribute__((always_)) int _syscall_link(const char *oldpath,
                                           const char *newpath) {
  return syscall(__NR_linkat, AT_FDCWD, oldpath, AT_FDCWD, newpath, 0);
}


x86 assembly (clang, -O0):
<_syscall_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    0x2e93(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%r8
xor    %r9d,%r9d
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_link>:
mov    %rsi,%r8
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
mov    %ecx,%esi
xor    %r9d,%r9d
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_linkat = global i32 0
@AT_FDCWD = global i32 0
define i32 @_syscall_link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @__NR_linkat
%6 = load i32, i32* @AT_FDCWD
%7 = load i8*, i8** %3
%8 = load i32, i32* @AT_FDCWD
%9 = load i8*, i8** %4
%10 = call i32 @syscall(i32 %5, i32 %6, i8* %7, i32 %8, i8* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
@__NR_linkat = global i32 0
@AT_FDCWD = global i32 0
define i32 @_syscall_link(i8* %0, i8* %1) {
%3 = load i32, i32* @__NR_linkat
%4 = load i32, i32* @AT_FDCWD
%5 = tail call i32 @syscall(i32 %3, i32 %4, i8* %0, i32 %4, i8* %1, i32 0)
ret i32 %5
}