xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void nerror(char *fmt, int n) {
  char buf[100];
  sprintf(buf, fmt, n);
  error(buf);
}


x86 assembly (clang, -O0):
<nerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <error@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nerror>:
push   %rbx
sub    $0x70,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <error@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @nerror(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [100 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @error(i8* %10)
ret void
}

LLVM IR (-O2):
define void @nerror(i8* nocapture %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i32 %1)
%6 = call i32 @error(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void memory_copy(void *dst, const void *src, size_t size, size_t count) {
  assert(dst && src);
  memcpy(dst, src, size * count);
}


x86 assembly (clang, -O0):
<memory_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x21(%rbp)
je     1153 <memory_copy+0x33>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
imul   -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_copy>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r12
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
imul   %r14,%rbx
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define void @memory_copy(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = icmp ne i8* %0, null
%6 = icmp ne i8* %1, null
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = mul i64 %3, %2
%11 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ string(char *);
void oid_0004(void) { string("Boot version"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Boot version\00"
define void @oid_0004() {
%1 = call i32 @string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Boot version\00"
define void @oid_0004() {
%1 = tail call i32 @string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f159(int *);
int f160(int *p) { return f159(p); }


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

x86 assembly (clang, -O2):
<f160>:
jmp    1030 <f159@plt>

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

LLVM IR (-O2):
define i32 @f160(i32* %0) {
%2 = tail call i32 @f159(i32* %0)
ret i32 %2
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int bee_flock_close(int fd) {
  int res;
  res = close(fd);
  if (res < 0)
    perror("bee_flock_close: close");
  return res;
}


x86 assembly (clang, -O0):
<bee_flock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114c <bee_flock_close+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bee_flock_close>:
push   %rbx
call   1030 <close@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1130 <bee_flock_close+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1040 <perror@plt>
jmp    112c <bee_flock_close+0xc>

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

LLVM IR (-O2):
@.str = [23 x i8] c"bee_flock_close: close\00"
define i32 @bee_flock_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
void starttimer(int timernum) {}


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

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

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

LLVM IR (-O2):
define void @starttimer(i32 %0) {
ret void
}
/* Variables and functions */
void *check_not_null(void *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *result = malloc(size);
  return (check_not_null(result));
}


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

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <check_not_null@plt>

LLVM IR (-O0):
define i8* @xmalloc(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 = load i8*, i8** %3
%7 = call i8* @check_not_null(i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i8* @check_not_null(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int gatsa() {
  printf("Hey gatsa\n");
  return 500;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Hey gatsa\00"
define i32 @gatsa() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 500
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int x = 10;
  while (x < 700) {
    printf("hellooooo!");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x2bc,-0x8(%rbp)
jge    1144 <main+0x34>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@.str = [11 x i8] c"hellooooo!\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %1
}
const char *Call_Name(void) { return "Call"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"Call\00"
define i8* @Call_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"Call\00"
define i8* @Call_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void printHash(void *hash) {}


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

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

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

LLVM IR (-O2):
define void @printHash(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int isdigit(char c) {
  if (c <= '9' && c >= '0') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <isdigit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <isdigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isdigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int Bar(void) {
  return 21;
  return 22;
  return 23;
}


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

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

LLVM IR (-O0):
define i32 @Bar() {
ret i32 21
}

LLVM IR (-O2):
define i32 @Bar() {
ret i32 21
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ STDIN_FILENO;
int read(int /*<<< orphan*/, char *, int);
int getchar(void) {
  char ch;
  int len;
  len = read(STDIN_FILENO, &ch, 1);
  if (len <= 0) {
    return EOF;
  }
  return (int)(unsigned char)ch;
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     114d <getchar+0x3d>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <getchar+0x44>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %eax,%eax
jg     1138 <getchar+0x28>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@EOF = global i32 0
define i32 @getchar() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = load i32, i32* @STDIN_FILENO
%5 = call i32 @read(i32 %4, i8* %2, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i32, i32* @EOF
store i32 %9, i32* %1
br label %13
10: ; preds = %0
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
store i32 %12, i32* %1
br label %13
13: ; preds = %10, %8
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@EOF = global i32 0
define i32 @getchar() {
%1 = alloca i8
%2 = load i32, i32* @STDIN_FILENO
%3 = call i32 @read(i32 %2, i8* %1, i32 1)
%4 = icmp slt i32 %3, 1
%5 = load i32, i32* @EOF
%6 = load i8, i8* %1
%7 = zext i8 %6 to i32
%8 = select i1 %4, i32 %5, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ my_log_error(char *, char const *, double, double);
void my_assert_lessEqualDouble(const char *description, double actualVal,
                               double refVal) {
  if (actualVal > refVal)
    my_log_error(
        "assert failed, \"%s\" must be less or equal than %lf but is %lf\n",
        description, refVal, actualVal);
}


x86 assembly (clang, -O0):
<my_assert_lessEqualDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1150 <my_assert_lessEqualDouble+0x40>
mov    -0x8(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xeb5(%rip),%rdi
call   1030 <my_log_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_assert_lessEqualDouble>:
ucomisd %xmm1,%xmm0
jbe    1131 <my_assert_lessEqualDouble+0x21>
movapd %xmm0,%xmm2
mov    %rdi,%rsi
lea    0xedc(%rip),%rdi
movapd %xmm1,%xmm0
movapd %xmm2,%xmm1
jmp    1030 <my_log_error@plt>
ret

LLVM IR (-O0):
@.str = [63 x i8] c"assert failed, \22%s\22 must be less or equal than %lf but is %lf\0A\00"
define void @my_assert_lessEqualDouble(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = fcmp ogt double %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = load double, double* %6
%13 = load double, double* %5
%14 = call i32 @my_log_error(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %11, double %12, double %13)
br label %15
15: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"assert failed, \22%s\22 must be less or equal than %lf but is %lf\0A\00"
define void @my_assert_lessEqualDouble(i8* %0, double %1, double %2) {
%4 = fcmp ogt double %1, %2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @my_log_error(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0, double %2, double %1)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int umtz_keymatch(const char *hdr, const char *key) {
  return (strncmp(hdr, key, strlen(key)) == 0);
}


x86 assembly (clang, -O0):
<umtz_keymatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umtz_keymatch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @umtz_keymatch(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
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @umtz_keymatch(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void sb_strcpy(char **destination, char *source) {
  *destination = malloc(strlen(source) + 1);
  strcpy(*destination, source);
}


x86 assembly (clang, -O0):
<sb_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @sb_strcpy(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
%9 = load i8**, i8*** %3
store i8* %8, i8** %9
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = load i8*, i8** %4
%13 = call i32 @strcpy(i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @sb_strcpy(i8** nocapture writeonly %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
store i8* %5, i8** %0
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret void
}
void msg_clientcaps(struct TCP_STREAM *stream, struct NetFrame *frame,
                    struct StringReassembler *data) {
  data = (data);
  frame = (frame);
}


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

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

LLVM IR (-O0):
%struct.TCP_STREAM = type opaque
%struct.NetFrame = type opaque
%struct.StringReassembler = type opaque
define void @msg_clientcaps(%struct.TCP_STREAM* %0, %struct.NetFrame* %1, %struct.StringReassembler* %2) {
%4 = alloca %struct.TCP_STREAM*
%5 = alloca %struct.NetFrame*
%6 = alloca %struct.StringReassembler*
store %struct.TCP_STREAM* %0, %struct.TCP_STREAM** %4
store %struct.NetFrame* %1, %struct.NetFrame** %5
store %struct.StringReassembler* %2, %struct.StringReassembler** %6
%7 = load %struct.StringReassembler*, %struct.StringReassembler** %6
store %struct.StringReassembler* %7, %struct.StringReassembler** %6
%8 = load %struct.NetFrame*, %struct.NetFrame** %5
store %struct.NetFrame* %8, %struct.NetFrame** %5
ret void
}

LLVM IR (-O2):
%struct.TCP_STREAM = type opaque
%struct.NetFrame = type opaque
%struct.StringReassembler = type opaque
define void @msg_clientcaps(%struct.TCP_STREAM* nocapture %0, %struct.NetFrame* nocapture %1, %struct.StringReassembler* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, const char *file,
                        int line, int before_p) {
  abort();
}


x86 assembly (clang, -O0):
<CRYPTO_dbg_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<CRYPTO_dbg_realloc>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @CRYPTO_dbg_realloc(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @CRYPTO_dbg_realloc(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4, i32 %5) {
%7 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void g_assertion_message_cmpnum(const char *domain, const char *file, int line,
                                const char *func, const char *expr,
                                long double arg1, const char *cmp,
                                long double arg2, char numtype) {
  abort();
}


x86 assembly (clang, -O0):
<g_assertion_message_cmpnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x30(%rbp),%al
fldt   0x20(%rbp)
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
fstpt  -0x40(%rbp)
mov    %r9,-0x48(%rbp)
fstpt  -0x60(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<g_assertion_message_cmpnum>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @g_assertion_message_cmpnum(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, x86_fp80 %5, i8* %6, x86_fp80 %7, i8 signext %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca x86_fp80
%16 = alloca i8*
%17 = alloca x86_fp80
%18 = alloca i8
store i8* %0, i8** %10
store i8* %1, i8** %11
store i32 %2, i32* %12
store i8* %3, i8** %13
store i8* %4, i8** %14
store x86_fp80 %5, x86_fp80* %15
store i8* %6, i8** %16
store x86_fp80 %7, x86_fp80* %17
store i8 %8, i8* %18
%19 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @g_assertion_message_cmpnum(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i8* nocapture readnone %4, x86_fp80 %5, i8* nocapture readnone %6, x86_fp80 %7, i8 signext %8) {
%10 = tail call i32 (...) @abort()
unreachable
}
const char *SPM_VendorNameString() { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @SPM_VendorNameString() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @SPM_VendorNameString() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_spi_end();
void tftglTerminateTouch() { bcm2835_spi_end(); }


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

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

LLVM IR (-O0):
define void @tftglTerminateTouch() {
%1 = call i32 (...) @bcm2835_spi_end()
ret void
}

LLVM IR (-O2):
define void @tftglTerminateTouch() {
%1 = tail call i32 (...) @bcm2835_spi_end()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ initscreen();
int /*<<< orphan*/ system(char *);
int main(void) {
  int row = 0, col = 0;
  initscreen();
  clear();
  system("clear");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <initscreen@plt>
mov    $0x0,%al
call   1050 <clear@plt>
lea    0xe9e(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscreen@plt>
xor    %eax,%eax
call   1050 <clear@plt>
lea    0xeba(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define i32 @main() {
%1 = tail call i32 (...) @initscreen()
%2 = tail call i32 (...) @clear()
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *iosr_read();
unsigned int dps_utim64_flags(void) {
  char *iosr = iosr_read();
  return *(volatile unsigned int *)(iosr + 0x07c);
}


x86 assembly (clang, -O0):
<dps_utim64_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <iosr_read@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x7c(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dps_utim64_flags>:
push   %rax
xor    %eax,%eax
call   1030 <iosr_read@plt>
mov    0x7c(%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dps_utim64_flags() {
%1 = alloca i8*
%2 = call i8* (...) @iosr_read()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 124
%5 = bitcast i8* %4 to i32*
%6 = load volatile i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @dps_utim64_flags() {
%1 = tail call i8* (...) @iosr_read()
%2 = getelementptr inbounds i8, i8* %1, i64 124
%3 = bitcast i8* %2 to i32*
%4 = load volatile i32, i32* %3
ret i32 %4
}
int placeholder() { return 42; }


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

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

LLVM IR (-O0):
define i32 @placeholder() {
ret i32 42
}

LLVM IR (-O2):
define i32 @placeholder() {
ret i32 42
}
char *strchrnul(char *s, int c) {
  do
    if (*s == c)
      break;
  while (*s++);
  return s;
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1120 <strchrnul+0x20>
jmp    113d <strchrnul+0x3d>
jmp    1125 <strchrnul+0x25>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    110b <strchrnul+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     111f <strchrnul+0x1f>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchrnul+0x10>
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %5, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %8
%12 = phi i8* [ %4, %3 ], [ %9, %8 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ f1();
void f4(int k) {
  k = 1;
  if (k)
    f1();
  k = 2;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1133 <f4+0x23>
mov    $0x0,%al
call   1030 <f1@plt>
movl   $0x2,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f4(i32 %0) {
%2 = tail call i32 (...) @f1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strongComponents();
int main(void) {
  printf("Силно свързаните компоненти в графа са:\n");
  strongComponents();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [74 x i8] c"\D0\A1\D0\B8\D0\BB\D0\BD\D0\BE \D1\81\D0\B2\D1\8A\D1\80\D0\B7\D0\B0\D0\BD\D0\B8\D1\82\D0\B5 \D0\BA\D0\BE\D0\BC\D0\BF\D0\BE\D0\BD\D0\B5\D0\BD\D1\82\D0\B8 \D0\B2 \D0\B3\D1\80\D0\B0\D1\84\D0\B0 \D1\81\D0\B0:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @strongComponents()
ret i32 0
}

LLVM IR (-O2):
@str = [73 x i8] c"\D0\A1\D0\B8\D0\BB\D0\BD\D0\BE \D1\81\D0\B2\D1\8A\D1\80\D0\B7\D0\B0\D0\BD\D0\B8\D1\82\D0\B5 \D0\BA\D0\BE\D0\BC\D0\BF\D0\BE\D0\BD\D0\B5\D0\BD\D1\82\D0\B8 \D0\B2 \D0\B3\D1\80\D0\B0\D1\84\D0\B0 \D1\81\D0\B0:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @strongComponents()
ret i32 0
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int offset(int, int, int, int);
int owl_big_eyespace(int, int);
int autohelperowl_vital_apat20(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int a, B;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(1, 0, move, transformation);
  B = offset(0, 1, move, transformation);
  return owl_big_eyespace(a, B);
}


x86 assembly (clang, -O0):
<autohelperowl_vital_apat20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <offset@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1040 <owl_big_eyespace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_vital_apat20>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    $0x1,%edi
xor    %esi,%esi
mov    %ebp,%ecx
call   1030 <offset@plt>
mov    %eax,%r14d
xor    %edi,%edi
mov    $0x1,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1030 <offset@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <owl_big_eyespace@plt>

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_vital_apat20(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load %struct.pattern*, %struct.pattern** %6
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = call i32 @offset(i32 1, i32 0, i32 %16, i32 %17)
store i32 %18, i32* %11
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = call i32 @offset(i32 0, i32 1, i32 %19, i32 %20)
store i32 %21, i32* %12
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = call i32 @owl_big_eyespace(i32 %22, i32 %23)
ret i32 %24
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_vital_apat20(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 1, i32 0, i32 %2, i32 %1)
%7 = tail call i32 @offset(i32 0, i32 1, i32 %2, i32 %1)
%8 = tail call i32 @owl_big_eyespace(i32 %6, i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void logChangesToSyslog(char message[]) { syslog(LOG_NOTICE, message); }


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

x86 assembly (clang, -O2):
<logChangesToSyslog>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
define void @logChangesToSyslog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_NOTICE
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
define void @logChangesToSyslog(i8* %0) {
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @syslog(i32 %2, i8* %0)
ret void
}
void crazyflie_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @crazyflie_terminate() {
ret void
}
void STAMR3GetUnit(void) {}


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

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

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

LLVM IR (-O2):
define void @STAMR3GetUnit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(scalar_t__);
scalar_t__ memcpy(int /*<<< orphan*/, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *strdup(const char *str) {
  return (char *)memcpy(malloc(strlen(str) + 1), str, strlen(str) + 1);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @malloc(i64 %5)
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i64 @memcpy(i32 %6, i8* %7, i64 %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @malloc(i64 %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add nsw i64 %5, 1
%7 = tail call i64 @memcpy(i32 %4, i8* %0, i64 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
char *dummy_gettext(const char *msgid) { return (char *)(msgid); }


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

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

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

LLVM IR (-O2):
define i8* @dummy_gettext(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t crc32_update_bit(uint32_t remainder, uint8_t next_bit) {
  return (remainder >> 1) ^ (((remainder ^ next_bit) & 1) ? 0xEDB88320 : 0);
}


x86 assembly (clang, -O0):
<crc32_update_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%esi
xor    -0x8(%rbp),%esi
and    $0x1,%esi
xor    %ecx,%ecx
mov    $0xedb88320,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_update_bit>:
mov    %esi,%eax
xor    %edi,%eax
sar    %edi
and    $0x1,%eax
neg    %eax
and    $0xedb88320,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @crc32_update_bit(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 = ashr i32 %5, 1
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -306674912, i32 0
%14 = xor i32 %6, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @crc32_update_bit(i32 %0, i32 %1) {
%3 = ashr i32 %0, 1
%4 = xor i32 %1, %0
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 0, i32 -306674912
%8 = xor i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void puts_nonl(const char *buf) {
  while (*buf) {
    putchar(*buf++);
  }
}


x86 assembly (clang, -O0):
<puts_nonl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts_nonl+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <puts_nonl+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts_nonl>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts_nonl+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts_nonl+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts_nonl(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
scalar_t__ lstat(char *, struct stat *);
int sd_booted(void) {
  struct stat st;
  if (lstat("/run/systemd/system/", &st) < 0)
    return 0;
  return !!S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<sd_booted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
jge    114e <sd_booted+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1168 <sd_booted+0x48>
mov    -0x8(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_booted>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <lstat@plt>
test   %rax,%rax
js     1148 <sd_booted+0x28>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [21 x i8] c"/run/systemd/system/\00"
define i32 @sd_booted() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = call i64 @lstat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %14
6: ; preds = %0
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %6, %5
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [21 x i8] c"/run/systemd/system/\00"
define i32 @sd_booted() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i64 @lstat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @S_ISDIR(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %0, %5
%12 = phi i32 [ %10, %5 ], [ 0, %0 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
char *strerror(int);
scalar_t__ strlen(char *);
int main() {
  char *error1 = strerror(500);
  char *error2 = strerror(501);
  printf("%d\n", strlen(error1) > 0);
  printf("%d\n", strlen(error2) > 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1f4,%edi
call   1050 <strerror@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1f5,%edi
call   1050 <strerror@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1f4,%edi
call   1050 <strerror@plt>
mov    %rax,%rbx
mov    $0x1f5,%edi
call   1050 <strerror@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %esi,%esi
test   %rax,%rax
setg   %sil
lea    0xe9a(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %esi,%esi
test   %rax,%rax
setg   %sil
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @strerror(i32 500)
store i8* %3, i8** %1
%4 = call i8* @strerror(i32 501)
store i8* %4, i8** %2
%5 = load i8*, i8** %1
%6 = call i64 @strlen(i8* %5)
%7 = icmp sgt i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %2
%11 = call i64 @strlen(i8* %10)
%12 = icmp sgt i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i8* @strerror(i32 500)
%2 = tail call i8* @strerror(i32 501)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = icmp sgt i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rmdir(char *);
int /*<<< orphan*/ unlink(char *);
void cleanup() {
  rmdir("nocanread");
  unlink("foobar/file.txt");
  rmdir("foobar");
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xed3(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed7(%rip),%rdi
call   1040 <rmdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xed6(%rip),%rdi
call   1030 <unlink@plt>
lea    0xeda(%rip),%rdi
pop    %rax
jmp    1040 <rmdir@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"nocanread\00"
@.str.1 = [16 x i8] c"foobar/file.txt\00"
@.str.2 = [7 x i8] c"foobar\00"
define void @cleanup() {
%1 = call i32 @rmdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"nocanread\00"
@.str.1 = [16 x i8] c"foobar/file.txt\00"
@.str.2 = [7 x i8] c"foobar\00"
define void @cleanup() {
%1 = tail call i32 @rmdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}