xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getndelim2(char **, size_t *, size_t, int /*<<< orphan*/ *,
                              int, int /*<<< orphan*/, int /*<<< orphan*/);
ssize_t getdelim(char **lineptr, size_t *linesize, int delimiter,
                 FILE *stream) {
  return getndelim2(lineptr, linesize, (size_t)(-1), stream, delimiter, 0, 0);
}


x86 assembly (clang, -O0):
<getdelim>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0xffffffffffffffff,%rdx
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <getndelim2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdelim>:
push   %rax
mov    %edx,%r8d
movl   $0x0,(%rsp)
mov    $0xffffffffffffffff,%rdx
xor    %r9d,%r9d
call   1030 <getndelim2@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getdelim(i8** %0, i64* %1, i32 %2, i32* %3) {
%5 = alloca i8**
%6 = alloca i64*
%7 = alloca i32
%8 = alloca i32*
store i8** %0, i8*** %5
store i64* %1, i64** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8**, i8*** %5
%10 = load i64*, i64** %6
%11 = load i32*, i32** %8
%12 = load i32, i32* %7
%13 = call i32 @getndelim2(i8** %9, i64* %10, i64 -1, i32* %11, i32 %12, i32 0, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @getdelim(i8** %0, i64* %1, i32 %2, i32* %3) {
%5 = tail call i32 @getndelim2(i8** %0, i64* %1, i64 -1, i32* %3, i32 %2, i32 0, i32 0)
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
scalar_t__ fork();
int /*<<< orphan*/ kill(scalar_t__, int /*<<< orphan*/);
void doFork() {
  pid_t child;
  child = fork();
  if (child > 0)
    kill(child, SIGKILL);
}


x86 assembly (clang, -O0):
<doFork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1150 <doFork+0x30>
mov    -0x8(%rbp),%rdi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doFork>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jle    113f <doFork+0x1f>
mov    0x2eac(%rip),%rcx
mov    (%rcx),%esi
mov    %rax,%rdi
pop    %rax
jmp    1030 <kill@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIGKILL = global i32 0
define void @doFork() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i64, i64* %1
%7 = load i32, i32* @SIGKILL
%8 = call i32 @kill(i64 %6, i32 %7)
br label %9
9: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define void @doFork() {
%1 = tail call i64 (...) @fork()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @SIGKILL
%5 = tail call i32 @kill(i64 %1, i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ reset_bit(int /*<<< orphan*/ *, size_t);
int free_bit(uint8_t bitmap[], size_t bits, size_t bit) {
  if (bit < bits) {
    reset_bit(bitmap, bit);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<free_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114b <free_bit+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <reset_bit@plt>
movl   $0x1,-0x4(%rbp)
jmp    1152 <free_bit+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_bit>:
xor    %eax,%eax
cmp    %rsi,%rdx
jae    1129 <free_bit+0x19>
push   %rax
mov    %rdx,%rsi
call   1030 <reset_bit@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @free_bit(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %7
%9 = load i64, i64* %6
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32*, i32** %5
%13 = load i64, i64* %7
%14 = call i32 @reset_bit(i32* %12, i64 %13)
store i32 1, i32* %4
br label %16
15: ; preds = %3
store i32 0, i32* %4
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @free_bit(i32* %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %2, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @reset_bit(i32* %0, i64 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ 1, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
char *my_getcmd();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  char *buf = my_getcmd();
  if (!buf) {
    perror("error");
  }
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <my_getcmd@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <main+0x38>
lea    0xe9d(%rip),%rdi
call   1050 <perror@plt>
mov    -0x18(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <my_getcmd@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1153 <main+0x23>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xea6(%rip),%rdi
call   1050 <perror@plt>
jmp    1140 <main+0x10>

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

LLVM IR (-O2):
@.str = [6 x i8] c"error\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @my_getcmd()
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int f0();
int f1(int);
int f2(int, int);
int main() { return ((f0() + f1(1)) + f2(2, 3)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f0@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1050 <f1@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <f2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <f0@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <f1@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <f2@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f0()
%3 = call i32 @f1(i32 1)
%4 = add nsw i32 %2, %3
%5 = call i32 @f2(i32 2, i32 3)
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f0()
%2 = tail call i32 @f1(i32 1)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @f2(i32 2, i32 3)
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CreateWin41(unsigned long, unsigned long, unsigned long);
void createwin(unsigned long w, unsigned long h, unsigned long c) {
  CreateWin41(w, h, c);
}


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

x86 assembly (clang, -O2):
<createwin>:
jmp    1030 <CreateWin41@plt>

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

LLVM IR (-O2):
define void @createwin(i64 %0, i64 %1, i64 %2) {
%4 = tail call i32 @CreateWin41(i64 %0, i64 %1, i64 %2)
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_insert(struct buffer *, char const *,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void buffer_insert_strlen(struct buffer *buf, const char *data) {
  buffer_insert(buf, data, strlen(data));
}


x86 assembly (clang, -O0):
<buffer_insert_strlen>:
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   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <buffer_insert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_insert_strlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <buffer_insert@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_insert_strlen(%struct.buffer* %0, i8* %1) {
%3 = alloca %struct.buffer*
%4 = alloca i8*
store %struct.buffer* %0, %struct.buffer** %3
store i8* %1, i8** %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @buffer_insert(%struct.buffer* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_insert_strlen(%struct.buffer* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @buffer_insert(%struct.buffer* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printx(int);
int main(void) {
  int i;
  for (i = 1; i < 100; ++i)
    printx(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <printx@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <printx@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printx(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Please enter three integers :\n");
  scanf("%*d %d %*d", &n);
  printf("The expected integer was %d\n", n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Please enter three integers :\0A\00"
@.str.1 = [11 x i8] c"%*d %d %*d\00"
@.str.2 = [29 x i8] c"The expected integer was %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"%*d %d %*d\00"
@.str.2 = [29 x i8] c"The expected integer was %d\0A\00"
@str = [30 x i8] c"Please enter three integers :\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned int net_port_fixup(unsigned int port) {
  if (port <= 0xffff) {
    return port;
  }
  return (port % (0xffff - 1024)) + 1024;
}


x86 assembly (clang, -O0):
<net_port_fixup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffff,-0x8(%rbp)
ja     111f <net_port_fixup+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <net_port_fixup+0x34>
mov    -0x8(%rbp),%eax
mov    $0xfbff,%ecx
xor    %edx,%edx
div    %ecx
add    $0x400,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_port_fixup>:
mov    %edi,%eax
cmp    $0x10000,%edi
jb     1131 <net_port_fixup+0x31>
mov    %eax,%ecx
imul   $0x4114937,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0xf,%edx
imul   $0xfbff,%edx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x400,%eax
ret

LLVM IR (-O0):
define i32 @net_port_fixup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ule i32 %4, 65535
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = urem i32 %9, 64511
%11 = add i32 %10, 1024
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @net_port_fixup(i32 %0) {
%2 = icmp ult i32 %0, 65536
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = urem i32 %0, 64511
%5 = add nuw nsw i32 %4, 1024
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
char *file_to_buffer(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *wr_proc_cmdline(pid_t pid) {
  char target[1024];
  snprintf(target, sizeof(1024) - 1, "/proc/%i/cmdline", pid);
  return file_to_buffer(target);
}


x86 assembly (clang, -O0):
<wr_proc_cmdline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x3,%esi
lea    0xebc(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <file_to_buffer@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wr_proc_cmdline>:
push   %rbx
sub    $0x400,%rsp
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <file_to_buffer@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"/proc/%i/cmdline\00"
define i8* @wr_proc_cmdline(i32 %0) {
%2 = alloca i32
%3 = alloca [1024 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i8* @file_to_buffer(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [17 x i8] c"/proc/%i/cmdline\00"
define i8* @wr_proc_cmdline(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i8* @file_to_buffer(i8* %3)
ret i8* %5
}
reg0reg1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ r0 = r1; }


x86 assembly (clang, -O0):
<reg0reg1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reg0reg1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* %9
store float %16, float* %8
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @reg0reg1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_MultiplyMat4f_init(void) {
  _hmt_register_covercase("HMM_MultiplyMat4f", "1");
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"HMM_MultiplyMat4f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyMat4f_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"HMM_MultiplyMat4f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyMat4f_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void addReplyMultiBulkLen(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               28, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<addReplyMultiBulkLen>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1c,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addReplyMultiBulkLen>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x1c,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyMultiBulkLen = [21 x i8] c"addReplyMultiBulkLen\00"
define void @addReplyMultiBulkLen() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 28, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.addReplyMultiBulkLen, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyMultiBulkLen = [21 x i8] c"addReplyMultiBulkLen\00"
define void @addReplyMultiBulkLen() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 28, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.addReplyMultiBulkLen, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t is_end(char c) { return ((c == '\0') || (c == '\n') || (c == '\r')); }


x86 assembly (clang, -O0):
<is_end>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_end+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_end+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_end>:
mov    $0x1,%eax
test   %dil,%dil
je     1110 <is_end+0x10>
cmp    $0xa,%dil
jne    1111 <is_end+0x11>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_end(i8 signext %0) {
switch i8 %0, label %2 [
i8 10, label %5
i8 0, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void increment(void) {
  auto int auto_var = 0;
  printf("%d\n", auto_var);
  ++auto_var;
  return;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @increment() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
char *conf_get(char *val) {
  char *p;
  if ((p = getenv(val)) == NULL) {
    printf("can't get val conf: %s\n", val);
  }
  return p;
}


x86 assembly (clang, -O0):
<conf_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1153 <conf_get+0x33>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_get>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <conf_get+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"can't get val conf: %s\0A\00"
define i8* @conf_get(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"can't get val conf: %s\0A\00"
define i8* @conf_get(i8* %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
unsigned int dcadec_version(void) {
  return (((0) << 24) | ((0) << 12) | (0) | 0U);
}


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

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

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

LLVM IR (-O2):
define i32 @dcadec_version() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
void *get_XMotionEvent_display(void *_p) {
  return (void *)((XMotionEvent *)_p)->display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XMotionEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XMotionEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int backtrace(void **buffer, int max_frames) {
  (void)buffer;
  (void)max_frames;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @backtrace(i8** nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CMT1_delay_10us(int);
int /*<<< orphan*/ OLED_wrcmd(int);
int /*<<< orphan*/ OLED_wrcmd_db(int, char);
void OLED_contrast(unsigned char contrast) {
  OLED_wrcmd(0x2A);
  CMT1_delay_10us(4);
  OLED_wrcmd(0x79);
  CMT1_delay_10us(4);
  OLED_wrcmd_db(0x81, (char)contrast);
  CMT1_delay_10us(4);
  OLED_wrcmd(0x78);
  CMT1_delay_10us(4);
  OLED_wrcmd(0x28);
  CMT1_delay_10us(4);
}


x86 assembly (clang, -O0):
<OLED_contrast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2a,%edi
call   1050 <OLED_wrcmd@plt>
mov    $0x4,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x79,%edi
call   1050 <OLED_wrcmd@plt>
mov    $0x4,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x81,%edi
movsbl -0x1(%rbp),%esi
call   1030 <OLED_wrcmd_db@plt>
mov    $0x4,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x78,%edi
call   1050 <OLED_wrcmd@plt>
mov    $0x4,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x28,%edi
call   1050 <OLED_wrcmd@plt>
mov    $0x4,%edi
call   1040 <CMT1_delay_10us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OLED_contrast>:
push   %rbx
mov    %edi,%ebx
mov    $0x2a,%edi
call   1050 <OLED_wrcmd@plt>
mov    $0x4,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x79,%edi
call   1050 <OLED_wrcmd@plt>
mov    $0x4,%edi
call   1040 <CMT1_delay_10us@plt>
movsbl %bl,%esi
mov    $0x81,%edi
call   1030 <OLED_wrcmd_db@plt>
mov    $0x4,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x78,%edi
call   1050 <OLED_wrcmd@plt>
mov    $0x4,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x28,%edi
call   1050 <OLED_wrcmd@plt>
mov    $0x4,%edi
pop    %rbx
jmp    1040 <CMT1_delay_10us@plt>

LLVM IR (-O0):
define void @OLED_contrast(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @OLED_wrcmd(i32 42)
%4 = call i32 @CMT1_delay_10us(i32 4)
%5 = call i32 @OLED_wrcmd(i32 121)
%6 = call i32 @CMT1_delay_10us(i32 4)
%7 = load i8, i8* %2
%8 = call i32 @OLED_wrcmd_db(i32 129, i8 signext %7)
%9 = call i32 @CMT1_delay_10us(i32 4)
%10 = call i32 @OLED_wrcmd(i32 120)
%11 = call i32 @CMT1_delay_10us(i32 4)
%12 = call i32 @OLED_wrcmd(i32 40)
%13 = call i32 @CMT1_delay_10us(i32 4)
ret void
}

LLVM IR (-O2):
define void @OLED_contrast(i8 zeroext %0) {
%2 = tail call i32 @OLED_wrcmd(i32 42)
%3 = tail call i32 @CMT1_delay_10us(i32 4)
%4 = tail call i32 @OLED_wrcmd(i32 121)
%5 = tail call i32 @CMT1_delay_10us(i32 4)
%6 = tail call i32 @OLED_wrcmd_db(i32 129, i8 signext %0)
%7 = tail call i32 @CMT1_delay_10us(i32 4)
%8 = tail call i32 @OLED_wrcmd(i32 120)
%9 = tail call i32 @CMT1_delay_10us(i32 4)
%10 = tail call i32 @OLED_wrcmd(i32 40)
%11 = tail call i32 @CMT1_delay_10us(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void stringReverse(char *str) {
  if (*str != '\0') {
    stringReverse(str + 1);
    printf("%c", *str);
  } else {
    return;
  }
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @stringReverse(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @stringReverse(i8* %6)
%7 = load i8, i8* %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %4
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
scalar_t__ iswalpha(scalar_t__);
int iswalnum(wint_t wc) { return (unsigned)wc - '0' < 10 || iswalpha(wc); }


x86 assembly (clang, -O0):
<iswalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
sub    $0x30,%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
jb     1146 <iswalnum+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <iswalpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswalnum>:
lea    -0x30(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xa,%ecx
jb     1132 <iswalnum+0x22>
push   %rax
call   1030 <iswalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @iswalnum(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = sub i32 %4, 48
%6 = icmp ult i32 %5, 10
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i64 @iswalpha(i64 %8)
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iswalnum(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, -48
%4 = icmp ult i32 %3, 10
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i64 @iswalpha(i64 %0)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 1, %1 ], [ %8, %5 ]
ret i32 %10
}
unsigned xrop3_173_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S & D;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_173_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_173_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %edi,%ecx
xor    $0xffffff00,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_173_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_173_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %3
%8 = xor i32 %7, -256
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) {
  printf(
      "Usage: %s\n			--output, -o		Block device "
      "to write to\n			--test, -t		Test number [0 "
      "- 21]\n			--size, -s		Size of the internal "
      "buffers\n			--count, -c		Iteration "
      "count\n			--buffer-type, -b	Buffer type (stack | "
      "heap)\n			--debug, -d		Enables debugging "
      "messages\n			--pattern, -p		Pattern "
      "chosen\n			--help, -h		This help\n",
      prog);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [314 x i8] c"Usage: %s\0A\09\09\09--output, -o\09\09Block device to write to\0A\09\09\09--test, -t\09\09Test number [0 - 21]\0A\09\09\09--size, -s\09\09Size of the internal buffers\0A\09\09\09--count, -c\09\09Iteration count\0A\09\09\09--buffer-type, -b\09Buffer type (stack | heap)\0A\09\09\09--debug, -d\09\09Enables debugging messages\0A\09\09\09--pattern, -p\09\09Pattern chosen\0A\09\09\09--help, -h\09\09This help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [314 x i8] c"Usage: %s\0A\09\09\09--output, -o\09\09Block device to write to\0A\09\09\09--test, -t\09\09Test number [0 - 21]\0A\09\09\09--size, -s\09\09Size of the internal buffers\0A\09\09\09--count, -c\09\09Iteration count\0A\09\09\09--buffer-type, -b\09Buffer type (stack | heap)\0A\09\09\09--debug, -d\09\09Enables debugging messages\0A\09\09\09--pattern, -p\09\09Pattern chosen\0A\09\09\09--help, -h\09\09This help\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void *sspi_InitSecurityInterfaceA();
void *InitSecurityInterfaceA(void) { return sspi_InitSecurityInterfaceA(); }


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

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

LLVM IR (-O0):
define i8* @InitSecurityInterfaceA() {
%1 = call i8* (...) @sspi_InitSecurityInterfaceA()
ret i8* %1
}

LLVM IR (-O2):
define i8* @InitSecurityInterfaceA() {
%1 = tail call i8* (...) @sspi_InitSecurityInterfaceA()
ret i8* %1
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int fork();
pid_t Fork(void) {
  pid_t retval;
  retval = fork();
  if (retval == -1)
    Sys_failure("fork");
  return retval;
}


x86 assembly (clang, -O0):
<Fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1148 <Fork+0x28>
lea    0xebd(%rip),%rdi
call   1030 <Sys_failure@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fork>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    113b <Fork+0x1b>
lea    0xeca(%rip),%rdi
call   1030 <Sys_failure@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"fork\00"
define i32 @Fork() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
void prime_generator() {}


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

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

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

LLVM IR (-O2):
define void @prime_generator() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M_E;
double pow(int /*<<< orphan*/, double);
double fIIII(double x) { return pow(M_E, x); }


x86 assembly (clang, -O0):
<fIIII>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fIIII>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
@M_E = global i32 0
define double @fIIII(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @M_E
%4 = load double, double* %2
%5 = call double @pow(i32 %3, double %4)
ret double %5
}

LLVM IR (-O2):
@M_E = global i32 0
define double @fIIII(double %0) {
%2 = load i32, i32* @M_E
%3 = tail call double @pow(i32 %2, double %0)
ret double %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int fs_check_dir_exists(const char *dirname) {
  struct stat s;
  int ret_code = stat(dirname, &s);
  return !(ret_code == -1 || !(S_ISDIR(s.st_mode)));
}


x86 assembly (clang, -O0):
<fs_check_dir_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0xffffffff,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     115e <fs_check_dir_exists+0x3e>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_check_dir_exists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1141 <fs_check_dir_exists+0x21>
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 }
define i32 @fs_check_dir_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %9, %1
%16 = phi i1 [ true, %1 ], [ %14, %9 ]
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fs_check_dir_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Type definitions */
struct interval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct interval *);
void interval_destroy(struct interval *itv) {
  if (itv)
    free(itv);
}


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

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

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

LLVM IR (-O2):
%struct.interval = type { i32 }
define void @interval_destroy(%struct.interval* %0) {
%2 = icmp eq %struct.interval* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.interval* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t hash_int(uint64_t old_hash, uint64_t key) {
  key = key * 11400714819323198549ULL;
  return old_hash ^ (old_hash >> 13) ^ key;
}


x86 assembly (clang, -O0):
<hash_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x9e3779b97f4a7c55,%rax
79 37 9e
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0xd,%rcx
xor    %rcx,%rax
xor    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_int>:
movabs $0x9e3779b97f4a7c55,%rcx
79 37 9e
imul   %rsi,%rcx
mov    %rdi,%rax
shr    $0xd,%rax
xor    %rdi,%rax
xor    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @hash_int(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = mul i64 %5, -7046029254386353067
store i64 %6, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %3
%9 = lshr i64 %8, 13
%10 = xor i64 %7, %9
%11 = load i64, i64* %4
%12 = xor i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @hash_int(i64 %0, i64 %1) {
%3 = mul i64 %1, -7046029254386353067
%4 = lshr i64 %0, 13
%5 = xor i64 %4, %0
%6 = xor i64 %5, %3
ret i64 %6
}