xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
char *strchr(char *, char);
__attribute__((no, noclone)) void baz(char *p) {
  char *e = strchr(p, '\0');
  strcat(e, "abcd");
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %rax,%rbx
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
define void @baz(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 0)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
define void @baz(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr i8, i8* %0, i64 %2
%4 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef size_t uint64_t;

/* Variables and functions */
size_t charfind_n(char *str, char c, size_t n) {
  uint64_t i;
  for (i = 0; i < n && str[i] != c; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<charfind_n>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x21(%rbp)
jae    1145 <charfind_n+0x45>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1155 <charfind_n+0x55>
jmp    116b <charfind_n+0x6b>
jmp    115a <charfind_n+0x5a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111a <charfind_n+0x1a>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charfind_n>:
xor    %eax,%eax
test   %rdx,%rdx
je     1122 <charfind_n+0x22>
nopw   0x0(%rax,%rax,1)
cmp    %sil,(%rdi,%rax,1)
je     1122 <charfind_n+0x22>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <charfind_n+0x10>
mov    %rdx,%rax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
ssize_t i2c_write_data16(int fd, uint16_t data) {
  uint8_t buffer[2];
  buffer[0] = data >> 8;
  buffer[1] = data;
  return write(fd, buffer, 2);
}


x86 assembly (clang, -O0):
<i2c_write_data16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_data16>:
push   %rax
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i2c_write_data16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = ashr i32 %6, 8
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %7, i32* %8
%9 = load i32, i32* %4
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %9, i32* %10
%11 = load i32, i32* %3
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%13 = call i32 @write(i32 %11, i32* %12, i32 2)
ret i32 %13
}

LLVM IR (-O2):
define i32 @i2c_write_data16(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = ashr i32 %1, 8
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %7
%8 = call i32 @write(i32 %0, i32* %6, i32 2)
ret i32 %8
}
OP(ed, e7) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
void stress_dir_sync(const int dir_fd) { (void)dir_fd; }


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

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

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

LLVM IR (-O2):
define void @stress_dir_sync(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_runtime_path() {
  printf("NOT IMPLEMENTED:"
         "pa_runtime_path"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_runtime_path\00"
define i32 @pa_runtime_path() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void dummy_label(char *label) { label = label; }


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

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

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

LLVM IR (-O2):
define void @dummy_label(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ probe_superio_ite();
int /*<<< orphan*/ probe_superio_winbond();
void probe_superio(void) {
  probe_superio_winbond();
  probe_superio_ite();
}


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

x86 assembly (clang, -O2):
<probe_superio>:
push   %rax
xor    %eax,%eax
call   1030 <probe_superio_winbond@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <probe_superio_ite@plt>

LLVM IR (-O0):
define void @probe_superio() {
%1 = call i32 (...) @probe_superio_winbond()
%2 = call i32 (...) @probe_superio_ite()
ret void
}

LLVM IR (-O2):
define void @probe_superio() {
%1 = tail call i32 (...) @probe_superio_winbond()
%2 = tail call i32 (...) @probe_superio_ite()
ret void
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl_fd(const char *s, int fd) {
  write(fd, s, ft_strlen(s));
  write(fd, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
lea    0xea2(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xec0(%rip),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
%5 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
int main() {
  unsigned short arg1 = 0x1234;
  unsigned short arg2 = 0x5678;
  unsigned short out1 = 0;
  unsigned short out2 = 0;
  __asm__("xaddw %%ax, %%cx" : "=a"(out1), "=c"(out2) : "a"(arg1), "c"(arg2));
  return (out1 == 0x5678) && (out2 == 0x68AC);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x1234,-0x6(%rbp)
movw   $0x5678,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x0,-0xc(%rbp)
mov    -0x6(%rbp),%ax
mov    -0x8(%rbp),%cx
xadd   %ax,%cx
mov    %ax,-0xa(%rbp)
mov    %cx,-0xc(%rbp)
movzwl -0xa(%rbp),%ecx
xor    %eax,%eax
cmp    $0x5678,%ecx
mov    %al,-0xd(%rbp)
jne    115b <main+0x5b>
movzwl -0xc(%rbp),%eax
cmp    $0x68ac,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1234,%ax
mov    $0x5678,%cx
xadd   %ax,%cx
xor    $0x5678,%eax
xor    $0x68ac,%ecx
xor    %edx,%edx
or     %ax,%cx
sete   %dl
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i32 0, i32* %1
store i16 4660, i16* %2
store i16 22136, i16* %3
store i16 0, i16* %4
store i16 0, i16* %5
%6 = load i16, i16* %2
%7 = load i16, i16* %3
%8 = call { i16, i16 } asm "xaddw %ax, %cx", "={ax},={cx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i16 %6, i16 %7)
%9 = extractvalue { i16, i16 } %8, 0
%10 = extractvalue { i16, i16 } %8, 1
store i16 %9, i16* %4
store i16 %10, i16* %5
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = icmp eq i32 %12, 22136
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = load i16, i16* %5
%16 = zext i16 %15 to i32
%17 = icmp eq i32 %16, 26796
br label %18
18: ; preds = %14, %0
%19 = phi i1 [ false, %0 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i16, i16 } asm "xaddw %ax, %cx", "={ax},={cx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i16 4660, i16 22136)
%2 = extractvalue { i16, i16 } %1, 0
%3 = extractvalue { i16, i16 } %1, 1
%4 = icmp eq i16 %2, 22136
%5 = icmp eq i16 %3, 26796
%6 = select i1 %4, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
scalar_t__ memmove(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, size_t);
wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n) {
  _DIAGASSERT(d != NULL);
  _DIAGASSERT(s != NULL);
  return (wchar_t *)memmove(d, s, n * sizeof(wchar_t));
}


x86 assembly (clang, -O0):
<wmemmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <_DIAGASSERT@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
shl    $0x2,%rdx
call   1040 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmemmove>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <_DIAGASSERT@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <_DIAGASSERT@plt>
shl    $0x2,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memmove@plt>

LLVM IR (-O0):
define i32* @wmemmove(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @_DIAGASSERT(i32 %9)
%11 = load i32*, i32** %5
%12 = icmp ne i32* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @_DIAGASSERT(i32 %13)
%15 = load i32*, i32** %4
%16 = load i32*, i32** %5
%17 = load i64, i64* %6
%18 = mul i64 %17, 4
%19 = call i64 @memmove(i32* %15, i32* %16, i64 %18)
%20 = inttoptr i64 %19 to i32*
ret i32* %20
}

LLVM IR (-O2):
define i32* @wmemmove(i32* %0, i32* %1, i64 %2) {
%4 = icmp ne i32* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @_DIAGASSERT(i32 %5)
%7 = icmp ne i32* %1, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @_DIAGASSERT(i32 %8)
%10 = shl i64 %2, 2
%11 = tail call i64 @memmove(i32* %0, i32* %1, i64 %10)
%12 = inttoptr i64 %11 to i32*
ret i32* %12
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int SCRend() {
  endwin();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @SCRend() {
%1 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @SCRend() {
%1 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int core3_swap(char *, int);
int U_EMRRESTOREDC_swap(char *record, int torev) {
  return (core3_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRRESTOREDC_swap>:
jmp    1030 <core3_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRRESTOREDC_swap(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
%7 = call i32 @core3_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRRESTOREDC_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret i32 %3
}
long long som(long long a, long long b) { return a + b; }


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

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

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

LLVM IR (-O2):
define i64 @som(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ wait10Msec(int);
void pause() { wait10Msec(50); }


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

x86 assembly (clang, -O2):
<pause>:
mov    $0x32,%edi
jmp    1030 <wait10Msec@plt>

LLVM IR (-O0):
define void @pause() {
%1 = call i32 @wait10Msec(i32 50)
ret void
}

LLVM IR (-O2):
define void @pause() {
%1 = tail call i32 @wait10Msec(i32 50)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mdelay(int);
int /*<<< orphan*/ outb(int /*<<< orphan*/, int);
void mach_reboot(void) {
  outb(0, 0xf0);
  mdelay(1);
}


x86 assembly (clang, -O0):
<mach_reboot>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xf0,%esi
call   1040 <outb@plt>
mov    $0x1,%edi
call   1030 <mdelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mach_reboot>:
push   %rax
xor    %edi,%edi
mov    $0xf0,%esi
call   1040 <outb@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <mdelay@plt>

LLVM IR (-O0):
define void @mach_reboot() {
%1 = call i32 @outb(i32 0, i32 240)
%2 = call i32 @mdelay(i32 1)
ret void
}

LLVM IR (-O2):
define void @mach_reboot() {
%1 = tail call i32 @outb(i32 0, i32 240)
%2 = tail call i32 @mdelay(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __off64_t;

/* Variables and functions */
int ENOSYS;
int posix_fallocate64(int fd, __off64_t offset, __off64_t len) {
  return ENOSYS;
}


x86 assembly (clang, -O0):
<posix_fallocate64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_fallocate64>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @posix_fallocate64(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
ret i32 %7
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @posix_fallocate64(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
ret i32 %4
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("test_switch [-d?] [-c count]\n");
  printf("count must be between 2 and 26\n");
  errno = 0;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ead(%rip),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb0(%rip),%rax
movq   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"test_switch [-d?] [-c count]\0A\00"
@.str.1 = [32 x i8] c"count must be between 2 and 26\0A\00"
@errno = global i64 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
store i64 0, i64* @errno
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@str = [29 x i8] c"test_switch [-d?] [-c count]\00"
@str.2 = [31 x i8] c"count must be between 2 and 26\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
store i64 0, i64* @errno
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void make_bootable(FILE *outfile) {
  fseek(outfile, 510, SEEK_SET);
  fwrite("\x55\xaa", 2, 1, outfile);
}


x86 assembly (clang, -O0):
<make_bootable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    $0x1fe,%esi
call   1030 <fseek@plt>
mov    -0x8(%rbp),%rcx
lea    0xeb2(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_bootable>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
mov    $0x1fe,%esi
call   1030 <fseek@plt>
lea    0xec2(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [3 x i8] c"U\AA\00"
define void @make_bootable(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fseek(i32* %3, i32 510, i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i32* %6)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [3 x i8] c"U\AA\00"
define void @make_bootable(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i32 510, i32 %2)
%4 = tail call i32 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_msat(uintptr_t);
void fiat_p224_msat(uint32_t out1[8]) {
  internal_fiat_p224_msat((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p224_msat>:
jmp    1030 <internal_fiat_p224_msat@plt>

LLVM IR (-O0):
define void @fiat_p224_msat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p224_msat(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p224_msat(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p224_msat(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ box_unsigned_8(int /*<<< orphan*/);
int /*<<< orphan*/ double_bits(int /*<<< orphan*/);
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ untag_float(int /*<<< orphan*/);
void primitive_double_bits_impl(void) {
  box_unsigned_8(double_bits(untag_float(dpop())));
}


x86 assembly (clang, -O0):
<primitive_double_bits_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float@plt>
mov    %eax,%edi
call   1040 <double_bits@plt>
mov    %eax,%edi
call   1060 <box_unsigned_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_double_bits_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float@plt>
mov    %eax,%edi
call   1040 <double_bits@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <box_unsigned_8@plt>

LLVM IR (-O0):
define void @primitive_double_bits_impl() {
%1 = call i32 (...) @dpop()
%2 = call i32 @untag_float(i32 %1)
%3 = call i32 @double_bits(i32 %2)
%4 = call i32 @box_unsigned_8(i32 %3)
ret void
}

LLVM IR (-O2):
define void @primitive_double_bits_impl() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @untag_float(i32 %1)
%3 = tail call i32 @double_bits(i32 %2)
%4 = tail call i32 @box_unsigned_8(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x40() {
  Assert_real((isascii(64)),
              "/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_isascii.c",
              325, ("isascii should be 1 for @"));
}


x86 assembly (clang, -O0):
<t_isascii_0x40>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x145,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x40>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x145,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for @\00"
define void @t_isascii_0x40() {
%1 = call i32 @isascii(i32 64)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for @\00"
define void @t_isascii_0x40() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void sys_output_done(void) {}


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

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

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

LLVM IR (-O2):
define void @sys_output_done() {
ret void
}
void error_universe_level_overflow(void *client_state) {}


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

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

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

LLVM IR (-O2):
define void @error_universe_level_overflow(i8* nocapture %0) {
ret void
}
long double fmodl(long double x, long double y) { return 4; }


x86 assembly (clang, -O0):
<fmodl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
flds   0xeea(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodl>:
flds   0xefa(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
ret x86_fp80 0xK40018000000000000000
}

LLVM IR (-O2):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
ret x86_fp80 0xK40018000000000000000
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  char a[5];
  int *b;
  a[0] = 'h';
  a[1] = 'i';
  a[2] = '\0';
  write(1, a, 3);
  *b = 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x68,-0x5(%rbp)
movb   $0x69,-0x4(%rbp)
movb   $0x0,-0x3(%rbp)
lea    -0x5(%rbp),%rsi
mov    $0x1,%edi
mov    $0x3,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6968,0x3(%rsp)
movb   $0x0,0x5(%rsp)
lea    0x3(%rsp),%rsi
mov    $0x1,%edi
mov    $0x3,%edx
call   1030 <write@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca i32*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
store i8 104, i8* %3
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
store i8 105, i8* %4
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 2
store i8 0, i8* %5
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = call i32 @write(i32 1, i8* %6, i32 3)
%8 = load i32*, i32** %2
store i32 10, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
store i8 104, i8* %2
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
store i8 105, i8* %3
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 2
store i8 0, i8* %4
%5 = call i32 @write(i32 1, i8* %2, i32 3)
unreachable
}
/* Type definitions */
struct gpiohandle_data {
  scalar_t__ *values;
};

/* Variables and functions */
int /*<<< orphan*/ GPIOHANDLE_SET_LINE_VALUES_IOCTL;
int ioctl(int, int /*<<< orphan*/, struct gpiohandle_data *);
int ws2801_latch(int req_fd) {
  struct gpiohandle_data data;
  data.values[0] = 0;
  return ioctl(req_fd, GPIOHANDLE_SET_LINE_VALUES_IOCTL, &data);
}


x86 assembly (clang, -O0):
<ws2801_latch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.gpiohandle_data = type { i64* }
@GPIOHANDLE_SET_LINE_VALUES_IOCTL = global i32 0
define i32 @ws2801_latch(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.gpiohandle_data
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.gpiohandle_data, %struct.gpiohandle_data* %3, i32 0, i32 0
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
store i64 0, i64* %6
%7 = load i32, i32* %2
%8 = load i32, i32* @GPIOHANDLE_SET_LINE_VALUES_IOCTL
%9 = call i32 @ioctl(i32 %7, i32 %8, %struct.gpiohandle_data* %3)
ret i32 %9
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  printf("Enter two numbers: \n");
  scanf("%d %d", &a, &b);
  printf("Maximum: %d\n", (a > b) ? a : b);
  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    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1168 <main+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116e <main+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea3(%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    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%esi
cmp    %esi,%eax
cmovg  %eax,%esi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter two numbers: \0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [13 x i8] c"Maximum: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = load i32, i32* %2
br label %13
11: ; preds = %0
%12 = load i32, i32* %3
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [13 x i8] c"Maximum: %d\0A\00"
@str = [20 x i8] c"Enter two numbers: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %7, %8
%10 = select i1 %9, i32 %7, i32 %8
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
float math_cosf(float);
float call_cosf(float x) { return math_cosf(x); }


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

x86 assembly (clang, -O2):
<call_cosf>:
jmp    1030 <math_cosf@plt>

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

LLVM IR (-O2):
define float @call_cosf(float %0) {
%2 = tail call float @math_cosf(float %0)
ret float %2
}
int func2_in_obj(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func2_in_obj() {
ret i32 0
}
void av_packet_copy_props() {}


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

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

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

LLVM IR (-O2):
define void @av_packet_copy_props() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asmMicoFlushDataCache();
void MicoFlushDataCache(void) { asmMicoFlushDataCache(); }


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

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

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

LLVM IR (-O2):
define void @MicoFlushDataCache() {
%1 = tail call i32 (...) @asmMicoFlushDataCache()
ret void
}
void __attribute__((destructor)) final() {
  printf(__func__);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<final>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__func__.final = [6 x i8] c"final\00"
@.str = [2 x i8] c"\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @final, i8* null }]
define void @final() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.final, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.final = [6 x i8] c"final\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @final, i8* null }]
define void @final() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.final, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
float max(float n1, float n2) {
  if (n1 >= n2)
    return n1;
  return n2;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     112c <max+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <max+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
movaps %xmm1,%xmm2
cmpless %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp oge float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ IMU_Navdata_stop();
void MDL_IMU_term() { IMU_Navdata_stop(); }


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

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

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

LLVM IR (-O2):
define void @MDL_IMU_term() {
%1 = tail call i32 (...) @IMU_Navdata_stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char const *, char *, int);
int utf8_signature_p(const char *string, int size) {
  return size >= 3 && !memcmp(string, "\xef\xbb\xbf", 3);
}


x86 assembly (clang, -O0):
<utf8_signature_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     114e <utf8_signature_p+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x3,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_signature_p>:
xor    %eax,%eax
cmp    $0x3,%esi
jl     1136 <utf8_signature_p+0x26>
push   %rax
lea    0xee1(%rip),%rsi
mov    $0x3,%edx
call   1030 <memcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\EF\BB\BF\00"
define i32 @utf8_signature_p(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 3
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @memcmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %7, %2
%13 = phi i1 [ false, %2 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"\EF\BB\BF\00"
define i32 @utf8_signature_p(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @memcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %9
}
void extern_used() {}


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

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

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

LLVM IR (-O2):
define void @extern_used() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int uart_putc(int c) {
  while (((volatile uint16_t *)0x80030000)[1] & (1 << 0x6))
    ;
  ((volatile uint16_t *)0x80030000)[2] = c;
  return 0;
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x80030000,%eax
mov    0x4(%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1120 <uart_putc+0x20>
jmp    1107 <uart_putc+0x7>
mov    -0x4(%rbp),%ecx
mov    $0x80030000,%eax
mov    %ecx,0x8(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
mov    $0x80030004,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x40,(%rax)
jne    1110 <uart_putc+0x10>
mov    %edi,0x4(%rax)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @uart_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i32, i32* getelementptr inbounds (i32, i32* inttoptr (i64 2147680256 to i32*), i64 1)
%5 = and i32 %4, 64
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* %2
store volatile i32 %9, i32* getelementptr inbounds (i32, i32* inttoptr (i64 2147680256 to i32*), i64 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @uart_putc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 2147680260 to i32*)
%4 = and i32 %3, 64
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 2147680264 to i32*)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double, double, double,
                          double);
void start(double width_in, double height_in, double perinch) {
  printf("<svg width=\"%fin\" height=\"%fin\" "
         "viewBox=\"%f %f %f %f\">\n",
         width_in, height_in, perinch * width_in * -0.5,
         perinch * height_in * -0.5, perinch * width_in, perinch * height_in);
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  -0x8(%rbp),%xmm2
movsd  0xebd(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  -0x18(%rbp),%xmm3
mulsd  -0x10(%rbp),%xmm3
movsd  0xea7(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  -0x18(%rbp),%xmm4
mulsd  -0x8(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
mulsd  -0x10(%rbp),%xmm5
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
movapd %xmm2,%xmm5
movapd %xmm0,%xmm4
mulsd  %xmm2,%xmm4
movsd  0xedc(%rip),%xmm3
movapd %xmm4,%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm5
mulsd  %xmm5,%xmm3
lea    0xecd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"<svg width=\22%fin\22 height=\22%fin\22 viewBox=\22%f %f %f %f\22>\0A\00"
define void @start(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = fmul double %11, -5.000000e-01
%13 = load double, double* %6
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = fmul double %15, -5.000000e-01
%17 = load double, double* %6
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = load double, double* %6
%21 = load double, double* %5
%22 = fmul double %20, %21
%23 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), double %7, double %8, double %12, double %16, double %19, double %22)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"<svg width=\22%fin\22 height=\22%fin\22 viewBox=\22%f %f %f %f\22>\0A\00"
define void @start(double %0, double %1, double %2) {
%4 = fmul double %0, %2
%5 = fmul double %4, -5.000000e-01
%6 = fmul double %1, %2
%7 = fmul double %6, -5.000000e-01
%8 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %5, double %7, double %4, double %6)
ret void
}
void bee_mqtt_log_callback(struct mosquitto *mosq, void *obj, int level,
                           const char *str) {
  if (str)
    plogger_print(
        0,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/kaija/bee/refs/heads/master/bee.c",
        63, __func__, "%s\n", str);
}


x86 assembly (clang, -O0):
<bee_mqtt_log_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <bee_mqtt_log_callback+0x49>
mov    -0x20(%rbp),%r9
xor    %edi,%edi
lea    0xec1(%rip),%rsi
mov    $0x3f,%edx
lea    0xf31(%rip),%rcx
lea    0xf40(%rip),%r8
mov    $0x0,%al
call   1030 <plogger_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bee_mqtt_log_callback>:
test   %rcx,%rcx
je     113b <bee_mqtt_log_callback+0x2b>
mov    %rcx,%r9
lea    0xee1(%rip),%rsi
lea    0xf56(%rip),%rcx
lea    0xf65(%rip),%r8
xor    %edi,%edi
mov    $0x3f,%edx
xor    %eax,%eax
jmp    1030 <plogger_print@plt>
ret

LLVM IR (-O0):
%struct.mosquitto = type opaque
@.str = [124 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kaija/bee/refs/heads/master/bee.c\00"
@__func__.bee_mqtt_log_callback = [22 x i8] c"bee_mqtt_log_callback\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @bee_mqtt_log_callback(%struct.mosquitto* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca %struct.mosquitto*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store %struct.mosquitto* %0, %struct.mosquitto** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i8*, i8** %8
%13 = call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @plogger_print to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.bee_mqtt_log_callback, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
%struct.mosquitto = type opaque
@.str = [124 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kaija/bee/refs/heads/master/bee.c\00"
@__func__.bee_mqtt_log_callback = [22 x i8] c"bee_mqtt_log_callback\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @bee_mqtt_log_callback(%struct.mosquitto* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* %3) {
%5 = icmp eq i8* %3, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @plogger_print to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.bee_mqtt_log_callback, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %8
8: ; preds = %6, %4
ret void
}
void foo_1_2_2_2_1_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_1_1_1_2_1() {
ret void
}
void XtOwnSelectionIncremental() {}


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

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

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

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