xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AccelDesiredHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AccelDesiredRequestUpdate() { UAVObjRequestUpdate(AccelDesiredHandle()); }


x86 assembly (clang, -O0):
<AccelDesiredRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AccelDesiredHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccelDesiredRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <AccelDesiredHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @AccelDesiredRequestUpdate() {
%1 = call i32 (...) @AccelDesiredHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AccelDesiredRequestUpdate() {
%1 = tail call i32 (...) @AccelDesiredHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int cmp(const void *x, const void *y) {
  return *(unsigned long *)x - *(unsigned long *)y;
}


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

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

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
void putc(unsigned char c) {
  while ((*((volatile unsigned long *)0x7F005018)) & (1 << 14))
    ;
  (*((volatile unsigned char *)0x7F005020)) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     1127 <putc+0x27>
jmp    110a <putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x7f005020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testq  $0x4000,0x7f005018
jne    1100 <putc>
mov    %dil,0x7f005020
7f
ret

LLVM IR (-O0):
define void @putc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 2130726944 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 16384
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 2130726944 to i8*)
ret void
}
void gtk_about_dialog_set_authors() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_set_authors() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _efree(int /*<<< orphan*/);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void _php_stream_free4() { 1 ? _efree(0) : free(0); }


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

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

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

LLVM IR (-O2):
define void @_php_stream_free4() {
%1 = tail call i32 @_efree(i32 0)
ret void
}
float log2f(float x) {}


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

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

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

LLVM IR (-O2):
define float @log2f(float %0) {
ret float undef
}
/* Variables and functions */
char *LibVarGetString(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int Export_BotLibVarGet(char *var_name, char *value, int size) {
  char *varvalue;
  varvalue = LibVarGetString(var_name);
  strncpy(value, varvalue, size - 1);
  value[size - 1] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<Export_BotLibVarGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <LibVarGetString@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Export_BotLibVarGet>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <LibVarGetString@plt>
movslq %ebp,%rbp
lea    -0x1(%rbp),%rdx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%rbp,1)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Export_BotLibVarGet(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i8* @LibVarGetString(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %5
%11 = load i8*, i8** %7
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = call i32 @strncpy(i8* %10, i8* %11, i32 %13)
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
ret i32 0
}

LLVM IR (-O2):
define i32 @Export_BotLibVarGet(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @LibVarGetString(i8* %0)
%5 = add nsw i32 %2, -1
%6 = tail call i32 @strncpy(i8* %1, i8* %4, i32 %5)
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 0, i8* %8
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ R_InitCoronas();
int /*<<< orphan*/ R_InitCustomColors();
int /*<<< orphan*/ R_InitOcclusionQueries();
int /*<<< orphan*/ R_InitOutlines();
int /*<<< orphan*/ R_InitShadows();
int /*<<< orphan*/ R_InitSkeletalCache();
void R_InitVolatileAssets(void) {
  R_InitSkeletalCache();
  R_InitOcclusionQueries();
  R_InitCoronas();
  R_InitOutlines();
  R_InitShadows();
  R_InitCustomColors();
}


x86 assembly (clang, -O0):
<R_InitVolatileAssets>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <R_InitSkeletalCache@plt>
mov    $0x0,%al
call   1030 <R_InitOcclusionQueries@plt>
mov    $0x0,%al
call   1070 <R_InitCoronas@plt>
mov    $0x0,%al
call   1060 <R_InitOutlines@plt>
mov    $0x0,%al
call   1050 <R_InitShadows@plt>
mov    $0x0,%al
call   1080 <R_InitCustomColors@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_InitVolatileAssets>:
push   %rax
xor    %eax,%eax
call   1040 <R_InitSkeletalCache@plt>
xor    %eax,%eax
call   1030 <R_InitOcclusionQueries@plt>
xor    %eax,%eax
call   1070 <R_InitCoronas@plt>
xor    %eax,%eax
call   1060 <R_InitOutlines@plt>
xor    %eax,%eax
call   1050 <R_InitShadows@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <R_InitCustomColors@plt>

LLVM IR (-O0):
define void @R_InitVolatileAssets() {
%1 = call i32 (...) @R_InitSkeletalCache()
%2 = call i32 (...) @R_InitOcclusionQueries()
%3 = call i32 (...) @R_InitCoronas()
%4 = call i32 (...) @R_InitOutlines()
%5 = call i32 (...) @R_InitShadows()
%6 = call i32 (...) @R_InitCustomColors()
ret void
}

LLVM IR (-O2):
define void @R_InitVolatileAssets() {
%1 = tail call i32 (...) @R_InitSkeletalCache()
%2 = tail call i32 (...) @R_InitOcclusionQueries()
%3 = tail call i32 (...) @R_InitCoronas()
%4 = tail call i32 (...) @R_InitOutlines()
%5 = tail call i32 (...) @R_InitShadows()
%6 = tail call i32 (...) @R_InitCustomColors()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Usage:\n     asco file [options]...\nOptions:\n     -o, --output "
         "file         specify a custom output file name\n     -h, --help      "
         "          show this help\n     -a, --atbash              use Atbash "
         "cipher\n     -v, --vigenere cipher     use Vigenere cipher, "
         "requires\n     --encipher                encipher mode, set by "
         "default\n     --decipher                switch to decipher mode\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [382 x i8] c"Usage:\0A asco file [options]...\0AOptions:\0A -o, --output file specify a custom output file name\0A -h, --help show this help\0A -a, --atbash use Atbash cipher\0A -v, --vigenere cipher use Vigenere cipher, requires\0A --encipher encipher mode, set by default\0A --decipher switch to decipher mode\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([382 x i8], [382 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [381 x i8] c"Usage:\0A asco file [options]...\0AOptions:\0A -o, --output file specify a custom output file name\0A -h, --help show this help\0A -a, --atbash use Atbash cipher\0A -v, --vigenere cipher use Vigenere cipher, requires\0A --encipher encipher mode, set by default\0A --decipher switch to decipher mode\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([381 x i8], [381 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned long strtoul(char *, char **, int /*<<< orphan*/);
unsigned long convert(char *arg, int *error) {
  unsigned long result;
  char *end;
  result = strtoul(arg, &end, 0);
  if (!*end)
    return result;
  *error = 1;
  return 0;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
jne    114d <convert+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <convert+0x4f>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
je     1136 <convert+0x26>
movl   $0x1,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @convert(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtoul(i8* %0, i8** %3, i32 0)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 1, i32* %1
br label %10
10: ; preds = %2, %9
%11 = phi i64 [ 0, %9 ], [ %5, %2 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ set_seg_desc(int, unsigned long, unsigned long, int, int,
                                int);
void set_data_seg(int no, unsigned long addr, unsigned long limit, int dpl) {
  set_seg_desc(no, addr, limit, 0x92, 0x40, dpl);
}


x86 assembly (clang, -O0):
<set_data_seg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r9d
mov    $0x92,%ecx
mov    $0x40,%r8d
call   1030 <set_seg_desc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_data_seg>:
mov    %ecx,%r9d
mov    $0x92,%ecx
mov    $0x40,%r8d
jmp    1030 <set_seg_desc@plt>

LLVM IR (-O0):
define void @set_data_seg(i32 %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @set_seg_desc(i32 %9, i64 %10, i64 %11, i32 146, i32 64, i32 %12)
ret void
}

LLVM IR (-O2):
define void @set_data_seg(i32 %0, i64 %1, i64 %2, i32 %3) {
%5 = tail call i32 @set_seg_desc(i32 %0, i64 %1, i64 %2, i32 146, i32 64, i32 %3)
ret void
}
double vabs(double v[3]) {
  return sqrt(((v[0]) * (v[0])) + ((v[1]) * (v[1])) + ((v[2]) * (v[2])));
}


x86 assembly (clang, -O0):
<vabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vabs>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <vabs+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @vabs(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @vabs(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
/* Variables and functions */
size_t max(size_t s1, size_t s2) { return s1 > s2 ? s1 : s2; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *,
                          unsigned int const);
void __attribute__((noreturn))
libc_fatal(const char *msg, const char *file_name, const char *function_name,
           const unsigned int line_number) {
  if (msg != NULL && file_name != NULL && function_name != NULL) {
    printf("Assertion '%s' failed at %s (%s:%u).\n", msg, function_name,
           file_name, line_number);
  }
  abort();
}


x86 assembly (clang, -O0):
<libc_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1174 <libc_fatal+0x54>
cmpq   $0x0,-0x10(%rbp)
je     1174 <libc_fatal+0x54>
cmpq   $0x0,-0x18(%rbp)
je     1174 <libc_fatal+0x54>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<libc_fatal>:
push   %rax
test   %rdi,%rdi
je     1145 <libc_fatal+0x25>
mov    %ecx,%r8d
mov    %rsi,%rcx
test   %rsi,%rsi
je     1145 <libc_fatal+0x25>
test   %rdx,%rdx
je     1145 <libc_fatal+0x25>
mov    %rdi,%rsi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Assertion '%s' failed at %s (%s:%u).\0A\00"
define void @libc_fatal(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %23
11: ; preds = %4
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i8*, i8** %7
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i8*, i8** %5
%19 = load i8*, i8** %7
%20 = load i8*, i8** %6
%21 = load i32, i32* %8
%22 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19, i8* %20, i32 %21)
br label %23
23: ; preds = %17, %14, %11, %4
%24 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"Assertion '%s' failed at %s (%s:%u).\0A\00"
define void @libc_fatal(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp ne i8* %0, null
%6 = icmp ne i8* %1, null
%7 = and i1 %5, %6
%8 = icmp ne i8* %2, null
%9 = and i1 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2, i8* %1, i32 %3)
br label %12
12: ; preds = %10, %4
%13 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ is_hostaddr(char const *);
int /*<<< orphan*/ usage(char *, char const *);
void getopt_host_ip(const char *optarg, const char **hostname) {
  if (!is_hostaddr(optarg))
    usage("Illegal Host-IP argument '%s'.", optarg);
  *hostname = optarg;
}


x86 assembly (clang, -O0):
<getopt_host_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_hostaddr@plt>
cmp    $0x0,%eax
jne    1152 <getopt_host_ip+0x32>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <usage@plt>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_host_ip>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <is_hostaddr@plt>
test   %eax,%eax
jne    1142 <getopt_host_ip+0x22>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <usage@plt>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Illegal Host-IP argument '%s'.\00"
define void @getopt_host_ip(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = call i32 @is_hostaddr(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @usage(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = load i8**, i8*** %4
store i8* %12, i8** %13
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Illegal Host-IP argument '%s'.\00"
define void @getopt_host_ip(i8* %0, i8** nocapture writeonly %1) {
%3 = tail call i32 @is_hostaddr(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @usage(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
store i8* %0, i8** %1
ret void
}
/* Variables and functions */
scalar_t__ setpgrp(int /*<<< orphan*/, int /*<<< orphan*/);
setsid() {
  if (setpgrp(0, 0) < 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<setsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <setpgrp@plt>
cmp    $0x0,%rax
jge    1137 <setsid+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    113e <setsid+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsid>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <setpgrp@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @setsid() {
%1 = alloca i32
%2 = call i64 @setpgrp(i32 0, i32 0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @setsid() {
%1 = tail call i64 @setpgrp(i32 0, i32 0)
%2 = ashr i64 %1, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int f(char *);
int foo() { return f((char *)&L"abcdef"[0]); }


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

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

LLVM IR (-O0):
@.str = [7 x i32] [i32 97, i32 98, i32 99, i32 100, i32 101, i32 102, i32 0]
define i32 @foo() {
%1 = call i32 @f(i8* bitcast ([7 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [7 x i32] [i32 97, i32 98, i32 99, i32 100, i32 101, i32 102, i32 0]
define i32 @foo() {
%1 = tail call i32 @f(i8* bitcast ([7 x i32]* @.str to i8*))
ret i32 %1
}
void ft_striter(char *s, void (*f)(char *)) {
  if (!s)
    return;
  if (!f)
    return;
  while (*s) {
    f(s);
    s++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1120 <ft_striter+0x20>
jmp    115d <ft_striter+0x5d>
cmpq   $0x0,-0x10(%rbp)
jne    1130 <ft_striter+0x30>
jmp    115d <ft_striter+0x5d>
jmp    1135 <ft_striter+0x35>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <ft_striter+0x5d>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1135 <ft_striter+0x35>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %0, %6 ]
tail call void %1(i8* %10)
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x77() {
  Assert_real((isbdigit(119) == 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",
              600, ("isbdigit should be 0 for w"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x77>:
push   %rax
mov    $0x77,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x258,%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 = [27 x i8] c"isbdigit should be 0 for w\00"
define void @t_isbdigit_0x77() {
%1 = call i64 @isbdigit(i32 119)
%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 600, i8* getelementptr inbounds ([27 x i8], [27 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 = [27 x i8] c"isbdigit should be 0 for w\00"
define void @t_isbdigit_0x77() {
%1 = tail call i64 @isbdigit(i32 119)
%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 600, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t _times(struct tms *ptms) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @_times(%struct.tms* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_usage(const char *prog) {
  printf("Usage: %s [-dbs?ewm]\n", prog);
  puts("  -d --device	device to use (default /dev/spislave1\n"
       "  -b --bpw	bits per word (default 8 bits)\n"
       "  -?  --help	print help\n"
       "  -m  --m         slave mode 0-master, 1-slave\n"
       "\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: %s [-dbs?ewm]\0A\00"
@.str.1 = [167 x i8] c" -d --device\09device to use (default /dev/spislave1\0A -b --bpw\09bits per word (default 8 bits)\0A -? --help\09print help\0A -m --m slave mode 0-master, 1-slave\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: %s [-dbs?ewm]\0A\00"
@.str.1 = [167 x i8] c" -d --device\09device to use (default /dev/spislave1\0A -b --bpw\09bits per word (default 8 bits)\0A -? --help\09print help\0A -m --m slave mode 0-master, 1-slave\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *_num2str(int i) {
  if (i > 0 && i < 0xff) {
    static char str[32];
    sprintf(str, "%d", i);
    return str;
  }
  return "<undefined>";
}


x86 assembly (clang, -O0):
<_num2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1158 <_num2str+0x48>
cmpl   $0xff,-0xc(%rbp)
jge    1158 <_num2str+0x48>
mov    -0xc(%rbp),%edx
lea    0x2f04(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <_num2str+0x53>
lea    0xea4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_num2str>:
push   %rbx
mov    %edi,%edx
lea    -0x1(%rdx),%eax
cmp    $0xfd,%eax
ja     1135 <_num2str+0x25>
lea    0x2f1c(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    113c <_num2str+0x2c>
lea    0xec7(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_num2str.str = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"<undefined>\00"
define i8* @_num2str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 255
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @_num2str.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @_num2str.str, i64 0, i64 0), i8** %2
br label %13
12: ; preds = %6, %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %13
13: ; preds = %12, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@_num2str.str = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"<undefined>\00"
define i8* @_num2str(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 254
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @_num2str.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @_num2str.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc16(int /*<<< orphan*/);
int /*<<< orphan*/ sindirecty();
void sbcsIndirecty16(void) { sbc16(readmemw65816(sindirecty())); }


x86 assembly (clang, -O0):
<sbcsIndirecty16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sindirecty@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <sbc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcsIndirecty16>:
push   %rax
xor    %eax,%eax
call   1040 <sindirecty@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sbc16@plt>

LLVM IR (-O0):
define void @sbcsIndirecty16() {
%1 = call i32 (...) @sindirecty()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @sbc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcsIndirecty16() {
%1 = tail call i32 (...) @sindirecty()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @sbc16(i32 %2)
ret void
}
void rop3_16_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_16_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_16_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
not    %cl
and    %dl,%cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_16_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %4
store i8 %39, i8* %40
ret void
}

LLVM IR (-O2):
define void @rop3_16_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %5, -1
%7 = and i8 %6, %2
%8 = and i8 %4, %1
%9 = or i8 %7, %8
store i8 %9, i8* %0
ret void
}
int sum_ab(int a, int b) { return (b * (b + 1) - a * (a - 1)) >> 1; }


x86 assembly (clang, -O0):
<sum_ab>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
imul   %edx,%ecx
sub    %ecx,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_ab>:
lea    0x1(%rsi),%eax
imul   %esi,%eax
lea    -0x1(%rdi),%ecx
imul   %edi,%ecx
sub    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @sum_ab(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 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = mul nsw i32 %5, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = mul nsw i32 %9, %11
%13 = sub nsw i32 %8, %12
%14 = ashr i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @sum_ab(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = mul nsw i32 %3, %1
%5 = add nsw i32 %0, -1
%6 = mul nsw i32 %5, %0
%7 = sub nsw i32 %4, %6
%8 = ashr i32 %7, 1
ret i32 %8
}
int htoi(str)
unsigned char str[];
{
  unsigned int result;
  (void)sscanf((char *)str, "%x", &result);
  return result;
}


x86 assembly (clang, -O0):
<htoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htoi>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @htoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void col_set_blue(int *colour, uint8_t blue) {
  *colour = (*colour & ~0xFF) | (blue & 0xFF);
}


x86 assembly (clang, -O0):
<col_set_blue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xffffff00,%ecx
mov    -0xc(%rbp),%eax
and    $0xff,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_set_blue>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @col_set_blue(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = and i32 %6, -256
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = or i32 %7, %9
%11 = load i32*, i32** %3
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @col_set_blue(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, -256
%5 = and i32 %1, 255
%6 = or i32 %4, %5
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_new() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_new"
         "\n");
}


x86 assembly (clang, -O0):
<pa_idxset_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_idxset_new\0A\00"
define i32 @pa_idxset_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_idxset_new\00"
define i32 @pa_idxset_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int is_file(char *path) {
  FILE *file;
  assert(path != NULL);
  file = fopen(path, "r");
  if (file == NULL)
    return 0;
  fclose(file);
  return 1;
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1179 <is_file+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1189 <is_file+0x59>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
test   %rax,%rax
je     1165 <is_file+0x35>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @is_file(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @fclose(i32* %5)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ 1, %7 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigseg(int sig) { exit(0); }


x86 assembly (clang, -O0):
<sigseg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @sigseg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigseg(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_87int16_mem(short *val) {
  return ((*val) & (0x87 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_87int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 135
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ itob(int, char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
int main(void) {
  char buffer[10];
  int i;
  for (i = 2; i <= 20; ++i) {
    itob(255, buffer, i);
    printf("Decimal 255 in base %-2d : %s\n", i, buffer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jg     1172 <main+0x52>
lea    -0xe(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0xff,%edi
call   1040 <itob@plt>
mov    -0x14(%rbp),%esi
lea    -0xe(%rbp),%rdx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0x2,%ebx
lea    0x6(%rsp),%r14
lea    0xec6(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    $0xff,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <itob@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x15,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c"Decimal 255 in base %-2d : %s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 2, %0 ], [ %7, %3 ]
%5 = call i32 @itob(i32 255, i8* %2, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %2)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 21
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
int error_lex(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @error_lex() {
ret i32 -1
}