xunge/DecIR huggingface dataset:
/* Variables and functions */
int ioctl(int, int, int /*<<< orphan*/);
int om_touchscreen_unlock(int fd) { return ioctl(fd, 0x40044590, 0); }


x86 assembly (clang, -O0):
<om_touchscreen_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x40044590,%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_touchscreen_unlock>:
mov    $0x40044590,%esi
xor    %edx,%edx
jmp    1030 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @om_touchscreen_unlock(i32 %0) {
%2 = tail call i32 @ioctl(i32 %0, i32 1074021776, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int cleanup_file_name(char *file_name) {
  if (file_name != NULL) {
    free(file_name);
    file_name = NULL;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cleanup_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <cleanup_file_name+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x4(%rbp)
jmp    114b <cleanup_file_name+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_file_name>:
test   %rdi,%rdi
je     1125 <cleanup_file_name+0x15>
push   %rax
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cleanup_file_name(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 1, %3 ], [ 0, %1 ]
ret i32 %6
}
char *strcat(char *dest, const char *src) {
  char *p = dest;
  while (*p)
    ++p;
  while ((*p++ = *src++) != 0)
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116a <strcat+0x6a>
jmp    1137 <strcat+0x37>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_cmpeq_epi16(__m128i A, __m128i B) {
  return _mm_cmpeq_epi16(A, B);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpeq_epi16>:
jmp    1030 <_mm_cmpeq_epi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpeq_epi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_epi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *strrchr(char *, char);
char *file_type(char *f) {
  char *cp;
  if ((cp = strrchr(f, '.')) != NULL) {
    return cp + 1;
  }
  return "";
}


x86 assembly (clang, -O0):
<file_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1149 <file_type+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <file_type+0x44>
lea    0xeb0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_type>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xed7(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @file_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %12
11: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @file_type(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
/* Variables and functions */
int memcmp(void const *, void const *, size_t);
int bcmp(const void *p1, const void *p2, size_t n) { return memcmp(p1, p2, n); }


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

x86 assembly (clang, -O2):
<bcmp>:
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @bcmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ list_pushBack(void *, void *);
void list_translate(void *el, void *l2) { list_pushBack(l2, el); }


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

x86 assembly (clang, -O2):
<list_translate>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <list_pushBack@plt>

LLVM IR (-O0):
define void @list_translate(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 = load i8*, i8** %3
%7 = call i32 @list_pushBack(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @list_translate(i8* %0, i8* %1) {
%3 = tail call i32 @list_pushBack(i8* %1, i8* %0)
ret void
}
void free_grid(char **grid) {
  int i;
  i = -1;
  while (++i < 9)
    free(grid[i]);
  free(grid);
}


x86 assembly (clang, -O0):
<free_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x9,%eax
jge    114b <free_grid+0x3b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1123 <free_grid+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_grid>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
mov    0x10(%rbx),%rdi
call   1030 <free@plt>
mov    0x18(%rbx),%rdi
call   1030 <free@plt>
mov    0x20(%rbx),%rdi
call   1030 <free@plt>
mov    0x28(%rbx),%rdi
call   1030 <free@plt>
mov    0x30(%rbx),%rdi
call   1030 <free@plt>
mov    0x38(%rbx),%rdi
call   1030 <free@plt>
mov    0x40(%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_grid(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 -1, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = icmp slt i32 %6, 9
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i8**, i8*** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8*, i8** %9, i64 %11
%13 = load i8*, i8** %12
br label %4
14: ; preds = %4
%15 = load i8**, i8*** %2
%16 = bitcast i8** %15 to i8*
ret void
}

LLVM IR (-O2):
define void @free_grid(i8** nocapture %0) {
%2 = load i8*, i8** %0
tail call void @free(i8* %2)
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
%5 = getelementptr inbounds i8*, i8** %0, i64 2
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = getelementptr inbounds i8*, i8** %0, i64 3
%8 = load i8*, i8** %7
tail call void @free(i8* %8)
%9 = getelementptr inbounds i8*, i8** %0, i64 4
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = getelementptr inbounds i8*, i8** %0, i64 5
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = getelementptr inbounds i8*, i8** %0, i64 6
%14 = load i8*, i8** %13
tail call void @free(i8* %14)
%15 = getelementptr inbounds i8*, i8** %0, i64 7
%16 = load i8*, i8** %15
tail call void @free(i8* %16)
%17 = getelementptr inbounds i8*, i8** %0, i64 8
%18 = load i8*, i8** %17
tail call void @free(i8* %18)
%19 = bitcast i8** %0 to i8*
tail call void @free(i8* %19)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *gc_get_state();
int /*<<< orphan*/ printf(char *, ...);
void gc_dump() {
  printf("--------------\n");
  char *s = gc_get_state();
  printf("%s", s);
  free(s);
}


x86 assembly (clang, -O0):
<gc_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <gc_get_state@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gc_dump>:
push   %rbx
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <gc_get_state@plt>
mov    %rax,%rbx
lea    0xea2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"--------------\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @gc_dump() {
%1 = alloca i8*
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i8* (...) @gc_get_state()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [15 x i8] c"--------------\00"
define void @gc_dump() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i8* (...) @gc_get_state()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ my_exit(int /*<<< orphan*/);
void signalHandler(int sig) { my_exit(EXIT_SUCCESS); }


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

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @signalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @my_exit(i32 %3)
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @signalHandler(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @my_exit(i32 %2)
ret void
}
/* Variables and functions */
unsigned long gcd(unsigned long, unsigned long);
unsigned long int lcm(unsigned long int a, unsigned long int b) {
  return a * b / gcd(a, b);
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
xor    %edx,%edx
div    %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %rsi,%rbx
imul   %rdi,%rbx
call   1030 <gcd@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1133 <lcm+0x23>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @lcm(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i64 @gcd(i64 %8, i64 %9)
%11 = udiv i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @lcm(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i64 @gcd(i64 %0, i64 %1)
%5 = udiv i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int i2c_read_reg(int);
int i2c_read_command() { return i2c_read_reg(6); }


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

x86 assembly (clang, -O2):
<i2c_read_command>:
mov    $0x6,%edi
jmp    1030 <i2c_read_reg@plt>

LLVM IR (-O0):
define i32 @i2c_read_command() {
%1 = call i32 @i2c_read_reg(i32 6)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i2c_read_command() {
%1 = tail call i32 @i2c_read_reg(i32 6)
ret i32 %1
}
/* Variables and functions */
int f340(int *);
int f341(int *p) { return f340(p); }


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

x86 assembly (clang, -O2):
<f341>:
jmp    1030 <f340@plt>

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

LLVM IR (-O2):
define i32 @f341(i32* %0) {
%2 = tail call i32 @f340(i32* %0)
ret i32 %2
}
int comp_func(const void *a, const void *b) {
  double *x = (double *)a;
  double *y = (double *)b;
  if (*x < *y) {
    return -1;
  } else if (*x > *y)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<comp_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <comp_func+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <comp_func+0x70>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <comp_func+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1170 <comp_func+0x70>
jmp    1169 <comp_func+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_func>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comp_func(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %27
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp ogt double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %27
25: ; preds = %18
br label %26
26: ; preds = %25
store i32 0, i32* %3
br label %27
27: ; preds = %26, %24, %17
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @comp_func(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct Dwarf_Tied_Entry_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Dwarf_Tied_Entry_s *);
void _dwarf_tied_destroy_free_node(void *nodep) {
  struct Dwarf_Tied_Entry_s *enp = nodep;
  free(enp);
  return;
}


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

x86 assembly (clang, -O2):
<_dwarf_tied_destroy_free_node>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Dwarf_Tied_Entry_s = type { i32 }
define void @_dwarf_tied_destroy_free_node(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.Dwarf_Tied_Entry_s*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.Dwarf_Tied_Entry_s*
store %struct.Dwarf_Tied_Entry_s* %5, %struct.Dwarf_Tied_Entry_s** %3
%6 = load %struct.Dwarf_Tied_Entry_s*, %struct.Dwarf_Tied_Entry_s** %3
%7 = call i32 @free(%struct.Dwarf_Tied_Entry_s* %6)
ret void
}

LLVM IR (-O2):
%struct.Dwarf_Tied_Entry_s = type { i32 }
define void @_dwarf_tied_destroy_free_node(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.Dwarf_Tied_Entry_s*
%3 = tail call i32 @free(%struct.Dwarf_Tied_Entry_s* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xeb() {
  Assert_real((isspace(235) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1180, ("isspace should be 0 for 0xeb"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xeb>:
push   %rax
mov    $0xeb,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x49c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xeb\00"
define void @t_isspace_0xeb() {
%1 = call i64 @isspace(i32 235)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1180, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xeb\00"
define void @t_isspace_0xeb() {
%1 = tail call i64 @isspace(i32 235)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1180, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void pong_and_receive_data(int client_sockfd, char *buffer) {
  write(client_sockfd, "pong", strlen("pong"));
  memset(buffer, '\0', sizeof(buffer));
  read(client_sockfd, buffer, 512);
}


x86 assembly (clang, -O0):
<pong_and_receive_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xea4(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xe93(%rip),%rsi
call   1030 <write@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x200,%edx
call   1060 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pong_and_receive_data>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb0(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x200,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <read@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"pong\00"
define void @pong_and_receive_data(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @write(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %4
%9 = call i32 @memset(i8* %8, i8 signext 0, i32 8)
%10 = load i32, i32* %3
%11 = load i8*, i8** %4
%12 = call i32 @read(i32 %10, i8* %11, i32 512)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"pong\00"
define void @pong_and_receive_data(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @memset(i8* %1, i8 signext 0, i32 8)
%6 = tail call i32 @read(i32 %0, i8* %1, i32 512)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ErrorHandler(int);
char *ReadFile(char *);
int /*<<< orphan*/ ReadNeighborhoodMatrix(char *);
void PrepareNeighborHoodMatrix(int argc, char *argv[]) {
  char *readFile;
  if (argc < 2)
    ErrorHandler(-1);
  readFile = ReadFile(argv[1]);
  if (readFile == NULL)
    ErrorHandler(-3);
  ReadNeighborhoodMatrix(readFile);
}


x86 assembly (clang, -O0):
<PrepareNeighborHoodMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1153 <PrepareNeighborHoodMatrix+0x23>
mov    $0xffffffff,%edi
call   1040 <ErrorHandler@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ReadFile@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1179 <PrepareNeighborHoodMatrix+0x49>
mov    $0xfffffffd,%edi
call   1040 <ErrorHandler@plt>
mov    -0x18(%rbp),%rdi
call   1050 <ReadNeighborhoodMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrepareNeighborHoodMatrix>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1143 <PrepareNeighborHoodMatrix+0x13>
mov    $0xffffffff,%edi
call   1040 <ErrorHandler@plt>
mov    0x8(%rbx),%rdi
call   1030 <ReadFile@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115e <PrepareNeighborHoodMatrix+0x2e>
mov    $0xfffffffd,%edi
call   1040 <ErrorHandler@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <ReadNeighborhoodMatrix@plt>

LLVM IR (-O0):
define void @PrepareNeighborHoodMatrix(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @ErrorHandler(i32 -1)
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i8* @ReadFile(i8* %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = call i32 @ErrorHandler(i32 -3)
br label %19
19: ; preds = %17, %10
%20 = load i8*, i8** %5
%21 = call i32 @ReadNeighborhoodMatrix(i8* %20)
ret void
}

LLVM IR (-O2):
define void @PrepareNeighborHoodMatrix(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @ErrorHandler(i32 -1)
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i8* @ReadFile(i8* %8)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @ErrorHandler(i32 -3)
br label %13
13: ; preds = %11, %6
%14 = tail call i32 @ReadNeighborhoodMatrix(i8* %9)
ret void
}
void abajo(int x, int y, int mat[3][3]) {
  int q;
  q = mat[x + 1][y];
  mat[x][y] = q;
  mat[x + 1][y] = 0;
}


x86 assembly (clang, -O0):
<abajo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<abajo>:
lea    0x1(%rdi),%eax
cltq
movslq %esi,%rcx
lea    (%rax,%rax,2),%rax
lea    (%rdx,%rax,4),%rax
mov    (%rax,%rcx,4),%esi
movslq %edi,%rdi
lea    (%rdi,%rdi,2),%rdi
lea    (%rdx,%rdi,4),%rdx
mov    %esi,(%rdx,%rcx,4)
movl   $0x0,(%rax,%rcx,4)
ret

LLVM IR (-O0):
define void @abajo(i32 %0, i32 %1, [3 x i32]* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca [3 x i32]*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store [3 x i32]* %2, [3 x i32]** %6
%8 = load [3 x i32]*, [3 x i32]** %6
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 %11
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %12, i64 0, i64 %14
%16 = load i32, i32* %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load [3 x i32]*, [3 x i32]** %6
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %18, i64 %20
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %21, i64 0, i64 %23
store i32 %17, i32* %24
%25 = load [3 x i32]*, [3 x i32]** %6
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %25, i64 %28
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %29, i64 0, i64 %31
store i32 0, i32* %32
ret void
}

LLVM IR (-O2):
define void @abajo(i32 %0, i32 %1, [3 x i32]* nocapture %2) {
%4 = add nsw i32 %0, 1
%5 = sext i32 %4 to i64
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 %5, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 %9, i64 %6
store i32 %8, i32* %10
store i32 0, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nice(int);
void setPriotity(int pr) { nice(pr); }


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

x86 assembly (clang, -O2):
<setPriotity>:
jmp    1030 <nice@plt>

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

LLVM IR (-O2):
define void @setPriotity(i32 %0) {
%2 = tail call i32 @nice(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, double);
double sin(int);
void main() {
  int x = 3;
  double y;
  y = sin(58 * 3.14159 / 180);
  printf("%f\n", y);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <sin@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @main() {
%1 = tail call double @sin(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BannerMsg(char *, int);
int /*<<< orphan*/ ms_sleep(int);
int main() {
  int i;
  int j;
  j = 0;
  i = 0;
  BannerMsg("balle", 10);
  ms_sleep(1000);
  BannerMsg("Hi Natasha balle", 10);
  ms_sleep(1000);
  BannerMsg("elepahnant fballe", 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec7(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xea1(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xe97(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee3(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xebd(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xeb3(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"balle\00"
@.str.1 = [17 x i8] c"Hi Natasha balle\00"
@.str.2 = [18 x i8] c"elepahnant fballe\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
%4 = call i32 @BannerMsg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = call i32 @ms_sleep(i32 1000)
%6 = call i32 @BannerMsg(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 10)
%7 = call i32 @ms_sleep(i32 1000)
%8 = call i32 @BannerMsg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"balle\00"
@.str.1 = [17 x i8] c"Hi Natasha balle\00"
@.str.2 = [18 x i8] c"elepahnant fballe\00"
define i32 @main() {
%1 = tail call i32 @BannerMsg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @ms_sleep(i32 1000)
%3 = tail call i32 @BannerMsg(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 10)
%4 = tail call i32 @ms_sleep(i32 1000)
%5 = tail call i32 @BannerMsg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(void *, int, size_t, void *);
int fd_putchar(void *ctx, size_t count, void *c) {
  fwrite(c, sizeof(char), count, ctx);
  return 0;
}


x86 assembly (clang, -O0):
<fd_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_putchar>:
push   %rax
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rcx
mov    %rax,%rdi
mov    $0x1,%esi
call   1030 <fwrite@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fd_putchar(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i32 @fwrite(i8* %2, i32 1, i64 %1, i8* %0)
ret i32 0
}
int tls13_server_finished_send(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_server_finished_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
int initialize_gyroscope_sensor(struct ssp_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @initialize_gyroscope_sensor(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int memcmp(void const *, void const *, size_t);
int _hs_text_memcmp(const void *a, size_t aoff, const void *b, size_t boff,
                    size_t n) {
  return memcmp(a + (aoff << 1), b + (boff << 1), n << 1);
}


x86 assembly (clang, -O0):
<_hs_text_memcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
shl    $0x1,%rdx
call   1030 <memcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hs_text_memcmp>:
lea    (%rdi,%rsi,2),%rdi
lea    (%rdx,%rcx,2),%rsi
lea    (%r8,%r8,1),%rdx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @_hs_text_memcmp(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = shl i64 %12, 1
%14 = getelementptr i8, i8* %11, i64 %13
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = shl i64 %16, 1
%18 = getelementptr i8, i8* %15, i64 %17
%19 = load i64, i64* %10
%20 = shl i64 %19, 1
%21 = call i32 @memcmp(i8* %14, i8* %18, i64 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @_hs_text_memcmp(i8* nocapture %0, i64 %1, i8* nocapture %2, i64 %3, i64 %4) {
%6 = shl i64 %1, 1
%7 = getelementptr i8, i8* %0, i64 %6
%8 = shl i64 %3, 1
%9 = getelementptr i8, i8* %2, i64 %8
%10 = shl i64 %4, 1
%11 = tail call i32 @memcmp(i8* %7, i8* %9, i64 %10)
ret i32 %11
}
int bootstage_relocate(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bootstage_relocate() {
ret i32 0
}
void I2CSlaveIntEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntEnable>:
orq    $0x1,0xc(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntEnable(i64 %0) {
%2 = add i64 %0, 12
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 1
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ power_1(double *, double const *, double const *);
void power_value(const double r, const double *p, double *f) {
  double power = 0;
  power_1(&power, &r, &p[1]);
  *f = p[0] * power;
}


x86 assembly (clang, -O0):
<power_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
add    $0x8,%rdx
lea    -0x20(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <power_1@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_value>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rdi),%rdx
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <power_1@plt>
movsd  (%rbx),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @power_value(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
store double 0.000000e+00, double* %7
%8 = load double*, double** %5
%9 = getelementptr inbounds double, double* %8, i64 1
%10 = call i32 @power_1(double* %7, double* %4, double* %9)
%11 = load double*, double** %5
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = load double*, double** %6
store double %15, double* %16
ret void
}

LLVM IR (-O2):
define void @power_value(double %0, double* %1, double* nocapture writeonly %2) {
%4 = alloca double
%5 = alloca double
store double %0, double* %4
%6 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = call i32 @power_1(double* %5, double* %4, double* %7)
%9 = load double, double* %1
%10 = load double, double* %5
%11 = fmul double %9, %10
store double %11, double* %2
ret void
}
void controly() {}


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

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

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

LLVM IR (-O2):
define void @controly() {
ret void
}
/* Variables and functions */
int debug_msg();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void debug_say_nocr(char *msg) {
  if (debug_msg() == 1)
    fprintf(stderr, "%s", msg);
  return;
}


x86 assembly (clang, -O0):
<debug_say_nocr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <debug_msg@plt>
cmp    $0x1,%eax
jne    1155 <debug_say_nocr+0x35>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_say_nocr>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <debug_msg@plt>
cmp    $0x1,%eax
jne    1149 <debug_say_nocr+0x29>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @debug_say_nocr(i8* %0) {
%2 = tail call i32 (...) @debug_msg()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qwerty(int, char **);
int /*<<< orphan*/ write_port(int, int);
void kb_init(void) {
  write_port(0x21, 0xFD);
  qwerty((int)0, (char **)0);
}


x86 assembly (clang, -O0):
<kb_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0xfd,%esi
call   1040 <write_port@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <qwerty@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_init>:
push   %rax
mov    $0x21,%edi
mov    $0xfd,%esi
call   1040 <write_port@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <qwerty@plt>

LLVM IR (-O0):
define void @kb_init() {
%1 = call i32 @write_port(i32 33, i32 253)
%2 = call i32 @qwerty(i32 0, i8** null)
ret void
}

LLVM IR (-O2):
define void @kb_init() {
%1 = tail call i32 @write_port(i32 33, i32 253)
%2 = tail call i32 @qwerty(i32 0, i8** null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
signed int vsprintf(char *pString, const char *pFormat, va_list ap) {
  return vsnprintf(pString, 2000, pFormat, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x7d0,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x7d0,%esi
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 2000, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ stun_init_command_str(int /*<<< orphan*/, unsigned char *,
                                         size_t *);
int /*<<< orphan*/ stun_make_indication(int /*<<< orphan*/);
void stun_init_indication_str(uint16_t method, unsigned char *buf,
                              size_t *len) {
  stun_init_command_str(stun_make_indication(method), buf, len);
}


x86 assembly (clang, -O0):
<stun_init_indication_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <stun_make_indication@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <stun_init_command_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_init_indication_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <stun_make_indication@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <stun_init_command_str@plt>

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

LLVM IR (-O2):
define void @stun_init_indication_str(i32 %0, i8* %1, i64* %2) {
%4 = tail call i32 @stun_make_indication(i32 %0)
%5 = tail call i32 @stun_init_command_str(i32 %4, i8* %1, i64* %2)
ret void
}