xunge/DecIR huggingface dataset:
int findnonA(char *haystack, int from, int limit) {
  for (int i = from; i < limit - 1; ++i) {
    if (haystack[i] != 'A')
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<findnonA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1158 <findnonA+0x58>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
je     1145 <findnonA+0x45>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <findnonA+0x5f>
jmp    114a <findnonA+0x4a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1114 <findnonA+0x14>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findnonA>:
add    $0xffffffff,%edx
mov    $0xffffffff,%eax
cmp    %esi,%edx
jle    1130 <findnonA+0x30>
movslq %esi,%rcx
add    %rcx,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x41,(%rdi)
jne    1131 <findnonA+0x31>
add    $0x1,%esi
add    $0x1,%rdi
cmp    %esi,%edx
jne    1120 <findnonA+0x20>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @findnonA(i8* nocapture %0, i32 %1, i32 %2) {
%4 = add i32 %2, -1
%5 = icmp sgt i32 %4, %1
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %6, %13
%9 = phi i64 [ %7, %6 ], [ %14, %13 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 65
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = add nsw i64 %9, 1
%15 = trunc i64 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %19, label %8
17: ; preds = %8
%18 = trunc i64 %9 to i32
br label %19
19: ; preds = %13, %17, %3
%20 = phi i32 [ -1, %3 ], [ %18, %17 ], [ -1, %13 ]
ret i32 %20
}
double fclamp(double value, double low, double high) {
  return value < low ? low : (value > high ? high : value);
}


x86 assembly (clang, -O0):
<fclamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <fclamp+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1169 <fclamp+0x69>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <fclamp+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115f <fclamp+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @fclamp(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
int _fstat_r(struct _reent *r, int file, struct stat *st) {
  (void)r;
  (void)file;
  (void)st;
  return 0;
}


x86 assembly (clang, -O0):
<_fstat_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._reent = type opaque
%struct.stat = type opaque
define i32 @_fstat_r(%struct._reent* %0, i32 %1, %struct.stat* %2) {
%4 = alloca %struct._reent*
%5 = alloca i32
%6 = alloca %struct.stat*
store %struct._reent* %0, %struct._reent** %4
store i32 %1, i32* %5
store %struct.stat* %2, %struct.stat** %6
%7 = load %struct._reent*, %struct._reent** %4
%8 = load i32, i32* %5
%9 = load %struct.stat*, %struct.stat** %6
ret i32 0
}

LLVM IR (-O2):
%struct._reent = type opaque
%struct.stat = type opaque
define i32 @_fstat_r(%struct._reent* nocapture readnone %0, i32 %1, %struct.stat* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
struct event_base {
  int dummy;
};

/* Variables and functions */
int event_base_loopbreak(struct event_base *);
int event_base_loopexit(struct event_base *, void *);
int AMCEventBase_Stop(struct event_base *base, long immediately) {
  if (immediately) {
    return event_base_loopbreak(base);
  } else {
    return event_base_loopexit(base, ((void *)0));
  }
}


x86 assembly (clang, -O0):
<AMCEventBase_Stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <AMCEventBase_Stop+0x2c>
mov    -0x10(%rbp),%rdi
call   1040 <event_base_loopbreak@plt>
mov    %eax,-0x4(%rbp)
jmp    115c <AMCEventBase_Stop+0x3c>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <event_base_loopexit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCEventBase_Stop>:
test   %rsi,%rsi
je     112a <AMCEventBase_Stop+0xa>
jmp    1040 <event_base_loopbreak@plt>
xor    %esi,%esi
jmp    1030 <event_base_loopexit@plt>

LLVM IR (-O0):
%struct.event_base = type { i32 }
define i32 @AMCEventBase_Stop(%struct.event_base* %0, i64 %1) {
%3 = alloca i32
%4 = alloca %struct.event_base*
%5 = alloca i64
store %struct.event_base* %0, %struct.event_base** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load %struct.event_base*, %struct.event_base** %4
%10 = call i32 @event_base_loopbreak(%struct.event_base* %9)
store i32 %10, i32* %3
br label %14
11: ; preds = %2
%12 = load %struct.event_base*, %struct.event_base** %4
%13 = call i32 @event_base_loopexit(%struct.event_base* %12, i8* null)
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
define i32 @AMCEventBase_Stop(%struct.event_base* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @event_base_loopbreak(%struct.event_base* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @event_base_loopexit(%struct.event_base* %0, i8* null)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglEndOcclusionQueryNV();
void _Lazy_glEndOcclusionQueryNV(void) {
  if (GLeeInit())
    pglEndOcclusionQueryNV();
}


x86 assembly (clang, -O0):
<_Lazy_glEndOcclusionQueryNV>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glEndOcclusionQueryNV+0x1c>
mov    $0x0,%al
call   1040 <pglEndOcclusionQueryNV@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glEndOcclusionQueryNV>:
push   %rax
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glEndOcclusionQueryNV+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pglEndOcclusionQueryNV@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glEndOcclusionQueryNV() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglEndOcclusionQueryNV()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glEndOcclusionQueryNV() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglEndOcclusionQueryNV()
br label %5
5: ; preds = %3, %0
ret void
}
int dns_opt_push(struct dns_packet *P, struct dns_opt *opt) {
  (void)P;
  (void)opt;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.dns_packet = type opaque
%struct.dns_opt = type opaque
define i32 @dns_opt_push(%struct.dns_packet* %0, %struct.dns_opt* %1) {
%3 = alloca %struct.dns_packet*
%4 = alloca %struct.dns_opt*
store %struct.dns_packet* %0, %struct.dns_packet** %3
store %struct.dns_opt* %1, %struct.dns_opt** %4
%5 = load %struct.dns_packet*, %struct.dns_packet** %3
%6 = load %struct.dns_opt*, %struct.dns_opt** %4
ret i32 0
}

LLVM IR (-O2):
%struct.dns_packet = type opaque
%struct.dns_opt = type opaque
define i32 @dns_opt_push(%struct.dns_packet* nocapture readnone %0, %struct.dns_opt* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void dbg_gen_exit(FILE *fp) {
  fprintf(fp, "break;\n");
  fflush(fp);
}


x86 assembly (clang, -O0):
<dbg_gen_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_gen_exit>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"break;\0A\00"
define void @dbg_gen_exit(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
%3 = tail call i32 @fflush(i32* %0)
ret void
}
int bp_sw_flat_zero_eval(int type, void *data, char *seq) { return 0; }


x86 assembly (clang, -O0):
<bp_sw_flat_zero_eval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bp_sw_flat_zero_eval(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("{{projectName}} compiled!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [26 x i8] c"{{projectName}} compiled!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ timespec_before_or_same(struct timespec const *,
                                           struct timespec const *);
int __attribute__((always_))
timespec_after(const struct timespec *__restrict t1,
               const struct timespec *__restrict t2) {
  return !timespec_before_or_same(t1, t2);
}


x86 assembly (clang, -O0):
<timespec_after>:
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 <timespec_before_or_same@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_after>:
push   %rax
call   1030 <timespec_before_or_same@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @timespec_after(%struct.timespec* noalias %0, %struct.timespec* noalias %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @timespec_before_or_same(%struct.timespec* %5, %struct.timespec* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @timespec_after(%struct.timespec* noalias %0, %struct.timespec* noalias %1) {
%3 = tail call i32 @timespec_before_or_same(%struct.timespec* %0, %struct.timespec* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int fp32(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fp32() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Recursive(int /*<<< orphan*/);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  for (;;)
    Recursive(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %edi,%edi
call   1050 <Recursive@plt>
jmp    114f <main+0x1f>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
nop
xor    %edi,%edi
call   1050 <Recursive@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
br label %4
4: ; preds = %4, %0
%5 = call i32 @Recursive(i32 0)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
br label %3
3: ; preds = %3, %0
%4 = tail call i32 @Recursive(i32 0)
br label %3
}
/* Variables and functions */
scalar_t__ point(int);
int filler(char *s) { return (point((int)s) && s[0] == '\\' && s[1] == 'R'); }


x86 assembly (clang, -O0):
<filler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <point@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115f <filler+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5c,%ecx
mov    %al,-0x9(%rbp)
jne    115f <filler+0x4f>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x52,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filler>:
push   %rbx
mov    %rdi,%rbx
call   1030 <point@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1131 <filler+0x21>
cmpb   $0x5c,(%rbx)
jne    1131 <filler+0x21>
xor    %eax,%eax
cmpb   $0x52,0x1(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @filler(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i64 @point(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 92
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 82
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %9, %6, %1
%15 = phi i32 [ 0, %6 ], [ 0, %1 ], [ %13, %9 ]
ret i32 %15
}
void __bzero(unsigned char *d, int len) {
  while (len--)
    *d++ = 0;
}


x86 assembly (clang, -O0):
<__bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1136 <__bzero+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    110b <__bzero+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bzero>:
test   %esi,%esi
je     1122 <__bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @__bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int char16_t;

/* Variables and functions */
bool utf16_is_surrogate(char16_t c) { return (0xd800 <= c && c <= 0xdfff); }


x86 assembly (clang, -O0):
<utf16_is_surrogate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0xd800,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1127 <utf16_is_surrogate+0x27>
cmpl   $0xdfff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf16_is_surrogate>:
and    $0xfffff800,%edi
xor    %eax,%eax
cmp    $0xd800,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @utf16_is_surrogate(i32 %0) {
%2 = and i32 %0, -2048
%3 = icmp eq i32 %2, 55296
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xa4() {
  Assert_real((isbdigit(164) == 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",
              825, ("isbdigit should be 0 for 0xa4"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xa4\00"
define void @t_isbdigit_0xa4() {
%1 = call i64 @isbdigit(i32 164)
%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 825, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xa4\00"
define void @t_isbdigit_0xa4() {
%1 = tail call i64 @isbdigit(i32 164)
%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 825, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int TMRnewTimer() {
  static int _tmrIdx = -1;
  if (_tmrIdx < (10 - 2))
    return ++_tmrIdx;
  else
    return -1;
}


x86 assembly (clang, -O0):
<TMRnewTimer>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x8,0x2f15(%rip)
jge    1128 <TMRnewTimer+0x28>
mov    0x2f09(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f00(%rip)
mov    %eax,-0x4(%rbp)
jmp    112f <TMRnewTimer+0x2f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TMRnewTimer>:
mov    0x2f1a(%rip),%ecx
mov    $0xffffffff,%eax
cmp    $0x7,%ecx
jg     111b <TMRnewTimer+0x1b>
add    $0x1,%ecx
mov    %ecx,0x2f07(%rip)
mov    %ecx,%eax
ret

LLVM IR (-O0):
@TMRnewTimer._tmrIdx = internal global i32 -1
define i32 @TMRnewTimer() {
%1 = alloca i32
%2 = load i32, i32* @TMRnewTimer._tmrIdx
%3 = icmp slt i32 %2, 8
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @TMRnewTimer._tmrIdx
%6 = add nsw i32 %5, 1
store i32 %6, i32* @TMRnewTimer._tmrIdx
store i32 %6, i32* %1
br label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %8
8: ; preds = %7, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@TMRnewTimer._tmrIdx = internal unnamed_addr global i32 -1
define i32 @TMRnewTimer() {
%1 = load i32, i32* @TMRnewTimer._tmrIdx
%2 = icmp slt i32 %1, 8
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = add nsw i32 %1, 1
store i32 %4, i32* @TMRnewTimer._tmrIdx
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f(int);
int main(void) {
  int y = 42;
  y = f(y);
  assert(y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 42)
%2 = tail call i32 @assert(i32 %1)
ret i32 0
}
int fun597() { return 597; }


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

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

LLVM IR (-O0):
define i32 @fun597() {
ret i32 597
}

LLVM IR (-O2):
define i32 @fun597() {
ret i32 597
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printMenu(void) {
  printf("-------------------------\nPlease select and option:\n0. Exit\n1. "
         "Add\n2. Edit\n3. Delete\n4. Verify\nPlease enter your choice and "
         "press enter: ");
}


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

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

LLVM IR (-O0):
@.str = [138 x i8] c"-------------------------\0APlease select and option:\0A0. Exit\0A1. Add\0A2. Edit\0A3. Delete\0A4. Verify\0APlease enter your choice and press enter: \00"
define void @printMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"-------------------------\0APlease select and option:\0A0. Exit\0A1. Add\0A2. Edit\0A3. Delete\0A4. Verify\0APlease enter your choice and press enter: \00"
define void @printMenu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("CTF{which_side_r_you_on?}");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"CTF{which_side_r_you_on?}\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"CTF{which_side_r_you_on?}\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *alloc_arena_mmap(size_t);
void *alloc_arena_shm(size_t arena_size) {
  return alloc_arena_mmap(arena_size);
}


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

x86 assembly (clang, -O2):
<alloc_arena_shm>:
jmp    1030 <alloc_arena_mmap@plt>

LLVM IR (-O0):
define i8* @alloc_arena_shm(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @alloc_arena_mmap(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @alloc_arena_shm(i64 %0) {
%2 = tail call i8* @alloc_arena_mmap(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void am_free(void *ptr) {
  if (ptr != NULL)
    free(ptr);
}


x86 assembly (clang, -O0):
<am_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <am_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_free>:
test   %rdi,%rdi
je     111a <am_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @am_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
char *strchr(const char *s, int c) {
  char *r = strchrnul(s, c);
  unsigned char a = *(unsigned char *)r, b = (unsigned char)c;
  return a == b ? r : ((void *)0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <strchrnul@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jne    115f <strchr+0x4f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    116a <strchr+0x5a>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    116a <strchr+0x5a>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <strchrnul@plt>
cltq
cmp    %bpl,(%rax)
cmove  %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @strchrnul to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = load i8, i8* %5
%7 = trunc i32 %1 to i8
%8 = icmp eq i8 %6, %7
%9 = select i1 %8, i8* %5, i8* null
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lib_create_connect() { printf("create_connect \n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"create_connect \0A\00"
define void @lib_create_connect() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"create_connect \00"
define void @lib_create_connect() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Destroy(int argc, char **argv) {
  printf("Calling from Destroy\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<Destroy>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [21 x i8] c"Calling from Destroy\00"
define i32 @Destroy(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void zlScreen(signed long x, signed long y, signed long zoom) {}


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

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

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

LLVM IR (-O2):
define void @zlScreen(i64 %0, i64 %1, i64 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ messErr(int);
void IF_listI2C(void) { messErr(49); }


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

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

LLVM IR (-O0):
define void @IF_listI2C() {
%1 = call i32 @messErr(i32 49)
ret void
}

LLVM IR (-O2):
define void @IF_listI2C() {
%1 = tail call i32 @messErr(i32 49)
ret void
}
/* Variables and functions */
int standardPartition(int *, int, int);
void standarQuicksort(int *a, int p, int r) {
  int q;
  if (p < r) {
    q = standardPartition(a, p, r);
    standarQuicksort(a, p, q - 1);
    standarQuicksort(a, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<standarQuicksort>:
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
jge    1174 <standarQuicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <standardPartition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <standarQuicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <standarQuicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standarQuicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <standarQuicksort+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 <standardPartition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <standarQuicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <standarQuicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @standarQuicksort(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 slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @standardPartition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @standarQuicksort(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 @standardPartition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @standarQuicksort(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 /*<<< orphan*/ free(char *);
char *irc_strlwr(int /*<<< orphan*/);
int strmatch(char *, char *);
int /*<<< orphan*/ x_strdup(char const *);
int irc_strcasematch(const char *str, const char *mask) {
  char *newstr, *newmask;
  int ret;
  newstr = irc_strlwr(x_strdup(str));
  newmask = irc_strlwr(x_strdup(mask));
  ret = strmatch(newstr, newmask);
  free(newstr);
  free(newmask);
  return ret;
}


x86 assembly (clang, -O0):
<irc_strcasematch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <x_strdup@plt>
mov    %eax,%edi
call   1050 <irc_strlwr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <x_strdup@plt>
mov    %eax,%edi
call   1050 <irc_strlwr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strmatch@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_strcasematch>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1060 <x_strdup@plt>
mov    %eax,%edi
call   1050 <irc_strlwr@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1060 <x_strdup@plt>
mov    %eax,%edi
call   1050 <irc_strlwr@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <strmatch@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @irc_strcasematch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @x_strdup(i8* %8)
%10 = call i8* @irc_strlwr(i32 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %4
%12 = call i32 @x_strdup(i8* %11)
%13 = call i8* @irc_strlwr(i32 %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = call i32 @strmatch(i8* %14, i8* %15)
store i32 %16, i32* %7
%17 = load i8*, i8** %5
%18 = call i32 @free(i8* %17)
%19 = load i8*, i8** %6
%20 = call i32 @free(i8* %19)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @irc_strcasematch(i8* %0, i8* %1) {
%3 = tail call i32 @x_strdup(i8* %0)
%4 = tail call i8* @irc_strlwr(i32 %3)
%5 = tail call i32 @x_strdup(i8* %1)
%6 = tail call i8* @irc_strlwr(i32 %5)
%7 = tail call i32 @strmatch(i8* %4, i8* %6)
%8 = tail call i32 @free(i8* %4)
%9 = tail call i32 @free(i8* %6)
ret i32 %7
}
float filterencoder(float value, float lastvalue) {
  if (value == 0) {
    return lastvalue;
  } else {
    return value;
  }
}


x86 assembly (clang, -O0):
<filterencoder>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1134 <filterencoder+0x34>
jp     1134 <filterencoder+0x34>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113e <filterencoder+0x3e>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterencoder>:
xorps  %xmm2,%xmm2
cmpeqss %xmm0,%xmm2
andps  %xmm2,%xmm1
andnps %xmm0,%xmm2
orps   %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @filterencoder(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %5
store float %9, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
store float %11, float* %3
br label %12
12: ; preds = %10, %8
%13 = load float, float* %3
ret float %13
}

LLVM IR (-O2):
define float @filterencoder(float %0, float %1) {
%3 = fcmp oeq float %0, 0.000000e+00
%4 = select i1 %3, float %1, float %0
ret float %4
}
__attribute__((no, noclone)) int bar(int a, int b) {
  asm volatile("movq %%rsp, %%r10" : : : "r10");
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rsp,%r10
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %rsp,%r10
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
tail call void asm sideeffect "movq %rsp, %r10", "~{r10},~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
unsigned char gpio_get(void) {
  return *((volatile unsigned short *)0x4000134) & 0xf;
}


x86 assembly (clang, -O0):
<gpio_get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000134,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_get>:
movzwl 0x4000134,%eax
04
and    $0xf,%al
ret

LLVM IR (-O0):
define zeroext i8 @gpio_get() {
%1 = load volatile i16, i16* inttoptr (i64 67109172 to i16*)
%2 = zext i16 %1 to i32
%3 = and i32 %2, 15
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @gpio_get() {
%1 = load volatile i16, i16* inttoptr (i64 67109172 to i16*)
%2 = trunc i16 %1 to i8
%3 = and i8 %2, 15
ret i8 %3
}
/* Variables and functions */
long strtoul(char const *, char **, int);
long strtol(const char *restrict cp, char **restrict endp, int base) {
  if (*cp == '-')
    return -strtoul(cp + 1, endp, base);
  return strtoul(cp, endp, base);
}


x86 assembly (clang, -O0):
<strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1158 <strtol+0x48>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strtoul@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    116c <strtol+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strtoul@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtol>:
push   %rax
cmpb   $0x2d,(%rdi)
jne    1124 <strtol+0x14>
add    $0x1,%rdi
call   1030 <strtoul@plt>
neg    %rax
pop    %rcx
ret
pop    %rax
jmp    1030 <strtoul@plt>

LLVM IR (-O0):
define i64 @strtol(i8* noalias %0, i8** noalias %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 45
br i1 %11, label %12, label %19
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8**, i8*** %6
%16 = load i32, i32* %7
%17 = call i64 @strtoul(i8* %14, i8** %15, i32 %16)
%18 = sub nsw i64 0, %17
store i64 %18, i64* %4
br label %24
19: ; preds = %3
%20 = load i8*, i8** %5
%21 = load i8**, i8*** %6
%22 = load i32, i32* %7
%23 = call i64 @strtoul(i8* %20, i8** %21, i32 %22)
store i64 %23, i64* %4
br label %24
24: ; preds = %19, %12
%25 = load i64, i64* %4
ret i64 %25
}

LLVM IR (-O2):
define i64 @strtol(i8* noalias %0, i8** noalias nocapture %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i64 @strtoul(i8* %7, i8** %1, i32 %2)
%9 = sub nsw i64 0, %8
br label %12
10: ; preds = %3
%11 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
br label %12
12: ; preds = %10, %6
%13 = phi i64 [ %9, %6 ], [ %11, %10 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv[]) {
  fprintf(stderr,
          "%s [certificate (PEM or URL)] [private key URL] "
          "[module] [conf]\n",
          argv[0]);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"%s [certificate (PEM or URL)] [private key URL] [module] [conf]\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"%s [certificate (PEM or URL)] [private key URL] [module] [conf]\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
struct thread {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ thread_cancel(struct thread *);
void thread_cancelp(struct thread **const self) {
  assert(self != NULL);
  thread_cancel(*self);
}


x86 assembly (clang, -O0):
<thread_cancelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <thread_cancel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_cancelp>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <thread_cancel@plt>

LLVM IR (-O0):
%struct.thread = type { i32 }
define void @thread_cancelp(%struct.thread** %0) {
%2 = alloca %struct.thread**
store %struct.thread** %0, %struct.thread*** %2
%3 = load %struct.thread**, %struct.thread*** %2
%4 = icmp ne %struct.thread** %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.thread**, %struct.thread*** %2
%8 = load %struct.thread*, %struct.thread** %7
%9 = call i32 @thread_cancel(%struct.thread* %8)
ret void
}

LLVM IR (-O2):
%struct.thread = type { i32 }
define void @thread_cancelp(%struct.thread** %0) {
%2 = icmp ne %struct.thread** %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load %struct.thread*, %struct.thread** %0
%6 = tail call i32 @thread_cancel(%struct.thread* %5)
ret void
}