xunge/DecIR huggingface dataset:
/* Variables and functions */
char *mymalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *newstring(char *s) {
  char *q;
  if (s) {
    q = mymalloc(strlen(s) + 1);
    (void)strcpy(q, s);
    return q;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<newstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117a <newstring+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <mymalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <newstring+0x52>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstring>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <newstring+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <mymalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <newstring+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @newstring(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @mymalloc(i64 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
void event_base_free(struct event_base *base) { ; }


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

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

LLVM IR (-O0):
%struct.event_base = type opaque
define void @event_base_free(%struct.event_base* %0) {
%2 = alloca %struct.event_base*
store %struct.event_base* %0, %struct.event_base** %2
ret void
}

LLVM IR (-O2):
%struct.event_base = type opaque
define void @event_base_free(%struct.event_base* nocapture %0) {
ret void
}
void dbg_notify_event(void) {}


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

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

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

LLVM IR (-O2):
define void @dbg_notify_event() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_add(int, int, int);
void emit_adds(int rs1, int rs2, int rt) { emit_add(rs1, rs2, rt); }


x86 assembly (clang, -O0):
<emit_adds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <emit_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_adds>:
jmp    1030 <emit_add@plt>

LLVM IR (-O0):
define void @emit_adds(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @emit_add(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @emit_adds(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @emit_add(i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRCD_set(void) { return U_WMRCORENONE_set("U_WMRCD"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRCD\00"
define i8* @U_WMRCD_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRCD\00"
define i8* @U_WMRCD_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void g_mem_chunk_alloc0() {}


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

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

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

LLVM IR (-O2):
define void @g_mem_chunk_alloc0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WAIT_ANY;
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
void kidhandler(int signum) { waitpid(WAIT_ANY, NULL, WNOHANG); }


x86 assembly (clang, -O0):
<kidhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kidhandler>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <waitpid@plt>

LLVM IR (-O0):
@WAIT_ANY = global i32 0
@WNOHANG = global i32 0
define void @kidhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @WAIT_ANY
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 %3, i32* null, i32 %4)
ret void
}

LLVM IR (-O2):
@WAIT_ANY = global i32 0
@WNOHANG = global i32 0
define void @kidhandler(i32 %0) {
%2 = load i32, i32* @WAIT_ANY
%3 = load i32, i32* @WNOHANG
%4 = tail call i32 @waitpid(i32 %2, i32* null, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void print1(int m, double A[]) {
  for (int i = 0; i < m; i++)
    printf("(%d)=%lf\n", i, A[i]);
}


x86 assembly (clang, -O0):
<print1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115c <print1+0x4c>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print1+0x16>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"(%d)=%lf\0A\00"
define void @print1(i32 %0, double* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = load double, double* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %11, double %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int exp(int);
double tansig_double(double x) { return 2. / (1. + exp(-2. * x)) - 1.; }


x86 assembly (clang, -O0):
<tansig_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xec1(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xebd(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tansig_double>:
push   %rax
mulsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
addsd  0xeda(%rip),%xmm1
movsd  0xeda(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tansig_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -2.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call i32 @exp(i32 %5)
%7 = sitofp i32 %6 to double
%8 = fadd double 1.000000e+00, %7
%9 = fdiv double 2.000000e+00, %8
%10 = fsub double %9, 1.000000e+00
ret double %10
}

LLVM IR (-O2):
define double @tansig_double(double %0) {
%2 = fmul double %0, -2.000000e+00
%3 = fptosi double %2 to i32
%4 = tail call i32 @exp(i32 %3)
%5 = sitofp i32 %4 to double
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double 2.000000e+00, %6
%8 = fadd double %7, -1.000000e+00
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int i;
  char palavra[100];
  scanf("%s", palavra);
  i = 0;
  while (palavra[i] != '\0')
    i = i + 1;
  printf("A palavra digitada tem %d caracteres", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1166 <main+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    $0xffffffff,%esi
nopl   0x0(%rax)
add    $0x1,%esi
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <main+0x20>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [37 x i8] c"A palavra digitada tem %d caracteres\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %4
4: ; preds = %4, %0
%5 = phi i64 [ %9, %4 ], [ 0, %0 ]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void timespec_print(struct timespec *a) {
  printf("%li.%09li\n", a->tv_sec, a->tv_nsec);
}


x86 assembly (clang, -O0):
<timespec_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_print>:
mov    (%rdi),%edx
mov    0x4(%rdi),%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@.str = [11 x i8] c"%li.%09li\0A\00"
define void @timespec_print(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i32, i32* %4
%6 = load %struct.timespec*, %struct.timespec** %2
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@.str = [11 x i8] c"%li.%09li\0A\00"
define void @timespec_print(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret void
}
int do_462() { return 462; }


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

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

LLVM IR (-O0):
define i32 @do_462() {
ret i32 462
}

LLVM IR (-O2):
define i32 @do_462() {
ret i32 462
}
__attribute__((format(printf, 1, 2))) void sliprock_trace(const char *str,
                                                          ...) {
  (void)str;
}


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

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

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

LLVM IR (-O2):
define void @sliprock_trace(i8* nocapture %0, ...) {
ret void
}
void gg_resolve_pthread_cleanup(void *arg, int kill) {}


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

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

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

LLVM IR (-O2):
define void @gg_resolve_pthread_cleanup(i8* nocapture %0, i32 %1) {
ret void
}
void send_dns_packet(struct iphdr *siph, struct udphdr *sudph,
                     struct dnshdr *sdnsh) {}


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

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

LLVM IR (-O0):
%struct.iphdr = type opaque
%struct.udphdr = type opaque
%struct.dnshdr = type opaque
define void @send_dns_packet(%struct.iphdr* %0, %struct.udphdr* %1, %struct.dnshdr* %2) {
%4 = alloca %struct.iphdr*
%5 = alloca %struct.udphdr*
%6 = alloca %struct.dnshdr*
store %struct.iphdr* %0, %struct.iphdr** %4
store %struct.udphdr* %1, %struct.udphdr** %5
store %struct.dnshdr* %2, %struct.dnshdr** %6
ret void
}

LLVM IR (-O2):
%struct.iphdr = type opaque
%struct.udphdr = type opaque
%struct.dnshdr = type opaque
define void @send_dns_packet(%struct.iphdr* nocapture %0, %struct.udphdr* nocapture %1, %struct.dnshdr* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
page28() {
  printf("They don\'t think it\'s funny.\n");
  return 26;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"They don't think it's funny.\0A\00"
define i32 @page28() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 26
}

LLVM IR (-O2):
@str = [29 x i8] c"They don't think it's funny.\00"
define i32 @page28() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 26
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
main() {
  char s1[20] = "hello world";
  s1[5] = '\0';
  printf("%d\n", strlen(s1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
movb   $0x0,-0x1b(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
movb   $0x0,0x5(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [20 x i8] c"hello world\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = bitcast [20 x i8]* %1 to i8*
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 5
store i8 0, i8* %3
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [20 x i8] c"hello world\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 5
store i8 0, i8* %3
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ signalFaultInterrupt();
void MpuFaultISR() {
  signalFaultInterrupt();
  while (true) {
  }
}


x86 assembly (clang, -O0):
<MpuFaultISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <signalFaultInterrupt@plt>
jmp    111b <MpuFaultISR+0xb>

x86 assembly (clang, -O2):
<MpuFaultISR>:
push   %rax
xor    %eax,%eax
call   1030 <signalFaultInterrupt@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <MpuFaultISR+0x10>

LLVM IR (-O0):
define void @MpuFaultISR() {
%1 = call i32 (...) @signalFaultInterrupt()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @MpuFaultISR() {
%1 = tail call i32 (...) @signalFaultInterrupt()
br label %2
2: ; preds = %0, %2
br label %2
}
int b(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<b>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @b(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @b(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x02() {
  Assert_real((isupper(2) == 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_isupper.c",
              15, ("isupper should be 0 for 0x02"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x02>:
push   %rax
mov    $0x2,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x02\00"
define void @t_isupper_0x02() {
%1 = call i64 @isupper(i32 2)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([29 x i8], [29 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x02\00"
define void @t_isupper_0x02() {
%1 = tail call i64 @isupper(i32 2)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t getArrayS(int16_t *arr, int idx) { return arr[idx]; }


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

x86 assembly (clang, -O2):
<getArrayS>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getArrayS(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getArrayS(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int generated_above(const int *celms, size_t level) {
  size_t i;
  for (i = 0; i < level; i++)
    if (celms[i] == celms[level])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<generated_above>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1160 <generated_above+0x60>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    114a <generated_above+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1167 <generated_above+0x67>
jmp    114f <generated_above+0x4f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <generated_above+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generated_above>:
test   %rsi,%rsi
je     111e <generated_above+0x1e>
mov    (%rdi,%rsi,4),%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmp    %eax,(%rdi,%rcx,4)
je     1121 <generated_above+0x21>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <generated_above+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @generated_above(i32* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 0, i64* %6
br label %7
7: ; preds = %23, %2
%8 = load i64, i64* %6
%9 = load i64, i64* %5
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = load i32*, i32** %4
%13 = load i64, i64* %6
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i32, i32* %16, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %15, %19
br i1 %20, label %21, label %22
21: ; preds = %11
store i32 1, i32* %3
br label %27
22: ; preds = %11
br label %23
23: ; preds = %22
%24 = load i64, i64* %6
%25 = add i64 %24, 1
store i64 %25, i64* %6
br label %7
26: ; preds = %7
store i32 0, i32* %3
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @generated_above(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr inbounds i32, i32* %0, i64 %1
%6 = load i32, i32* %5
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %1
br i1 %8, label %15, label %9
9: ; preds = %4, %7
%10 = phi i64 [ 0, %4 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %6
%14 = add nuw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %2
%16 = phi i32 [ 0, %2 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
int check_if_ping(char *cmd) {
  char *first = strtok(cmd, " ");
  return strcmp(first, "ping") == 0;
}


x86 assembly (clang, -O0):
<check_if_ping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_ping>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strtok@plt>
lea    0xece(%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 = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"ping\00"
define i32 @check_if_ping(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"ping\00"
define i32 @check_if_ping(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned int,
                           unsigned int);
int /*<<< orphan*/ fwrite(void *, unsigned int, int, int /*<<< orphan*/ *);
void dump_depth(FILE *fp, void *data, unsigned int width, unsigned int height) {
  fprintf(fp, "P5 %u %u 65535\n", width, height);
  fwrite(data, width * height * 2, 1, fp);
}


x86 assembly (clang, -O0):
<dump_depth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
imul   -0x18(%rbp),%esi
shl    $0x1,%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_depth>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
imul   %ebx,%ebp
add    %ebp,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r15,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"P5 %u %u 65535\0A\00"
define void @dump_depth(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = mul i32 %14, %15
%17 = mul i32 %16, 2
%18 = load i32*, i32** %5
%19 = call i32 @fwrite(i8* %13, i32 %17, i32 1, i32* %18)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"P5 %u %u 65535\0A\00"
define void @dump_depth(i32* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%6 = shl i32 %2, 1
%7 = mul i32 %6, %3
%8 = tail call i32 @fwrite(i8* %1, i32 %7, i32 1, i32* %0)
ret void
}
double Cent2Fahr(double C) {
  double F;
  F = ((1.8) * C) + 32;
  return F;
}


x86 assembly (clang, -O0):
<Cent2Fahr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cent2Fahr>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Cent2Fahr(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %4, double 3.200000e+01)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @Cent2Fahr(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.800000e+00, double 3.200000e+01)
ret double %2
}
int hostapd_wps_button_pushed(struct hostapd_data *hapd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hostapd_data = type opaque
define i32 @hostapd_wps_button_pushed(%struct.hostapd_data* nocapture readnone %0) {
ret i32 0
}
void msgid_sanitize(char *m) {
  while (*m) {
    if (*m == '/')
      *m = '@';
    if (*m == '>')
      m[1] = '\0';
    m++;
  }
}


x86 assembly (clang, -O0):
<msgid_sanitize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <msgid_sanitize+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    112c <msgid_sanitize+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x40,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
jne    1144 <msgid_sanitize+0x44>
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <msgid_sanitize+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgid_sanitize>:
jmp    1118 <msgid_sanitize+0x18>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,0x1(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2f,%al
je     1130 <msgid_sanitize+0x30>
cmp    $0x3e,%al
je     1110 <msgid_sanitize+0x10>
test   %al,%al
jne    1114 <msgid_sanitize+0x14>
jmp    1139 <msgid_sanitize+0x39>
nopl   0x0(%rax)
movb   $0x40,(%rdi)
add    $0x1,%rdi
jmp    1118 <msgid_sanitize+0x18>
ret

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

LLVM IR (-O2):
define void @msgid_sanitize(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %10
i8 47, label %5
i8 62, label %6
]
5: ; preds = %2
store i8 64, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %7
br label %8
8: ; preds = %2, %5, %6
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
unsigned int *malloc(unsigned int);
unsigned int *malloc_page_aligned(unsigned int pages) {
  unsigned int *temp = malloc((pages + 1) * 4096);
  unsigned int *data = (unsigned int *)(((unsigned int)temp / 4096 + 1) * 4096);
  return data;
}


x86 assembly (clang, -O0):
<malloc_page_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
shl    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0xc,%eax
add    $0x1,%eax
shl    $0xc,%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_page_aligned>:
push   %rax
shl    $0xc,%edi
add    $0x1000,%edi
call   1030 <malloc@plt>
add    $0x1000,%eax
and    $0xfffff000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32* @malloc_page_aligned(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add i32 %5, 1
%7 = mul i32 %6, 4096
%8 = call i32* @malloc(i32 %7)
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = ptrtoint i32* %9 to i32
%11 = udiv i32 %10, 4096
%12 = add i32 %11, 1
%13 = mul i32 %12, 4096
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store i32* %15, i32** %4
%16 = load i32*, i32** %4
ret i32* %16
}

LLVM IR (-O2):
define i32* @malloc_page_aligned(i32 %0) {
%2 = shl i32 %0, 12
%3 = add i32 %2, 4096
%4 = tail call i32* @malloc(i32 %3)
%5 = ptrtoint i32* %4 to i64
%6 = add i64 %5, 4096
%7 = and i64 %6, 4294963200
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}
/* Variables and functions */
int /*<<< orphan*/ NSEEL_code_execute(void *);
void *thread1Spawns(void *args) {
  NSEEL_code_execute(args);
  return 0;
}


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

x86 assembly (clang, -O2):
<thread1Spawns>:
push   %rax
call   1030 <NSEEL_code_execute@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @thread1Spawns(i8* %0) {
%2 = tail call i32 @NSEEL_code_execute(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ DMA8_DMA24_DriverIRQHandler();
__attribute__((weak)) void DMA8_DMA24_IRQHandler(void) {
  DMA8_DMA24_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA8_DMA24_IRQHandler() {
%1 = call i32 (...) @DMA8_DMA24_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA8_DMA24_IRQHandler() {
%1 = tail call i32 (...) @DMA8_DMA24_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(unsigned char, unsigned char *);
void SensorGetReg_HV7131GP(unsigned char uAddr, unsigned short *uVal) {
  VIM_SIF_I2cReadByte((unsigned char)uAddr, (unsigned char *)uVal);
}


x86 assembly (clang, -O0):
<SensorGetReg_HV7131GP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorGetReg_HV7131GP>:
jmp    1030 <VIM_SIF_I2cReadByte@plt>

LLVM IR (-O0):
define void @SensorGetReg_HV7131GP(i8 zeroext %0, i16* %1) {
%3 = alloca i8
%4 = alloca i16*
store i8 %0, i8* %3
store i16* %1, i16** %4
%5 = load i8, i8* %3
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i8*
%8 = call i32 @VIM_SIF_I2cReadByte(i8 zeroext %5, i8* %7)
ret void
}

LLVM IR (-O2):
define void @SensorGetReg_HV7131GP(i8 zeroext %0, i16* %1) {
%3 = bitcast i16* %1 to i8*
%4 = tail call i32 @VIM_SIF_I2cReadByte(i8 zeroext %0, i8* %3)
ret void
}
/* Type definitions */
struct _token {
  int dummy;
};
struct _query_parser {
  int dummy;
};
struct _query {
  int dummy;
};
struct _char_list {
  int dummy;
};

/* Variables and functions */
struct _char_list *char_list_initial();
struct _query *query_initial(int /*<<< orphan*/);
int /*<<< orphan*/ term_initial(char *, char *);
struct _query *get_field_query(struct _query_parser *qp, char *field,
                               char *query_text) {
  struct _char_list *termtexts = char_list_initial();
  struct _token *t;
  return query_initial(term_initial(field, query_text));
}


x86 assembly (clang, -O0):
<get_field_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <char_list_initial@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <term_initial@plt>
mov    %eax,%edi
call   1050 <query_initial@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_field_query>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <char_list_initial@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <term_initial@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <query_initial@plt>

LLVM IR (-O0):
%struct._query = type { i32 }
%struct._query_parser = type { i32 }
%struct._char_list = type { i32 }
%struct._token = type { i32 }
define %struct._query* @get_field_query(%struct._query_parser* %0, i8* %1, i8* %2) {
%4 = alloca %struct._query_parser*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct._char_list*
%8 = alloca %struct._token*
store %struct._query_parser* %0, %struct._query_parser** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = call %struct._char_list* (...) @char_list_initial()
store %struct._char_list* %9, %struct._char_list** %7
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @term_initial(i8* %10, i8* %11)
%13 = call %struct._query* @query_initial(i32 %12)
ret %struct._query* %13
}

LLVM IR (-O2):
%struct._query = type { i32 }
%struct._query_parser = type { i32 }
%struct._char_list = type { i32 }
%struct._token = type { i32 }
define %struct._query* @get_field_query(%struct._query_parser* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call %struct._char_list* (...) @char_list_initial()
%5 = tail call i32 @term_initial(i8* %1, i8* %2)
%6 = tail call %struct._query* @query_initial(i32 %5)
ret %struct._query* %6
}
int pause(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @pause() {
ret i32 -1
}
/* Variables and functions */
void *_kmalloc(unsigned int, int /*<<< orphan*/, unsigned int *);
void *kmalloc_p(unsigned size, unsigned *phys) {
  return _kmalloc(size, 0, phys);
}


x86 assembly (clang, -O0):
<kmalloc_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <_kmalloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmalloc_p>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <_kmalloc@plt>

LLVM IR (-O0):
define i8* @kmalloc_p(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 i8* @_kmalloc(i32 %5, i32 0, i32* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @kmalloc_p(i32 %0, i32* %1) {
%3 = tail call i8* @_kmalloc(i32 %0, i32 0, i32* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ kernel();
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ zkernel();
int /*<<< orphan*/ zz_set_kernel_flag(int /*<<< orphan*/);
int /*<<< orphan*/ zz_set_output_stream(int /*<<< orphan*/);
void zz_init(void) {
  zz_set_output_stream(stdout);
  kernel();
  zkernel();
  zz_set_kernel_flag(0);
}


x86 assembly (clang, -O0):
<zz_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1060 <zz_set_output_stream@plt>
mov    $0x0,%al
call   1030 <kernel@plt>
mov    $0x0,%al
call   1050 <zkernel@plt>
xor    %edi,%edi
call   1040 <zz_set_kernel_flag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zz_init>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1060 <zz_set_output_stream@plt>
xor    %eax,%eax
call   1030 <kernel@plt>
xor    %eax,%eax
call   1050 <zkernel@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <zz_set_kernel_flag@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @zz_init() {
%1 = load i32, i32* @stdout
%2 = call i32 @zz_set_output_stream(i32 %1)
%3 = call i32 (...) @kernel()
%4 = call i32 (...) @zkernel()
%5 = call i32 @zz_set_kernel_flag(i32 0)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @zz_init() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @zz_set_output_stream(i32 %1)
%3 = tail call i32 (...) @kernel()
%4 = tail call i32 (...) @zkernel()
%5 = tail call i32 @zz_set_kernel_flag(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M17_f(char *s) {
  debug("M17_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M17_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M17_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M17_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M17_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M17_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M17_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ansi_format(int);
int /*<<< orphan*/ printf(char *, char *, int, int, unsigned char);
void ansi_foreground(unsigned char color) {
  if (color >= 8) {
    printf("%s%d;%d;%dm", "\033[", 30 + 8, 5, color);
  } else {
    ansi_format(30 + color);
  }
}


x86 assembly (clang, -O0):
<ansi_foreground>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jl     1162 <ansi_foreground+0x42>
lea    0xebe(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x26,%edx
mov    $0x5,%ecx
movzbl -0x1(%rbp),%r8d
call   1030 <printf@plt>
jmp    116e <ansi_foreground+0x4e>
movzbl -0x1(%rbp),%edi
add    $0x1e,%edi
call   1040 <ansi_format@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ansi_foreground>:
cmp    $0x8,%dil
jb     1147 <ansi_foreground+0x27>
movzbl %dil,%r8d
lea    0xecf(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x26,%edx
mov    $0x5,%ecx
jmp    1030 <printf@plt>
movzbl %dil,%edi
add    $0x1e,%edi
jmp    1040 <ansi_format@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s%d;%d;%dm\00"
@.str.1 = [3 x i8] c"\1B[\00"
define void @ansi_foreground(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 8
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 38, i32 5, i8 zeroext %7)
br label %14
9: ; preds = %1
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = add nsw i32 30, %11
%13 = call i32 @ansi_format(i32 %12)
br label %14
14: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s%d;%d;%dm\00"
@.str.1 = [3 x i8] c"\1B[\00"
define void @ansi_foreground(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 7
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 38, i32 5, i8 zeroext %0)
br label %9
5: ; preds = %1
%6 = zext i8 %0 to i32
%7 = add nuw nsw i32 %6, 30
%8 = tail call i32 @ansi_format(i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}