xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int expect_strcat(char *(*f)(char *, char *)) {
  char *ret = f("Hello, ", "C world!");
  int res = strcmp(ret, "Hello, C world!") == 0;
  return res;
}


x86 assembly (clang, -O0):
<expect_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xee5(%rip),%rsi
call   *-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_strcat>:
push   %rax
mov    %rdi,%rax
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
call   *%rax
lea    0xedd(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Hello, \00"
@.str.1 = [9 x i8] c"C world!\00"
@.str.2 = [16 x i8] c"Hello, C world!\00"
define i32 @expect_strcat(i8* (i8*, i8*)* %0) {
%2 = alloca i8* (i8*, i8*)*
%3 = alloca i8*
%4 = alloca i32
store i8* (i8*, i8*)* %0, i8* (i8*, i8*)** %2
%5 = load i8* (i8*, i8*)*, i8* (i8*, i8*)** %2
%6 = call i8* %5(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"Hello, \00"
@.str.1 = [9 x i8] c"C world!\00"
@.str.2 = [16 x i8] c"Hello, C world!\00"
define i32 @expect_strcat(i8* (i8*, i8*)* nocapture %0) {
%2 = tail call i8* %0(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int read_data_xz(struct archive_read *a, const void **p, int *o1, int *o2) {
  return 0;
}


x86 assembly (clang, -O0):
<read_data_xz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.archive_read = type opaque
define i32 @read_data_xz(%struct.archive_read* %0, i8** %1, i32* %2, i32* %3) {
%5 = alloca %struct.archive_read*
%6 = alloca i8**
%7 = alloca i32*
%8 = alloca i32*
store %struct.archive_read* %0, %struct.archive_read** %5
store i8** %1, i8*** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
ret i32 0
}

LLVM IR (-O2):
%struct.archive_read = type opaque
define i32 @read_data_xz(%struct.archive_read* nocapture readnone %0, i8** nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
const char *get_commands() {
  static const char *commands = "uorb start\n"
                                "muorb_test start\n";
  return commands;
}


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

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

LLVM IR (-O0):
@get_commands.commands = internal global i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i32 0, i32 0)
@.str = [29 x i8] c"uorb start\0Amuorb_test start\0A\00"
define i8* @get_commands() {
%1 = load i8*, i8** @get_commands.commands
ret i8* %1
}

LLVM IR (-O2):
@.str = [29 x i8] c"uorb start\0Amuorb_test start\0A\00"
define i8* @get_commands() {
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
}
int mask(int i) {
  return (i & 0xff) | (((i + 1) & 0xff) << 8) | (((i + 2) & 0xff) << 16) |
         (((i + 3) & 0xff) << 24);
}


x86 assembly (clang, -O0):
<mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
add    $0x2,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
add    $0x3,%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask>:
movzbl %dil,%eax
mov    %edi,%ecx
shl    $0x8,%ecx
add    $0x100,%ecx
movzwl %cx,%ecx
mov    %edi,%edx
shl    $0x10,%edx
add    $0x20000,%edx
and    $0xff0000,%edx
shl    $0x18,%edi
or     %eax,%edi
or     %edx,%edi
lea    (%rcx,%rdi,1),%eax
add    $0x3000000,%eax
ret

LLVM IR (-O0):
define i32 @mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %4, %8
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 2
%12 = and i32 %11, 255
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 3
%17 = and i32 %16, 255
%18 = shl i32 %17, 24
%19 = or i32 %14, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @mask(i32 %0) {
%2 = and i32 %0, 255
%3 = shl i32 %0, 8
%4 = add i32 %3, 256
%5 = and i32 %4, 65280
%6 = shl i32 %0, 16
%7 = add i32 %6, 131072
%8 = and i32 %7, 16711680
%9 = shl i32 %0, 24
%10 = add i32 %9, 50331648
%11 = or i32 %10, %2
%12 = or i32 %11, %8
%13 = or i32 %12, %5
ret i32 %13
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void TRNGIntClear(uint32_t ui32IntFlags) {

  ;
  (*((volatile unsigned long *)(0x40028000 + 0x00000010))) = ui32IntFlags;
}


x86 assembly (clang, -O0):
<TRNGIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x40028010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TRNGIntClear>:
mov    %rdi,0x40028010
40
ret

LLVM IR (-O0):
define void @TRNGIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1073905680 to i64*)
ret void
}

LLVM IR (-O2):
define void @TRNGIntClear(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1073905680 to i64*)
ret void
}
char *naturalday(const int number) { return ""; }


x86 assembly (clang, -O0):
<naturalday>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @naturalday(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @naturalday(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
unsigned long unsignedlong_ignoring_signedint(unsigned long x, signed int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_signedint(i64 returned %0, i32 %1) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void mem_write_nullw(uint32_t addr, uint16_t val, void *p) {}


x86 assembly (clang, -O0):
<mem_write_nullw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mem_write_nullw(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @mem_write_nullw(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int get_brightness();
int /*<<< orphan*/ printf(char *, int);
void print_brightness() {
  int brightness;
  brightness = get_brightness();
  printf("%i\n", brightness);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @print_brightness() {
%1 = tail call i32 (...) @get_brightness()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
size_t strpcpy(char **, size_t, char const *);
size_t strscpy(char *dest, size_t size, const char *src) {
  char *s;
  s = dest;
  return strpcpy(&s, size, src);
}


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

x86 assembly (clang, -O2):
<strscpy>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <strpcpy@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @strscpy(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = call i64 @strpcpy(i8** %7, i64 %9, i8* %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @strscpy(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
store i8* %0, i8** %4
%6 = call i64 @strpcpy(i8** %4, i64 %1, i8* %2)
ret i64 %6
}
int sched_yield(void) {
  asm volatile("int $0x31");
  return 0;
}


x86 assembly (clang, -O0):
<sched_yield>:
push   %rbp
mov    %rsp,%rbp
int    $0x31
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_yield>:
int    $0x31
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sched_yield() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sched_yield() {
tail call void asm sideeffect "int $$0x31", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double dClamp(const double value, const double min, const double max) {
  assert(min <= max);
  if (value < min) {
    return min;
  }
  if (value > max) {
    return max;
  }
  return value;
}


x86 assembly (clang, -O0):
<dClamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1165 <dClamp+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118e <dClamp+0x7e>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1184 <dClamp+0x74>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118e <dClamp+0x7e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dClamp>:
sub    $0x38,%rsp
movapd %xmm2,(%rsp)
movapd %xmm1,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
xor    %edi,%edi
ucomisd %xmm1,%xmm2
setae  %dil
call   1030 <assert@plt>
movapd 0x20(%rsp),%xmm1
movapd (%rsp),%xmm2
minsd  %xmm1,%xmm2
movapd 0x10(%rsp),%xmm3
cmpltsd %xmm3,%xmm1
movapd %xmm1,%xmm0
andnpd %xmm2,%xmm0
andpd  %xmm3,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @dClamp(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* %7
%10 = fcmp ole double %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = load double, double* %6
store double %17, double* %4
br label %26
18: ; preds = %3
%19 = load double, double* %5
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load double, double* %7
store double %23, double* %4
br label %26
24: ; preds = %18
%25 = load double, double* %5
store double %25, double* %4
br label %26
26: ; preds = %24, %22, %16
%27 = load double, double* %4
ret double %27
}

LLVM IR (-O2):
define double @dClamp(double %0, double %1, double %2) {
%4 = fcmp ole double %1, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fcmp olt double %0, %1
%8 = fcmp ogt double %0, %2
%9 = select i1 %8, double %2, double %0
%10 = select i1 %7, double %1, double %9
ret double %10
}
double w_bar(double p) {
  double q = 1 - p;
  return 1 - 2 * p * q * (0.5) * (0.1) - q * q * (0.1);
}


x86 assembly (clang, -O0):
<w_bar>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xef5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xea8(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xea4(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe6f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_bar>:
movsd  0xef8(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm0
mulsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @w_bar(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %2
%7 = fmul double 2.000000e+00, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = fmul double %9, 5.000000e-01
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double %11, double 1.000000e-01, double 1.000000e+00)
%13 = load double, double* %3
%14 = load double, double* %3
%15 = fmul double %13, %14
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double %16, double 1.000000e-01, double %12)
ret double %17
}

LLVM IR (-O2):
define double @w_bar(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %0, 2.000000e+00
%4 = fmul double %3, %2
%5 = fmul double %4, -5.000000e-01
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e-01, double 1.000000e+00)
%7 = fneg double %2
%8 = fmul double %2, %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double 1.000000e-01, double %6)
ret double %9
}
/* Variables and functions */
scalar_t__ isspace(char);
void ignore_ws(char **c) {
  while (**c && isspace(**c))
    (*c)++;
}


x86 assembly (clang, -O0):
<ignore_ws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114d <ignore_ws+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115d <ignore_ws+0x4d>
jmp    1170 <ignore_ws+0x60>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <ignore_ws+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_ws>:
push   %rbx
mov    (%rdi),%rax
mov    (%rax),%al
test   %al,%al
je     113f <ignore_ws+0x2f>
mov    %rdi,%rbx
nopl   (%rax)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     113f <ignore_ws+0x2f>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movzbl 0x1(%rax),%eax
test   %al,%al
jne    1120 <ignore_ws+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ignore_ws(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %17, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = call i64 @isspace(i8 signext %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %9, %3
%16 = phi i1 [ false, %3 ], [ %14, %9 ]
br i1 %16, label %17, label %21
17: ; preds = %15
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
br label %3
21: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @ignore_ws(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i8 [ %12, %9 ], [ %3, %1 ]
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = load i8*, i8** %0
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %0
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
ret void
}
/* Type definitions */
struct value {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ malloc_error();
struct value *new_str(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
struct value *new_int(int i) {
  char *s = malloc(20 * sizeof(char));
  if (s == NULL) {
    malloc_error();
  }
  snprintf(s, 20, "%i", i);
  return new_str(s);
}


x86 assembly (clang, -O0):
<new_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <new_int+0x2b>
mov    $0x0,%al
call   1050 <malloc_error@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x14,%esi
lea    0xe82(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <new_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_int>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115e <new_int+0x1e>
xor    %eax,%eax
call   1050 <malloc_error@plt>
lea    0xe9b(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <new_str@plt>

LLVM IR (-O0):
%struct.value = type { i32 }
@.str = [3 x i8] c"%i\00"
define %struct.value* @new_int(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 20)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @malloc_error()
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
%11 = load i32, i32* %2
%12 = call i32 @snprintf(i8* %10, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %3
%14 = call %struct.value* @new_str(i8* %13)
ret %struct.value* %14
}

LLVM IR (-O2):
%struct.value = type { i32 }
@.str = [3 x i8] c"%i\00"
define %struct.value* @new_int(i32 %0) {
%2 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @malloc_error()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @snprintf(i8* %2, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = tail call %struct.value* @new_str(i8* %2)
ret %struct.value* %8
}
void delay(unsigned long contador) {
  while (--contador)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1123 <delay+0x23>
jmp    1108 <delay+0x8>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %7, %1
%4 = load i64, i64* %2
%5 = add i64 %4, -1
store i64 %5, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
ret void
}
/* Variables and functions */
unsigned int GET_UAA32BE(unsigned int *, int /*<<< orphan*/);
unsigned int BE32(unsigned int x) { return GET_UAA32BE(&x, 0); }


x86 assembly (clang, -O0):
<BE32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
call   1030 <GET_UAA32BE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BE32>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <GET_UAA32BE@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BE32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @GET_UAA32BE(i32* %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
define i32 @BE32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @GET_UAA32BE(i32* %2, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *wcpcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
wchar_t *dvm_wcscpy(wchar_t *dest, const wchar_t *src) {
  return wcpcpy(dest, src);
}


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

x86 assembly (clang, -O2):
<dvm_wcscpy>:
jmp    1030 <wcpcpy@plt>

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

LLVM IR (-O2):
define i32* @dvm_wcscpy(i32* %0, i32* %1) {
%3 = tail call i32* @wcpcpy(i32* %0, i32* %1)
ret i32* %3
}
void NoPinC__0__GeneralIO__toggle(void) {}


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

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

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

LLVM IR (-O2):
define void @NoPinC__0__GeneralIO__toggle() {
ret void
}
/* Variables and functions */
int f(int, int, int, int, int, int, int, int, int, int);
main() { return f(5, 6, 7, 8, 9, 10, 11, 12, 13, 14); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
mov    $0x9,%r8d
mov    $0xa,%r9d
movl   $0xb,(%rsp)
movl   $0xc,0x8(%rsp)
movl   $0xd,0x10(%rsp)
movl   $0xe,0x18(%rsp)
call   1030 <f@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
mov    $0x9,%r8d
mov    $0xa,%r9d
push   $0xe
push   $0xd
push   $0xc
push   $0xb
call   1030 <f@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x66() {
  Assert_real((isalpha(102)),
              "/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_isalpha.c",
              515, ("isalpha should be 1 for f"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x66>:
push   %rbp
mov    %rsp,%rbp
mov    $0x66,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x203,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x66>:
push   %rax
mov    $0x66,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x203,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for f\00"
define void @t_isalpha_0x66() {
%1 = call i32 @isalpha(i32 102)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for f\00"
define void @t_isalpha_0x66() {
%1 = tail call i32 @isalpha(i32 102)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ out_8(int);
void out_16(int word) {
  out_8(word & 0xFF);
  out_8(word >> 8);
}


x86 assembly (clang, -O0):
<out_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <out_8@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
call   1030 <out_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_16>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <out_8@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <out_8@plt>

LLVM IR (-O0):
define void @out_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @out_8(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = call i32 @out_8(i32 %7)
ret void
}

LLVM IR (-O2):
define void @out_16(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @out_8(i32 %2)
%4 = ashr i32 %0, 8
%5 = tail call i32 @out_8(i32 %4)
ret void
}
void gtk_table_resize() {}


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

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

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

LLVM IR (-O2):
define void @gtk_table_resize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char const);
int isnumeric(const char *str) {
  while (*str) {
    if (!isdigit(*str))
      return 0;
    str++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isnumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <isnumeric+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <isnumeric+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <isnumeric+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isnumeric+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumeric>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isnumeric+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <isnumeric+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isnumeric+0x20>
jmp    114b <isnumeric+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isnumeric(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - (unsigned short)46601;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    1159 <RandomFunc+0x59>
movzwl -0x14(%rbp),%eax
movzwl -0x12(%rbp,%rax,2),%edx
movzwl -0x14(%rbp),%eax
movzwl -0x12(%rbp,%rax,2),%ecx
add    %edx,%ecx
mov    %cx,-0x12(%rbp,%rax,2)
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
sub    $0xb609,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0x553c,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = add nsw i32 %10, 2885
%12 = trunc i32 %11 to i16
%13 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %12, i16* %13
store i16 0, i16* %6
br label %14
14: ; preds = %18, %2
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %14
%19 = load i16, i16* %6
%20 = zext i16 %19 to i64
%21 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 %20
%22 = load i16, i16* %21
%23 = zext i16 %22 to i32
%24 = load i16, i16* %6
%25 = zext i16 %24 to i64
%26 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 %25
%27 = load i16, i16* %26
%28 = zext i16 %27 to i32
%29 = add nsw i32 %28, %23
%30 = trunc i32 %29 to i16
store i16 %30, i16* %26
%31 = load i16, i16* %6
%32 = zext i16 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i16
store i16 %34, i16* %6
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%37 = load i16, i16* %36
%38 = zext i16 %37 to i32
%39 = sub nsw i32 %38, 46601
%40 = trunc i32 %39 to i16
%41 = load i16*, i16** %4
%42 = getelementptr inbounds i16, i16* %41, i64 0
store i16 %40, i16* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 21820
store i16 %4, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void stringReverse(char str[]) {
  if (str[0] == '\0')
    return;
  else
    stringReverse(&str[1]);
  printf("%c", str[0]);
}


x86 assembly (clang, -O0):
<stringReverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1141 <stringReverse+0x21>
jmp    1161 <stringReverse+0x41>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <stringReverse@plt>
mov    -0x8(%rbp),%rax
lea    0xea7(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringReverse>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1142 <stringReverse+0x22>
mov    %rdi,%rbx
add    $0x1,%rdi
call   1040 <stringReverse@plt>
movsbl (%rbx),%esi
lea    0xec4(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @stringReverse(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @stringReverse(i8* %6)
%7 = load i8, i8* %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %4
}
int valid_addr_range(unsigned long mem, int count) {
  unsigned long last = mem + count - 1;
  if (last < 0x800L)
    return 1;
  if (mem < 0x7f00L)
    return 0;
  if (last > 0x7ffffL)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<valid_addr_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x800,-0x20(%rbp)
jae    1138 <valid_addr_range+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1173 <valid_addr_range+0x73>
cmpq   $0x7f00,-0x10(%rbp)
jae    1152 <valid_addr_range+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1173 <valid_addr_range+0x73>
cmpq   $0x7ffff,-0x20(%rbp)
jbe    116c <valid_addr_range+0x6c>
movl   $0x0,-0x4(%rbp)
jmp    1173 <valid_addr_range+0x73>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_addr_range>:
movslq %esi,%rax
lea    (%rdi,%rax,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    $0x1,%eax
cmp    $0x800,%rcx
jb     1130 <valid_addr_range+0x30>
xor    %eax,%eax
cmp    $0x7f00,%rdi
jb     1130 <valid_addr_range+0x30>
xor    %eax,%eax
cmp    $0x80000,%rcx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @valid_addr_range(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = add i64 %0, -1
%5 = add i64 %4, %3
%6 = icmp ult i64 %5, 2048
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = icmp ult i64 %0, 32512
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i64 %5, 524288
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %9, %7, %2
%13 = phi i32 [ 1, %2 ], [ 0, %7 ], [ %11, %9 ]
ret i32 %13
}
int numeric(char c) {
  if (c <= '9')
    return (c >= '0');
  return 0;
}


x86 assembly (clang, -O0):
<numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     112e <numeric+0x2e>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <numeric+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @numeric(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 57
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
%11 = zext i1 %10 to i32
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @numeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ BaroSensorHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void BaroSensorRequestUpdate() { UAVObjRequestUpdate(BaroSensorHandle()); }


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

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

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

LLVM IR (-O2):
define void @BaroSensorRequestUpdate() {
%1 = tail call i32 (...) @BaroSensorHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ isgraph(int);
int utlisgraph(int ch) { return (ch <= 0xFF) && isgraph(ch); }


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

x86 assembly (clang, -O2):
<utlisgraph>:
xor    %eax,%eax
cmp    $0xff,%edi
jg     112f <utlisgraph+0x1f>
push   %rax
call   1030 <isgraph@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @utlisgraph(i32 %0) {
%2 = icmp slt i32 %0, 256
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i64 @isgraph(i32 %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int a[], int s, int e) {
  if (s >= e)
    return;
  int q = partition(a, s, e);
  quick_sort(a, s, q - 1);
  quick_sort(a, q + 1, e);
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <quick_sort+0x23>
jmp    1179 <quick_sort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int rand();
int roll(void) {
  int static NUMBER_OF_DICE_SIDES = 6;
  int randNum = (rand() % NUMBER_OF_DICE_SIDES) + 1;
  return randNum;
}


x86 assembly (clang, -O0):
<roll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  0x2f02(%rip)
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@roll.NUMBER_OF_DICE_SIDES = internal global i32 6
define i32 @roll() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = load i32, i32* @roll.NUMBER_OF_DICE_SIDES
%4 = srem i32 %2, %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @roll() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  signal(SIGALRM, SIG_IGN);
  kill(getpid(), SIGALRM);
  printf("xyzzy\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
call   1050 <signal@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e62(%rip),%rax
mov    (%rax),%esi
call   1060 <kill@plt>
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e90(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
call   1050 <signal@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
mov    (%rbx),%esi
mov    %eax,%edi
call   1060 <kill@plt>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
@.str = [7 x i8] c"xyzzy\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SIGALRM
%3 = load i32, i32* @SIG_IGN
%4 = call i32 @signal(i32 %2, i32 %3)
%5 = call i32 (...) @getpid()
%6 = load i32, i32* @SIGALRM
%7 = call i32 @kill(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
@str = [6 x i8] c"xyzzy\00"
define i32 @main() {
%1 = load i32, i32* @SIGALRM
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 (...) @getpid()
%5 = load i32, i32* @SIGALRM
%6 = tail call i32 @kill(i32 %4, i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *stpcpy(char *, char *);
char *overlappingWriteFunction_stpcpy(char *src, char *dest) {
  (void)stpcpy(dest, src);
  return stpcpy(src, src);
}


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

x86 assembly (clang, -O2):
<overlappingWriteFunction_stpcpy>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @overlappingWriteFunction_stpcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @stpcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i8* @stpcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @overlappingWriteFunction_stpcpy(i8* %0, i8* %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %5
}