xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ spin(int);
void disable_usb() {
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x00) = 0x080;
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x10) = (1 << (11));
  *(volatile unsigned long *)((void *)0xfffb0000 + 0x74) = 0x100;
  spin(1000);
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x14) = (1 << (11));
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x04) = 0x080;
}


x86 assembly (clang, -O0):
<disable_usb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffc00,%eax
movq   $0x80,(%rax)
mov    $0xfffffc00,%eax
movq   $0x800,0x10(%rax)
mov    $0xfffb0000,%eax
movq   $0x100,0x74(%rax)
mov    $0x3e8,%edi
call   1030 <spin@plt>
mov    $0xfffffc00,%eax
movq   $0x800,0x14(%rax)
mov    $0xfffffc00,%eax
movq   $0x80,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_usb>:
push   %rbx
mov    $0xfffb0074,%ebx
movq   $0x80,0x4fb8c(%rbx)
movq   $0x800,0x4fb9c(%rbx)
movq   $0x100,(%rbx)
mov    $0x3e8,%edi
call   1030 <spin@plt>
movq   $0x800,0x4fba0(%rbx)
movq   $0x80,0x4fb90(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @disable_usb() {
store volatile i64 128, i64* inttoptr (i64 4294966272 to i64*)
store volatile i64 2048, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 16) to i64*)
store volatile i64 256, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294639616 to i8*), i64 116) to i64*)
%1 = call i32 @spin(i32 1000)
store volatile i64 2048, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 20) to i64*)
store volatile i64 128, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 4) to i64*)
ret void
}

