xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t strlen(const char *str) {
  size_t size = 0;
  while (*(str++))
    ++size;
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int itex2MML_do_html_filter(char const *, size_t, int /*<<< orphan*/);
int itex2MML_html_filter(const char *buffer, size_t length) {
  return itex2MML_do_html_filter(buffer, length, 0);
}


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

x86 assembly (clang, -O2):
<itex2MML_html_filter>:
xor    %edx,%edx
jmp    1030 <itex2MML_do_html_filter@plt>

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

LLVM IR (-O2):
define i32 @itex2MML_html_filter(i8* %0, i64 %1) {
%3 = tail call i32 @itex2MML_do_html_filter(i8* %0, i64 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
void sync() { __set_errno(ENOSYS); }


x86 assembly (clang, -O0):
<sync>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__set_errno@plt>

LLVM IR (-O0):
@ENOSYS = global i32 0
define void @sync() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret void
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define void @sync() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret void
}
/* Variables and functions */
double ephAngleRed(double);
double ephAzToTheta(double az) { return ephAngleRed(90.0 - az); }


x86 assembly (clang, -O0):
<ephAzToTheta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <ephAngleRed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ephAzToTheta>:
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <ephAngleRed@plt>

LLVM IR (-O0):
define double @ephAzToTheta(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 9.000000e+01, %3
%5 = call double @ephAngleRed(double %4)
ret double %5
}

LLVM IR (-O2):
define double @ephAzToTheta(double %0) {
%2 = fsub double 9.000000e+01, %0
%3 = tail call double @ephAngleRed(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ C_STRTOD(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main() {
  C_STRTOD(NULL, NULL);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <C_STRTOD@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @C_STRTOD(i32* null, i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @C_STRTOD(i32* null, i32* null)
ret i32 0
}
/* Variables and functions */
size_t fmt_strnlen(const char *str, size_t maxlen) {
  const char *tmp = str;
  while (*tmp && maxlen--) {
    tmp++;
  }
  return (tmp - str);
}


x86 assembly (clang, -O0):
<fmt_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1142 <fmt_strnlen+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <fmt_strnlen+0x52>
jmp    1163 <fmt_strnlen+0x63>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <fmt_strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_strnlen>:
cmpb   $0x0,(%rdi)
mov    %rdi,%rax
je     1135 <fmt_strnlen+0x35>
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <fmt_strnlen+0x35>
add    $0xffffffffffffffff,%rsi
mov    %rdi,%rax
nopw   0x0(%rax,%rax,1)
sub    $0x1,%rsi
setb   %cl
cmpb   $0x0,0x1(%rax)
lea    0x1(%rax),%rax
je     1135 <fmt_strnlen+0x35>
test   %cl,%cl
je     1120 <fmt_strnlen+0x20>
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @fmt_strnlen(i8* %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = icmp eq i64 %1, 0
%6 = or i1 %4, %5
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i8* [ %11, %7 ], [ %0, %2 ]
%9 = phi i64 [ %10, %7 ], [ %1, %2 ]
%10 = add i64 %9, -1
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = icmp eq i64 %10, 0
%15 = select i1 %13, i1 true, i1 %14
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i8* [ %0, %2 ], [ %11, %7 ]
%18 = ptrtoint i8* %17 to i64
%19 = ptrtoint i8* %0 to i64
%20 = sub i64 %18, %19
ret i64 %20
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "find"
        " [-H|-L] path... [expression...]\n"
        "  -H	De-reference links unless dangling or in the command line\n"
        "  -L	De-reference links always\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [139 x i8] c"Usage: find [-H|-L] path... [expression...]\0A -H\09De-reference links unless dangling or in the command line\0A -L\09De-reference links always\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [139 x i8] c"Usage: find [-H|-L] path... [expression...]\0A -H\09De-reference links unless dangling or in the command line\0A -L\09De-reference links always\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
char *rfc822_append_text(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *rfc822_append_field(char *ptr, char *fieldname, char *value) {
  char outstr[1024];
  sprintf(outstr, "%s%s\n", fieldname, value);
  return (rfc822_append_text(ptr, outstr));
}


x86 assembly (clang, -O0):
<rfc822_append_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb3(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x420(%rbp),%rsi
call   1040 <rfc822_append_text@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc822_append_field>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xec6(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <rfc822_append_text@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s%s\0A\00"
define i8* @rfc822_append_field(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i8* @rfc822_append_text(i8* %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s%s\0A\00"
define i8* @rfc822_append_field(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%7 = call i8* @rfc822_append_text(i8* %0, i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fill(int length) {
  int j;
  for (j = 0; j < length; j++)
    printf(" ");
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <fill+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <fill+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
push   %rbx
test   %edi,%edi
jle    112f <fill+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <fill+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @fill(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cputime_setup();
int /*<<< orphan*/ loadbang_setup();
int /*<<< orphan*/ namecanvas_setup();
int /*<<< orphan*/ random_setup();
int /*<<< orphan*/ realtime_setup();
int /*<<< orphan*/ serial_setup();
void x_misc_setup(void) {
  random_setup();
  loadbang_setup();
  namecanvas_setup();
  serial_setup();
  cputime_setup();
  realtime_setup();
}


x86 assembly (clang, -O0):
<x_misc_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <random_setup@plt>
mov    $0x0,%al
call   1040 <loadbang_setup@plt>
mov    $0x0,%al
call   1080 <namecanvas_setup@plt>
mov    $0x0,%al
call   1030 <serial_setup@plt>
mov    $0x0,%al
call   1060 <cputime_setup@plt>
mov    $0x0,%al
call   1050 <realtime_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_misc_setup>:
push   %rax
xor    %eax,%eax
call   1070 <random_setup@plt>
xor    %eax,%eax
call   1040 <loadbang_setup@plt>
xor    %eax,%eax
call   1080 <namecanvas_setup@plt>
xor    %eax,%eax
call   1030 <serial_setup@plt>
xor    %eax,%eax
call   1060 <cputime_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <realtime_setup@plt>

LLVM IR (-O0):
define void @x_misc_setup() {
%1 = call i32 (...) @random_setup()
%2 = call i32 (...) @loadbang_setup()
%3 = call i32 (...) @namecanvas_setup()
%4 = call i32 (...) @serial_setup()
%5 = call i32 (...) @cputime_setup()
%6 = call i32 (...) @realtime_setup()
ret void
}

LLVM IR (-O2):
define void @x_misc_setup() {
%1 = tail call i32 (...) @random_setup()
%2 = tail call i32 (...) @loadbang_setup()
%3 = tail call i32 (...) @namecanvas_setup()
%4 = tail call i32 (...) @serial_setup()
%5 = tail call i32 (...) @cputime_setup()
%6 = tail call i32 (...) @realtime_setup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WRITE_VIP32(unsigned long, unsigned long);
void gfx_write_vip32(unsigned long offset, unsigned long value) {
  WRITE_VIP32(offset, value);
}


x86 assembly (clang, -O0):
<gfx_write_vip32>:
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 <WRITE_VIP32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfx_write_vip32>:
jmp    1030 <WRITE_VIP32@plt>

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

LLVM IR (-O2):
define void @gfx_write_vip32(i64 %0, i64 %1) {
%3 = tail call i32 @WRITE_VIP32(i64 %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
double *malloc(int);
int main(void) {
  double *dp = malloc(100 * sizeof(double));
  free(dp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x320,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca double*
%2 = call double* @malloc(i32 800)
store double* %2, double** %1
%3 = load double*, double** %1
%4 = call i32 @free(double* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double* @malloc(i32 800)
%2 = tail call i32 @free(double* %1)
ret i32 0
}
void DisableSPI() {}


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

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

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

LLVM IR (-O2):
define void @DisableSPI() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void *malloc(size_t);
void *s_malloc(size_t size) {
  void *ptr;
  if (!(ptr = malloc(size)))
    error(EXIT_FAILURE, errno, "malloc");
  return ptr;
}


x86 assembly (clang, -O0):
<s_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1161 <s_malloc+0x41>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
lea    0xea4(%rip),%rdx
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <s_malloc+0x2c>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdx
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"malloc\00"
define i8* @s_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = load i32, i32* @errno
%10 = call i32 @error(i32 %8, i32 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %7, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"malloc\00"
define noalias i8* @s_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @errno
%7 = tail call i32 @error(i32 %5, i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t le64toh(uint64_t little_endian_64bits) { return little_endian_64bits; }


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

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

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

LLVM IR (-O2):
define i32 @le64toh(i32 returned %0) {
ret i32 %0
}
int special() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @special() {
ret i32 1
}
void idc(int *p) {
  if (p)
    ;
}


x86 assembly (clang, -O0):
<idc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <idc+0x18>
jmp    1118 <idc+0x18>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @idc(i32* nocapture %0) {
ret void
}
int isLeapYear(int year) {
  return (year % 4 == 0) && (year % 100 != 0 || year % 400 == 0);
}


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <isLeapYear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <isLeapYear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <isLeapYear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <isLeapYear+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x = -4, y;
  y = x >> 1;
  x >>= 1;
  assert(x == -2);
  assert(y == -2);
  assert(((-2) >> 1u) == -1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xfffffffc,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xfffffffe,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xfffffffe,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 -4, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = ashr i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, -2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, -2
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i32 @assert(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void putsize(char *s) {
  if (s != NULL && *s)
    printf("\\s%s", s);
}


x86 assembly (clang, -O0):
<putsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <putsize+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1147 <putsize+0x37>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putsize>:
test   %rdi,%rdi
je     1129 <putsize+0x19>
mov    %rdi,%rsi
cmpb   $0x0,(%rdi)
je     1129 <putsize+0x19>
lea    0xedc(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\\s%s\00"
define void @putsize(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 %13
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %5, %1
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\\s%s\00"
define void @putsize(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %3, %1
ret void
}
void signed_char_or_unsigned_char(signed char *LHS, unsigned char RHS) {
  (*LHS) |= RHS;
}


x86 assembly (clang, -O0):
<signed_char_or_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_or_unsigned_char>:
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_or_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = or i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_or_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = load i8, i8* %0
%4 = or i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int rand();
int simRand(int min, int max) { return (rand() % ((max - min) + 1)) + min; }


x86 assembly (clang, -O0):
<simRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simRand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @simRand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @simRand(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void no_dump(void *ud, const void *item) {
  ((void)(ud));
  ((void)(item));
  return;
}


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

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

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

LLVM IR (-O2):
define void @no_dump(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ kbd_pending();
void kbd_flush(void) {
  for (;;) {
    if (!kbd_pending())
      break;
    getchar();
  }
}


x86 assembly (clang, -O0):
<kbd_flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <kbd_flush+0x9>
mov    $0x0,%al
call   1030 <kbd_pending@plt>
cmp    $0x0,%eax
jne    113e <kbd_flush+0x1e>
jmp    114a <kbd_flush+0x2a>
mov    $0x0,%al
call   1040 <getchar@plt>
jmp    1129 <kbd_flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbd_flush>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <kbd_pending@plt>
test   %eax,%eax
je     1144 <kbd_flush+0x24>
xor    %eax,%eax
call   1040 <getchar@plt>
jmp    1130 <kbd_flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @kbd_flush() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @kbd_pending()
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
br label %7
5: ; preds = %1
%6 = call i32 (...) @getchar()
br label %1
7: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @kbd_flush() {
%1 = tail call i32 (...) @kbd_pending()
%2 = icmp eq i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 (...) @kbd_pending()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
int i_abs(int *);
int intr_wrap_102(int p1) { return i_abs(&p1); }


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

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

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

LLVM IR (-O2):
define i32 @intr_wrap_102(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @i_abs(i32* %2)
ret i32 %3
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int cond_timedwait(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   struct timespec const *);
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
                           const struct timespec *abstime) {
  return cond_timedwait(cond, mutex, abstime);
}


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

x86 assembly (clang, -O2):
<pthread_cond_timedwait>:
jmp    1030 <cond_timedwait@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @pthread_cond_timedwait(i32* %0, i32* %1, %struct.timespec* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca %struct.timespec*
store i32* %0, i32** %4
store i32* %1, i32** %5
store %struct.timespec* %2, %struct.timespec** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load %struct.timespec*, %struct.timespec** %6
%10 = call i32 @cond_timedwait(i32* %7, i32* %8, %struct.timespec* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @pthread_cond_timedwait(i32* %0, i32* %1, %struct.timespec* %2) {
%4 = tail call i32 @cond_timedwait(i32* %0, i32* %1, %struct.timespec* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
void test_19(void) {
  int i, j;
  __analyzer_eval(i == j);
}


x86 assembly (clang, -O0):
<test_19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_19() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @__analyzer_eval(i32 %6)
ret void
}

LLVM IR (-O2):
define void @test_19() {
%1 = tail call i32 @__analyzer_eval(i32 0)
ret void
}
void foo32() {}


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

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

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

LLVM IR (-O2):
define void @foo32() {
ret void
}
/* Variables and functions */
int firstMissingPositive(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int nums[] = {3, 4, -1, 1};
  printf("%d", firstMissingPositive(nums, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <firstMissingPositive@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <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)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <firstMissingPositive@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [4 x i32] [i32 3, i32 4, i32 -1, i32 1]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @firstMissingPositive(i32* %3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int init_module(void) {
  printk("<0>*** Hello World from Module ***\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"<0>*** Hello World from Module ***\0A\00"
define i32 @init_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"<0>*** Hello World from Module ***\0A\00"
define i32 @init_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned int kvm_arch_para_features(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kvm_arch_para_features() {
ret i32 0
}
void batadv_mcast_mla_update(struct batadv_priv *bat_priv) { return; }


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

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

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

LLVM IR (-O2):
%struct.batadv_priv = type opaque
define void @batadv_mcast_mla_update(%struct.batadv_priv* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int get_le32(int /*<<< orphan*/ const *);
uint64_t get_le64(const uint8_t *ptr) {
  return get_le32(ptr) | ((uint64_t)get_le32(ptr + 4) << 32);
}


x86 assembly (clang, -O0):
<get_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_le32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <get_le32@plt>
mov    %eax,%edx
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <get_le32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <get_le32@plt>

LLVM IR (-O0):
define i32 @get_le64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @get_le32(i32* %3)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
%7 = call i32 @get_le32(i32* %6)
%8 = shl i32 %7, 32
%9 = or i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_le64(i32* %0) {
%2 = tail call i32 @get_le32(i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = tail call i32 @get_le32(i32* %3)
ret i32 poison
}
/* Variables and functions */
int round(int);
int kph2knots(int kph) {
  if (kph < 0)
    return kph;
  return round(kph * 250 / 463.0);
}


x86 assembly (clang, -O0):
<kph2knots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1130 <kph2knots+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <kph2knots+0x43>
imul   $0xfa,-0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <round@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kph2knots>:
test   %edi,%edi
js     112f <kph2knots+0x1f>
imul   $0xfa,%edi,%eax
cvtsi2sd %eax,%xmm0
divsd  0xeda(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <round@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @kph2knots(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 250
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 4.630000e+02
%13 = fptosi double %12 to i32
%14 = call i32 @round(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %8, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @kph2knots(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = mul nsw i32 %0, 250
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 4.630000e+02
%7 = fptosi double %6 to i32
%8 = tail call i32 @round(i32 %7)
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ %0, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ HAL_DelayUS(int);
void delay_10us(uint8_t delay) { HAL_DelayUS(10); }


x86 assembly (clang, -O0):
<delay_10us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <HAL_DelayUS@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_10us>:
mov    $0xa,%edi
jmp    1030 <HAL_DelayUS@plt>

LLVM IR (-O0):
define void @delay_10us(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @HAL_DelayUS(i32 10)
ret void
}

LLVM IR (-O2):
define void @delay_10us(i32 %0) {
%2 = tail call i32 @HAL_DelayUS(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void boxless_wakeup_table_footer(__attribute__((unused)) void *report_data) {
  printf("\n");
}


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

x86 assembly (clang, -O2):
<boxless_wakeup_table_footer>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @boxless_wakeup_table_footer(i8* nocapture readnone %0) {
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DUART_GETC();
int /*<<< orphan*/ DUART_INIT();
int /*<<< orphan*/ puts(char *);
int main(void) {
  DUART_INIT();
  puts("Hello world!\n");
  DUART_GETC();
  puts("Done.\n");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <DUART_INIT@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <DUART_GETC@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
jmp    1165 <main+0x35>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <DUART_INIT@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <DUART_GETC@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
nopw   0x0(%rax,%rax,1)
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @DUART_INIT()
%3 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @DUART_GETC()
%5 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %0, %6
br label %6
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @DUART_INIT()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @DUART_GETC()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %5
br label %5
}
int isNum(char ch) { return (ch >= '0' && ch <= '9' ? 1 : 0); }


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isNum+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isNum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int pathconN_nm9_f0(const double **arg, double **res, int *iw, double *w,
                    int mem) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @pathconN_nm9_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @pathconN_nm9_f0(double** nocapture readnone %0, double** nocapture readnone %1, i32* nocapture readnone %2, double* nocapture readnone %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int isdigit(int);
int digit(int c) { return isdigit(c); }


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int q, y;
  q = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (q > 0) {
    q = q - y;
    y = y + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1154 <main+0x44>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %6
15: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Mal schauen was der Magnus so macht.\nDer macht nix\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Mal schauen was der Magnus so macht.\0ADer macht nix\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [51 x i8] c"Mal schauen was der Magnus so macht.\0ADer macht nix\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 0
}