LLVM IR (-O2):
define void @disable_usb() {
store volatile i64 128, i64* inttoptr (i64 4294966272 to i64*)
store volatile i64 2048, i64* inttoptr (i64 4294966288 to i64*)
store volatile i64 256, i64* inttoptr (i64 4294639732 to i64*)
%1 = tail call i32 @spin(i32 1000)
store volatile i64 2048, i64* inttoptr (i64 4294966292 to i64*)
store volatile i64 128, i64* inttoptr (i64 4294966276 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMGET;
int /*<<< orphan*/ TIOCMSET;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
void serialSetPin(int fd, int pin) {
  int set;
  ioctl(fd, TIOCMGET, &set);
  set |= pin;
  ioctl(fd, TIOCMSET, &set);
}


x86 assembly (clang, -O0):
<serialSetPin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialSetPin>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%r14
mov    %r14,%rdx
call   1030 <ioctl@plt>
or     %ebx,0xc(%rsp)
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
mov    %r14,%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@TIOCMGET = global i32 0
@TIOCMSET = global i32 0
define void @serialSetPin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @TIOCMGET
%8 = call i32 @ioctl(i32 %6, i32 %7, i32* %5)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = or i32 %10, %9
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* @TIOCMSET
%14 = call i32 @ioctl(i32 %12, i32 %13, i32* %5)
ret void
}

LLVM IR (-O2):
@TIOCMGET = global i32 0
@TIOCMSET = global i32 0
define void @serialSetPin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @TIOCMGET
%6 = call i32 @ioctl(i32 %0, i32 %5, i32* %3)
%7 = load i32, i32* %3
%8 = or i32 %7, %1
store i32 %8, i32* %3
%9 = load i32, i32* @TIOCMSET
%10 = call i32 @ioctl(i32 %0, i32 %9, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tst_exit();
int /*<<< orphan*/ tst_resm(int, char *, char *);
void tmpdir_cleanup() {
  tst_resm(4, "%s: No user cleanup function called before exiting",
           "tst_tmpdir()");
  tst_exit();
}


x86 assembly (clang, -O0):
<tmpdir_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
lea    0xed0(%rip),%rsi
lea    0xefc(%rip),%rdx
call   1040 <tst_resm@plt>
mov    $0x0,%al
call   1030 <tst_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpdir_cleanup>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0xf04(%rip),%rdx
mov    $0x4,%edi
call   1040 <tst_resm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tst_exit@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"%s: No user cleanup function called before exiting\00"
@.str.1 = [13 x i8] c"tst_tmpdir()\00"
define void @tmpdir_cleanup() {
%1 = call i32 @tst_resm(i32 4, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @tst_exit()
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"%s: No user cleanup function called before exiting\00"
@.str.1 = [13 x i8] c"tst_tmpdir()\00"
define void @tmpdir_cleanup() {
%1 = tail call i32 @tst_resm(i32 4, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @tst_exit()
ret void
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(char const *s, int fd) {
  if (s)
    write(fd, s, ft_strlen(s));
  else
    write(fd, "null", 4);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1164 <ft_putstr_fd+0x44>
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>
jmp    1178 <ft_putstr_fd+0x58>
mov    -0xc(%rbp),%edi
lea    0xe92(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
test   %rdi,%rdi
je     113b <ft_putstr_fd+0x1b>
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
jmp    1149 <ft_putstr_fd+0x29>
lea    0xebe(%rip),%rsi
mov    %ebp,%edi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"null\00"
define void @ft_putstr_fd(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load i8*, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @ft_strlen(i8* %10)
%12 = call i32 @write(i32 %8, i8* %9, i32 %11)
br label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = call i32 @write(i32 %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %16
16: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @ft_strlen(i8* %0)
%6 = tail call i32 @write(i32 %1, i8* %0, i32 %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
void *memset(void *, int /*<<< orphan*/, int);
void *mzero(void *s, int n) {
  if (NULL == s || n <= 0) {
    return s;
  }
  return memset(s, 0, n);
}


x86 assembly (clang, -O0):
<mzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1135 <mzero+0x25>
cmpl   $0x0,-0x14(%rbp)
jg     1142 <mzero+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <mzero+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mzero>:
test   %rdi,%rdi
je     1122 <mzero+0x12>
mov    %esi,%edx
test   %esi,%esi
jle    1122 <mzero+0x12>
xor    %esi,%esi
jmp    1030 <memset@plt>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @mzero(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
%4 = icmp slt i32 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @memset(i8* %0, i32 0, i32 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %0, %2 ]
ret i8* %9
}
int main() { return 2 == 3; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
#pragma omp parallel
  printf("Hello, World\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t CCFGRead_SCLK_LF_OPTION(void) {
  return (
      ((*((volatile unsigned long *)(0x50003000 + 0x00001FB4))) & 0x00C00000) >>
      22);
}


x86 assembly (clang, -O0):
<CCFGRead_SCLK_LF_OPTION>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50004fb4,%eax
mov    (%rax),%rax
and    $0xc00000,%rax
shr    $0x16,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CCFGRead_SCLK_LF_OPTION>:
mov    0x50004fb4,%rax
50
shr    $0x16,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i64 @CCFGRead_SCLK_LF_OPTION() {
%1 = load volatile i64, i64* inttoptr (i64 1342197684 to i64*)
%2 = and i64 %1, 12582912
%3 = lshr i64 %2, 22
ret i64 %3
}

LLVM IR (-O2):
define i64 @CCFGRead_SCLK_LF_OPTION() {
%1 = load volatile i64, i64* inttoptr (i64 1342197684 to i64*)
%2 = lshr i64 %1, 22
%3 = and i64 %2, 3
ret i64 %3
}
int strlen(const char *s) {
  int i = 0;
  while (s != ((void *)0) && s[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1134 <strlen+0x34>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <strlen+0x44>
jmp    1152 <strlen+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
test   %rdi,%rdi
je     111d <strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_toss_route(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_toss_route>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_toss_route(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_toss_route(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *fast_memcpy(void *to, const void *from, size_t len) {
  memcpy(to, from, len);
  return to;
}


x86 assembly (clang, -O0):
<fast_memcpy>:
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 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_memcpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @fast_memcpy(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 @memcpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @fast_memcpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret i8* %0
}
/* Variables and functions */
size_t strlen(char const *);
size_t string_length(const char *string) { return string ? strlen(string) : 0; }


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <string_length+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <string_length+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <string_length+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @string_length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xa4() {
  Assert_real((isxdigit(164) == 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_isxdigit.c",
              825, ("isxdigit should be 0 for 0xa4"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xa4>:
push   %rax
mov    $0xa4,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x339,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xa4\00"
define void @t_isxdigit_0xa4() {
%1 = call i64 @isxdigit(i32 164)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 825, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xa4\00"
define void @t_isxdigit_0xa4() {
%1 = tail call i64 @isxdigit(i32 164)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 825, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int core7_safe(char const *);
int U_EMRSETVIEWPORTORGEX_safe(const char *record) {
  return (core7_safe(record));
}


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

x86 assembly (clang, -O2):
<U_EMRSETVIEWPORTORGEX_safe>:
jmp    1030 <core7_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETVIEWPORTORGEX_safe(i8* %0) {
%2 = tail call i32 @core7_safe(i8* %0)
ret i32 %2
}
int fun995() { return 995; }


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

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

LLVM IR (-O0):
define i32 @fun995() {
ret i32 995
}

LLVM IR (-O2):
define i32 @fun995() {
ret i32 995
}
/* Variables and functions */
unsigned hash(char *c) {
  unsigned hash_val = 0;
  if (c != NULL) {
    for (hash_val = 0; *c != '\0'; c++) {
      hash_val = (*c + 31 * hash_val) % 128;
    }
  }
  return hash_val % 128;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115a <hash+0x5a>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <hash+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
and    $0x7f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1121 <hash+0x21>
jmp    115a <hash+0x5a>
mov    -0xc(%rbp),%eax
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
xor    %eax,%eax
test   %rdi,%rdi
je     113a <hash+0x3a>
mov    (%rdi),%cl
test   %cl,%cl
je     113a <hash+0x3a>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %cl,%ecx
shl    $0x5,%eax
sub    %edx,%eax
add    %ecx,%eax
and    $0x7f,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash+0x20>
ret

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

LLVM IR (-O2):
define i32 @hash(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %15, %6 ], [ %4, %3 ]
%8 = phi i32 [ %13, %6 ], [ 0, %3 ]
%9 = phi i8* [ %14, %6 ], [ %0, %3 ]
%10 = zext i8 %7 to i32
%11 = mul nuw nsw i32 %8, 31
%12 = add nuw nsw i32 %11, %10
%13 = and i32 %12, 127
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %3, %1
%18 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %13, %6 ]
ret i32 %18
}
unsigned char swap_bits(unsigned char octet) {
  return ((octet >> 4) + (octet << 4));
}


x86 assembly (clang, -O0):
<swap_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bits>:
mov    %edi,%eax
rol    $0x4,%al
ret

LLVM IR (-O0):
define zeroext i8 @swap_bits(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 4
%9 = add nsw i32 %5, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @swap_bits(i8 zeroext %0) {
%2 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 4)
ret i8 %2
}
int main() {
  int a = 1;
  double b = 2;
  float c = 3;
  int d = a > b == b < c;
  return d <= a != a >= c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movsd  0xeee(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ssl -0x8(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store double 2.000000e+00, double* %3
store float 3.000000e+00, float* %4
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = load double, double* %3
%9 = fcmp ogt double %7, %8
%10 = zext i1 %9 to i32
%11 = load double, double* %3
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = fcmp olt double %11, %13
%15 = zext i1 %14 to i32
%16 = icmp eq i32 %10, %15
%17 = zext i1 %16 to i32
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32, i32* %2
%20 = icmp sle i32 %18, %19
%21 = zext i1 %20 to i32
%22 = load i32, i32* %2
%23 = sitofp i32 %22 to float
%24 = load float, float* %4
%25 = fcmp oge float %23, %24
%26 = zext i1 %25 to i32
%27 = icmp ne i32 %21, %26
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ toBinaryFunc(int);
int main() {
  int userNum = 0;
  printf("Please give me a number: ");
  scanf("%d", &userNum);
  printf("%lld", toBinaryFunc(userNum));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <toBinaryFunc@plt>
mov    %eax,%esi
lea    0xea8(%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
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <toBinaryFunc@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Please give me a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @toBinaryFunc(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please give me a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @toBinaryFunc(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **as) {
  free((char *)*as);
  *as = 0;
}


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

x86 assembly (clang, -O2):
<ft_strdel>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_strdel(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @free(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @ft_strdel(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dir_sep();
char **split_str(char const *, int /*<<< orphan*/);
char **path_split(const char *dir) { return split_str(dir, dir_sep()); }


x86 assembly (clang, -O0):
<path_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <dir_sep@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <split_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_split>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dir_sep@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <split_str@plt>

LLVM IR (-O0):
define i8** @path_split(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @dir_sep()
%5 = call i8** @split_str(i8* %3, i32 %4)
ret i8** %5
}

LLVM IR (-O2):
define i8** @path_split(i8* %0) {
%2 = tail call i32 (...) @dir_sep()
%3 = tail call i8** @split_str(i8* %0, i32 %2)
ret i8** %3
}
/* Variables and functions */
size_t get_size_no_ops(void *data) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @get_size_no_ops(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(char *name) {
  printf("Usage : \n");
  printf(" %s <nodma | dma >\n", name);
}


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

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rdi,%rbx
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Usage : \0A\00"
@.str.1 = [20 x i8] c" %s <nodma | dma >\0A\00"
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c" %s <nodma | dma >\0A\00"
@str = [9 x i8] c"Usage : \00"
define void @print(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void CharSet(int N, char *x, char val) {
  int i;
  for (i = 0; i < N; i++)
    x[i] = val;
}


x86 assembly (clang, -O0):
<CharSet>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113f <CharSet+0x3f>
mov    -0x11(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1117 <CharSet+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharSet>:
test   %edi,%edi
jle    112b <CharSet+0x1b>
push   %rax
mov    %edi,%eax
movzbl %dl,%ecx
mov    %rsi,%rdi
mov    %ecx,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @CharSet(i32 %0, i8* nocapture writeonly %1, i8 signext %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef long register_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_close;
int /*<<< orphan*/ assert(int);
long inject_syscall(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
void close_i(pid_t pid, int fd) {
  register_t ret = inject_syscall(pid, 1, SYS_close, fd);
  assert(ret != -1L);
}


x86 assembly (clang, -O0):
<close_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%esi
call   1040 <inject_syscall@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_i>:
push   %rax
mov    %esi,%ecx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%esi
call   1040 <inject_syscall@plt>
xor    %edi,%edi
cmp    $0xffffffffffffffff,%rax
setne  %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@SYS_close = global i32 0
define void @close_i(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @SYS_close
%8 = load i32, i32* %4
%9 = call i64 @inject_syscall(i32 %6, i32 1, i32 %7, i32 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = icmp ne i64 %10, -1
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret void
}

LLVM IR (-O2):
@SYS_close = global i32 0
define void @close_i(i32 %0, i32 %1) {
%3 = load i32, i32* @SYS_close
%4 = tail call i64 @inject_syscall(i32 %0, i32 1, i32 %3, i32 %1)
%5 = icmp ne i64 %4, -1
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}
double ppm(double testrate, double bitrate) {
  return 1000000 * (testrate - bitrate) / bitrate;
}


x86 assembly (clang, -O0):
<ppm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppm>:
subsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ppm(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = fmul double 1.000000e+06, %7
%9 = load double, double* %4
%10 = fdiv double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @ppm(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fmul double %3, 1.000000e+06
%5 = fdiv double %4, %1
ret double %5
}
long double va_longdouble(__builtin_va_list l) {
  return __builtin_va_arg(l, long double);
}


x86 assembly (clang, -O0):
<va_longdouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,%rdx
add    $0x10,%rdx
mov    %rdx,0x8(%rcx)
fldt   (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<va_longdouble>:
mov    0x8(%rdi),%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
lea    0x10(%rax),%rcx
mov    %rcx,0x8(%rdi)
fldt   (%rax)
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define x86_fp80 @va_longdouble(%struct.__va_list_tag* %0) {
%2 = alloca %struct.__va_list_tag*
store %struct.__va_list_tag* %0, %struct.__va_list_tag** %2
%3 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%4 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 2
%5 = load i8*, i8** %4
%6 = ptrtoint i8* %5 to i64
%7 = add i64 %6, 15
%8 = and i64 %7, -16
%9 = inttoptr i64 %8 to i8*
%10 = bitcast i8* %9 to x86_fp80*
%11 = getelementptr i8, i8* %9, i32 16
store i8* %11, i8** %4
%12 = load x86_fp80, x86_fp80* %10
ret x86_fp80 %12
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define x86_fp80 @va_longdouble(%struct.__va_list_tag* nocapture %0) {
%2 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = add i64 %4, 15
%6 = and i64 %5, -16
%7 = inttoptr i64 %6 to i8*
%8 = inttoptr i64 %6 to x86_fp80*
%9 = getelementptr i8, i8* %7, i64 16
store i8* %9, i8** %2
%10 = load x86_fp80, x86_fp80* %8
ret x86_fp80 %10
}
int isupper(int c) {
  if (c >= 'A' && c <= 'Z')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <isupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <isupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void kissSim_init(int world, int rx, int ry, float rt) {}


x86 assembly (clang, -O0):
<kissSim_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @kissSim_init(i32 %0, i32 %1, i32 %2, float %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store float %3, float* %8
ret void
}

LLVM IR (-O2):
define void @kissSim_init(i32 %0, i32 %1, i32 %2, float %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
int /*<<< orphan*/ salsa_k16(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *);
void salsa20_genBlock128(void *dest, const void *k, const void *iv,
                         uint64_t i) {
  uint32_t n[4];
  memcpy(n, iv, 8);
  salsa_k16((uint32_t *)dest, (uint32_t *)k, n);
}


x86 assembly (clang, -O0):
<salsa20_genBlock128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <salsa_k16@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<salsa20_genBlock128>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <salsa_k16@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @salsa20_genBlock128(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [4 x i32]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%11 = load i8*, i8** %7
%12 = call i32 @memcpy(i32* %10, i8* %11, i32 8)
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i32*
%15 = load i8*, i8** %6
%16 = bitcast i8* %15 to i32*
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%18 = call i32 @salsa_k16(i32* %14, i32* %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @salsa20_genBlock128(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [4 x i32]
%6 = bitcast [4 x i32]* %5 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%8 = call i32 @memcpy(i32* %7, i8* %2, i32 8)
%9 = bitcast i8* %0 to i32*
%10 = bitcast i8* %1 to i32*
%11 = call i32 @salsa_k16(i32* %9, i32* %10, i32* %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank1Low(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vrc2_4_SetChrROMBank1();
void vrc2_4_setParamsBXX2(uint16_t addr, uint8_t val) {
  __setCHRBank1Low(addr, val);
  vrc2_4_SetChrROMBank1();
}


x86 assembly (clang, -O0):
<vrc2_4_setParamsBXX2>:
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   1040 <__setCHRBank1Low@plt>
mov    $0x0,%al
call   1030 <vrc2_4_SetChrROMBank1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vrc2_4_setParamsBXX2(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 @__setCHRBank1Low(i32 %5, i32 %6)
%8 = call i32 (...) @vrc2_4_SetChrROMBank1()
ret void
}

LLVM IR (-O2):
define void @vrc2_4_setParamsBXX2(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank1Low(i32 %0, i32 %1)
%4 = tail call i32 (...) @vrc2_4_SetChrROMBank1()
ret void
}
__attribute__((no, noclone)) signed __int128 t169_4sub(unsigned __int128 x) {
  unsigned __int128 y =
      ((unsigned __int128)((
           signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1)) +
       1);
  signed __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t169_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
xor    %edi,%edi
mov    %edi,%r9d
sub    %rsi,%rdx
sbb    %rax,%rcx
mov    %r9,%r8
sbb    %r8,%r8
sbb    %r9,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
mov    %rcx,%rdi
shr    $0x3f,%rdi
xor    %rdi,%rsi
or     %rsi,%rax
setne  %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    11a9 <t169_4sub+0x99>
jmp    11b0 <t169_4sub+0xa0>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t169_4sub>:
mov    %rdi,%rax
movabs $0x8000000000000000,%rdx
add    %rsi,%rdx
ret

LLVM IR (-O0):
define { i64, i64 } @t169_4sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 -170141183460469231731687303715884105728, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = zext i128 %12 to i129
%15 = zext i128 %13 to i129
%16 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %14, i129 %15)
%17 = extractvalue { i129, i1 } %16, 1
%18 = extractvalue { i129, i1 } %16, 0
%19 = trunc i129 %18 to i128
%20 = sext i128 %19 to i129
%21 = icmp ne i129 %18, %20
%22 = or i1 %17, %21
store i128 %19, i128* %7
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 (...) @bar()
br label %25
25: ; preds = %23, %2
%26 = load i128, i128* %7
store i128 %26, i128* %3
%27 = bitcast i128* %3 to { i64, i64 }*
%28 = load { i64, i64 }, { i64, i64 }* %27
ret { i64, i64 } %28
}

LLVM IR (-O2):
define { i64, i64 } @t169_4sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nsw i129 %7, -170141183460469231731687303715884105728
%9 = trunc i129 %8 to i64
%10 = lshr i129 %8, 64
%11 = trunc i129 %10 to i64
%12 = insertvalue { i64, i64 } poison, i64 %9, 0
%13 = insertvalue { i64, i64 } %12, i64 %11, 1
ret { i64, i64 } %13
}
int sto_del(struct sto_database *conn, void *row, char key[16]) { return 0; }


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

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

LLVM IR (-O0):
%struct.sto_database = type opaque
define i32 @sto_del(%struct.sto_database* %0, i8* %1, i8* %2) {
%4 = alloca %struct.sto_database*
%5 = alloca i8*
%6 = alloca i8*
store %struct.sto_database* %0, %struct.sto_database** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.sto_database = type opaque
define i32 @sto_del(%struct.sto_database* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ dlerror();
char *strdup(char *);
char *mpgfio_dlerror(void) {
  char *errmsg = strdup((char *)dlerror());
  if (!errmsg) {
    errmsg = strdup("dlerror: unknown error");
  }
  return errmsg;
}


x86 assembly (clang, -O0):
<mpgfio_dlerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <mpgfio_dlerror+0x36>
lea    0xeb3(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpgfio_dlerror>:
push   %rax
xor    %eax,%eax
call   1030 <dlerror@plt>
mov    %rax,%rdi
call   1040 <strdup@plt>
test   %rax,%rax
je     1137 <mpgfio_dlerror+0x17>
pop    %rcx
ret
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1040 <strdup@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"dlerror: unknown error\00"
define i8* @mpgfio_dlerror() {
%1 = alloca i8*
%2 = call i64 (...) @dlerror()
%3 = inttoptr i64 %2 to i8*
%4 = call i8* @strdup(i8* %3)
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i8* @strdup(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %1
br label %9
9: ; preds = %7, %0
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [23 x i8] c"dlerror: unknown error\00"
define noalias i8* @mpgfio_dlerror() {
%1 = tail call i64 (...) @dlerror()
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @strdup(i8* %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call dereferenceable_or_null(23) i8* @strdup(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = phi i8* [ %3, %0 ], [ %6, %5 ]
ret i8* %8
}