xunge/DecIR huggingface dataset:
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  if (!s || !f)
    return;
  i = 0;
  while (s[i]) {
    f(i, &s[i]);
    ++i;
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <ft_striteri+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    112b <ft_striteri+0x2b>
jmp    1164 <ft_striteri+0x64>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1164 <ft_striteri+0x64>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <ft_striteri+0x32>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striteri+0x33>
mov    %rsi,%r14
test   %rsi,%rsi
je     1133 <ft_striteri+0x33>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1133 <ft_striteri+0x33>
xor    %ebx,%ebx
mov    %r15,%rsi
nop
mov    %ebx,%edi
call   *%r14
add    $0x1,%ebx
lea    (%r15,%rbx,1),%rsi
cmpb   $0x0,(%r15,%rbx,1)
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i32, i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %14, %9 ], [ %0, %6 ]
%11 = phi i32 [ %12, %9 ], [ 0, %6 ]
tail call void %1(i32 %11, i8* %10)
%12 = add i32 %11, 1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret void
}
void XLocaleOfIM() {}


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

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

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

LLVM IR (-O2):
define void @XLocaleOfIM() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void INT3() {
  ;
  _c_setbyte(0xcc);
  ;
}


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

x86 assembly (clang, -O2):
<INT3>:
mov    $0xcc,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @INT3() {
%1 = call i32 @_c_setbyte(i32 204)
ret void
}

LLVM IR (-O2):
define void @INT3() {
%1 = tail call i32 @_c_setbyte(i32 204)
ret void
}
void mystrncpy(char *s, char *t, int n) {
  int i;
  i = 0;
  while (i < n && *t != '\0') {
    *s++ = *t++;
    i++;
  }
}


x86 assembly (clang, -O0):
<mystrncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x19(%rbp)
jge    1137 <mystrncpy+0x37>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1147 <mystrncpy+0x47>
jmp    1177 <mystrncpy+0x77>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <mystrncpy+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrncpy>:
test   %edx,%edx
jle    1123 <mystrncpy+0x23>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rcx,1),%edx
test   %dl,%dl
je     1123 <mystrncpy+0x23>
mov    %dl,(%rdi,%rcx,1)
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <mystrncpy+0x10>
ret

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

LLVM IR (-O2):
define void @mystrncpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3, %11
%6 = phi i32 [ %14, %11 ], [ 0, %3 ]
%7 = phi i8* [ %13, %11 ], [ %0, %3 ]
%8 = phi i8* [ %12, %11 ], [ %1, %3 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %9, i8* %7
%14 = add nuw nsw i32 %6, 1
%15 = icmp eq i32 %14, %2
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(!1 == -2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int mkstemp(char *);
int c_mkstemp(char *arg0) { return mkstemp(arg0); }


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

x86 assembly (clang, -O2):
<c_mkstemp>:
jmp    1030 <mkstemp@plt>

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

LLVM IR (-O2):
define i32 @c_mkstemp(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
ret i32 %2
}
char *procID2Name(int procID) {
  switch (procID) {
  case 0:
    return "GPS process";
  case 1:
    return "Internet connector process";
  case 2:
    return "Server communication process";
  default:
    return "Unkown Process";
  }
}


x86 assembly (clang, -O0):
<procID2Name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <procID2Name+0x3c>
jmp    111a <procID2Name+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <procID2Name+0x4c>
jmp    112b <procID2Name+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <procID2Name+0x5c>
jmp    116c <procID2Name+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <procID2Name+0x77>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <procID2Name+0x77>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <procID2Name+0x77>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procID2Name>:
cmp    $0x2,%edi
ja     1117 <procID2Name+0x17>
movslq %edi,%rax
lea    0xf45(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf26(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"GPS process\00"
@.str.1 = [27 x i8] c"Internet connector process\00"
@.str.2 = [29 x i8] c"Server communication process\00"
@.str.3 = [15 x i8] c"Unkown Process\00"
define i8* @procID2Name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"GPS process\00"
@.str.1 = [27 x i8] c"Internet connector process\00"
@.str.2 = [29 x i8] c"Server communication process\00"
@.str.3 = [15 x i8] c"Unkown Process\00"
@reltable.procID2Name = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.procID2Name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.procID2Name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.procID2Name to i64)) to i32)]
define i8* @procID2Name(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.procID2Name to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
scalar_t__ EEXIST;
scalar_t__ errno;
scalar_t__ mkfifo(char *, int);
int create_fifo(char *name, int perm) {
  if ((mkfifo(name, perm) < 0) && (errno != EEXIST))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<create_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <mkfifo@plt>
cmp    $0x0,%rax
jge    115b <create_fifo+0x4b>
mov    0x2e9c(%rip),%rax
mov    (%rax),%rax
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     115b <create_fifo+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <create_fifo+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_fifo>:
push   %rax
call   1030 <mkfifo@plt>
test   %rax,%rax
jns    1136 <create_fifo+0x26>
mov    0x2eb6(%rip),%rax
mov    (%rax),%rcx
mov    0x2eb4(%rip),%rdx
mov    $0xffffffff,%eax
cmp    (%rdx),%rcx
jne    1138 <create_fifo+0x28>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @create_fifo(i8* %0, i32 %1) {
%3 = tail call i64 @mkfifo(i8* %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EEXIST
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %5, %2
br label %10
10: ; preds = %5, %9
%11 = phi i32 [ 0, %9 ], [ -1, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ close_all();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ log_end();
void terminate(void) {
  close_all();
  log_end();
  exit(0);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <close_all@plt>
mov    $0x0,%al
call   1030 <log_end@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rax
xor    %eax,%eax
call   1040 <close_all@plt>
xor    %eax,%eax
call   1030 <log_end@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @terminate() {
%1 = call i32 (...) @close_all()
%2 = call i32 (...) @log_end()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @terminate() {
%1 = tail call i32 (...) @close_all()
%2 = tail call i32 (...) @log_end()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct tunnel {
  int dummy;
};

/* Variables and functions */
int http_request(struct tunnel *, char *, char *, char *, int /*<<< orphan*/ *);
int auth_log_out(struct tunnel *tunnel) {
  return http_request(tunnel, "GET", "/remote/logout", "", NULL);
}


x86 assembly (clang, -O0):
<auth_log_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed6(%rip),%rdx
lea    0xece(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <http_request@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auth_log_out>:
lea    0xee9(%rip),%rsi
lea    0xee6(%rip),%rdx
lea    0xede(%rip),%rcx
xor    %r8d,%r8d
jmp    1030 <http_request@plt>

LLVM IR (-O0):
%struct.tunnel = type { i32 }
@.str = [4 x i8] c"GET\00"
@.str.1 = [15 x i8] c"/remote/logout\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @auth_log_out(%struct.tunnel* %0) {
%2 = alloca %struct.tunnel*
store %struct.tunnel* %0, %struct.tunnel** %2
%3 = load %struct.tunnel*, %struct.tunnel** %2
%4 = call i32 @http_request(%struct.tunnel* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 %4
}

LLVM IR (-O2):
%struct.tunnel = type { i32 }
@.str = [4 x i8] c"GET\00"
@.str.1 = [15 x i8] c"/remote/logout\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @auth_log_out(%struct.tunnel* %0) {
%2 = tail call i32 @http_request(%struct.tunnel* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 %2
}
/* Variables and functions */
int log10(double);
double db_pos(double power) { return 10 * log10(power); }


x86 assembly (clang, -O0):
<db_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
imul   $0xa,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_pos>:
push   %rax
call   1030 <log10@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @db_pos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @log10(double %3)
%5 = mul nsw i32 10, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @db_pos(double %0) {
%2 = tail call i32 @log10(double %0)
%3 = mul nsw i32 %2, 10
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ syscall_cp(int);
void __restore_rt() { syscall_cp(173); }


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

x86 assembly (clang, -O2):
<__restore_rt>:
mov    $0xad,%edi
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
define void @__restore_rt() {
%1 = call i32 @syscall_cp(i32 173)
ret void
}

LLVM IR (-O2):
define void @__restore_rt() {
%1 = tail call i32 @syscall_cp(i32 173)
ret void
}
/* Variables and functions */
size_t farmhash32(char const *, size_t);
size_t farmhash64(char const *, size_t);
size_t farmhash(const char *s, size_t len) {
  return sizeof(size_t) == 8 ? farmhash64(s, len) : farmhash32(s, len);
}


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

x86 assembly (clang, -O2):
<farmhash>:
jmp    1030 <farmhash64@plt>

LLVM IR (-O0):
define i64 @farmhash(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @farmhash64(i8* %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @farmhash(i8* %0, i64 %1) {
%3 = tail call i64 @farmhash64(i8* %0, i64 %1)
ret i64 %3
}
unsigned long int sfpr_number_pow(unsigned char a1, unsigned char a2) {
  unsigned char i;
  unsigned long int value = 1;
  for (i = 0; i < a2; i++)
    value *= a1;
  return value;
}


x86 assembly (clang, -O0):
<sfpr_number_pow>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movq   $0x1,-0x10(%rbp)
movb   $0x0,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1146 <sfpr_number_pow+0x46>
movzbl -0x1(%rbp),%eax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x3(%rbp),%al
add    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    111c <sfpr_number_pow+0x1c>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfpr_number_pow>:
test   %esi,%esi
je     111b <sfpr_number_pow+0x1b>
movzbl %dil,%ecx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%dl
cmp    $0x7,%al
jae    1121 <sfpr_number_pow+0x21>
mov    $0x1,%eax
jmp    1156 <sfpr_number_pow+0x56>
mov    $0x1,%eax
ret
and    $0xf8,%sil
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xf8,%sil
jne    1130 <sfpr_number_pow+0x30>
test   %dl,%dl
je     1169 <sfpr_number_pow+0x69>
nopw   0x0(%rax,%rax,1)
imul   %rcx,%rax
add    $0xff,%dl
jne    1160 <sfpr_number_pow+0x60>
ret

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

LLVM IR (-O2):
define i64 @sfpr_number_pow(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %34, label %4
4: ; preds = %2
%5 = zext i8 %0 to i64
%6 = add i8 %1, -1
%7 = and i8 %1, 7
%8 = icmp ult i8 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i8 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i8 [ 0, %9 ], [ %22, %11 ]
%14 = mul i64 %12, %5
%15 = mul i64 %14, %5
%16 = mul i64 %15, %5
%17 = mul i64 %16, %5
%18 = mul i64 %17, %5
%19 = mul i64 %18, %5
%20 = mul i64 %19, %5
%21 = mul i64 %20, %5
%22 = add i8 %13, 8
%23 = icmp eq i8 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i8 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i8 [ %32, %28 ], [ 0, %24 ]
%31 = mul i64 %29, %5
%32 = add i8 %30, 1
%33 = icmp eq i8 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi i64 [ 1, %2 ], [ %25, %24 ], [ %31, %28 ]
ret i64 %35
}
/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ g();
int /*<<< orphan*/ h();
main() {
  long l = 3;
  f(g(), h());
  f(g(), h());
  return l;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x3,-0x10(%rbp)
mov    $0x0,%al
call   1050 <g@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <h@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1040 <f@plt>
mov    $0x0,%al
call   1050 <g@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <h@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <f@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <g@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <h@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <f@plt>
xor    %eax,%eax
call   1050 <g@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <h@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <f@plt>
mov    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 3, i64* %2
%3 = call i32 (...) @g()
%4 = call i32 (...) @h()
%5 = call i32 @f(i32 %3, i32 %4)
%6 = call i32 (...) @g()
%7 = call i32 (...) @h()
%8 = call i32 @f(i32 %6, i32 %7)
%9 = load i64, i64* %2
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @g()
%2 = tail call i32 (...) @h()
%3 = tail call i32 @f(i32 %1, i32 %2)
%4 = tail call i32 (...) @g()
%5 = tail call i32 (...) @h()
%6 = tail call i32 @f(i32 %4, i32 %5)
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int write(int, int /*<<< orphan*/ *, int);
bool invoke_send_msg(int fd, uint32_t msg) {
  ;
  return (sizeof(msg) == write(fd, &msg, sizeof(msg)));
}


x86 assembly (clang, -O0):
<invoke_send_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
movslq %eax,%rcx
mov    $0x4,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invoke_send_msg>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @invoke_send_msg(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 = call i32 @write(i32 %5, i32* %4, i32 4)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @invoke_send_msg(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 4)
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
scalar_t__ pthread_cond_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void xcond_init(pthread_cond_t *c) {
  if (pthread_cond_init(c, NULL)) {
    fputs("xcond_init\n", stderr);
    abort();
  }
}


x86 assembly (clang, -O0):
<xcond_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_cond_init@plt>
cmp    $0x0,%rax
je     116f <xcond_init+0x3f>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    0xe9d(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcond_init>:
push   %rax
xor    %esi,%esi
call   1050 <pthread_cond_init@plt>
test   %rax,%rax
jne    113f <xcond_init+0xf>
pop    %rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"xcond_init\0A\00"
@stderr = global i32 0
define void @xcond_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_cond_init(i32* %3, i32* null)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"xcond_init\0A\00"
@stderr = global i32 0
define void @xcond_init(i32* %0) {
%2 = tail call i64 @pthread_cond_init(i32* %0, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
struct cb_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cb_putc(struct cb_context *, int /*<<< orphan*/);
void cb_puts(struct cb_context *context, const char *text) {
  while (*text)
    cb_putc(context, *text++);
}


x86 assembly (clang, -O0):
<cb_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <cb_puts+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <cb_putc@plt>
jmp    1120 <cb_puts+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_puts>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <cb_puts+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <cb_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <cb_puts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.cb_context = type { i32 }
define void @cb_puts(%struct.cb_context* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @cb_putc(%struct.cb_context* %0, i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
double jac_chain_nm5_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<jac_chain_nm5_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <jac_chain_nm5_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <jac_chain_nm5_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <jac_chain_nm5_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <jac_chain_nm5_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm5_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @jac_chain_nm5_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @jac_chain_nm5_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
extern int os_exit() { return 0; }


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

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

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

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

/* Type definitions */
struct TYPE_3__ {
  int member_0;
  int member_1;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
div_t div(int a, int b) {
  div_t ret = {a / b, a % b};
  return ret;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i64 @div(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sdiv i32 %7, %8
store i32 %9, i32* %6
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
store i32 %13, i32* %10
%14 = bitcast %struct.TYPE_3__* %3 to i64*
%15 = load i64, i64* %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = zext i32 %4 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %3 to i64
%8 = or i64 %6, %7
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XC_top_left_arrow;
int /*<<< orphan*/ XC_watch;
int /*<<< orphan*/ vis5d_set_cursor_type(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int vis5d_set_busy_cursor(Display *dpy, Window win, int busy) {
  if (busy) {
    vis5d_set_cursor_type(dpy, win, XC_watch);
  } else {
    vis5d_set_cursor_type(dpy, win, XC_top_left_arrow);
  }
  return 1;
}


x86 assembly (clang, -O0):
<vis5d_set_busy_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1146 <vis5d_set_busy_cursor+0x36>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
call   1030 <vis5d_set_cursor_type@plt>
jmp    115b <vis5d_set_busy_cursor+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
call   1030 <vis5d_set_cursor_type@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vis5d_set_busy_cursor>:
push   %rax
test   %edx,%edx
jne    111e <vis5d_set_busy_cursor+0xe>
mov    0x2eb4(%rip),%rax
jmp    1125 <vis5d_set_busy_cursor+0x15>
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
call   1030 <vis5d_set_cursor_type@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@XC_watch = global i32 0
@XC_top_left_arrow = global i32 0
define i32 @vis5d_set_busy_cursor(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* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = load i32, i32* @XC_watch
%13 = call i32 @vis5d_set_cursor_type(i32* %10, i32 %11, i32 %12)
br label %19
14: ; preds = %3
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = load i32, i32* @XC_top_left_arrow
%18 = call i32 @vis5d_set_cursor_type(i32* %15, i32 %16, i32 %17)
br label %19
19: ; preds = %14, %9
ret i32 1
}

LLVM IR (-O2):
@XC_watch = global i32 0
@XC_top_left_arrow = global i32 0
define i32 @vis5d_set_busy_cursor(i32* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = load i32, i32* @XC_top_left_arrow
%6 = load i32, i32* @XC_watch
%7 = select i1 %4, i32 %5, i32 %6
%8 = tail call i32 @vis5d_set_cursor_type(i32* %0, i32 %1, i32 %7)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int);
int main(void) {
  printf("test %d.\n", sum(5, 6));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x6,%esi
call   1040 <sum@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"test %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 5, i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void SysCtlClkVerificationClear(void) {
  (*((volatile unsigned long *)(0x400FE150))) = 0x00000001;
  (*((volatile unsigned long *)(0x400FE150))) = 0;
}


x86 assembly (clang, -O0):
<SysCtlClkVerificationClear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe150,%eax
movq   $0x1,(%rax)
mov    $0x400fe150,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlClkVerificationClear>:
movq   $0x1,0x400fe150
movq   $0x0,0x400fe150
ret

LLVM IR (-O0):
define void @SysCtlClkVerificationClear() {
store volatile i64 1, i64* inttoptr (i64 1074782544 to i64*)
store volatile i64 0, i64* inttoptr (i64 1074782544 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlClkVerificationClear() {
store volatile i64 1, i64* inttoptr (i64 1074782544 to i64*)
store volatile i64 0, i64* inttoptr (i64 1074782544 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_set_io(char *args) { printf("%s\n", args); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_set_io(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int dma_buf_stats_setup(struct dma_buf *dmabuf) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dma_buf = type opaque
define i32 @dma_buf_stats_setup(%struct.dma_buf* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x8b() {
  Assert_real((isxdigit(139) == 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",
              700, ("isxdigit should be 0 for 0x8b"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x8b>:
push   %rax
mov    $0x8b,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2bc,%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 0x8b\00"
define void @t_isxdigit_0x8b() {
%1 = call i64 @isxdigit(i32 139)
%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 700, 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 0x8b\00"
define void @t_isxdigit_0x8b() {
%1 = tail call i64 @isxdigit(i32 139)
%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 700, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ Mem_Alloc(int);
int Mem_Free(int *);
scalar_t__ Mem_Init(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  assert(Mem_Init(4096) == 0);
  int *ptr = (int *)Mem_Alloc(2 * sizeof(int));
  assert(ptr != NULL);
  ptr = ptr + 1;
  assert(Mem_Free(ptr) == -1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x8,%edi
call   1060 <Mem_Alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <Mem_Free@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
mov    $0x8,%edi
call   1060 <Mem_Alloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
call   1040 <Mem_Free@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @Mem_Init(i32 4096)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i64 @Mem_Alloc(i32 8)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32* %14, i32** %2
%15 = load i32*, i32** %2
%16 = call i32 @Mem_Free(i32* %15)
%17 = icmp eq i32 %16, -1
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @Mem_Init(i32 4096)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @Mem_Alloc(i32 8)
%6 = inttoptr i64 %5 to i32*
%7 = icmp ne i64 %5, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = tail call i32 @Mem_Free(i32* %10)
%12 = icmp eq i32 %11, -1
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xeb() {
  Assert_real((isbdigit(235) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1180, ("isbdigit should be 0 for 0xeb"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xeb>:
push   %rax
mov    $0xeb,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x49c,%edx
pop    %rax
jmp    1030 <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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xeb\00"
define void @t_isbdigit_0xeb() {
%1 = call i64 @isbdigit(i32 235)
%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 1180, 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xeb\00"
define void @t_isbdigit_0xeb() {
%1 = tail call i64 @isbdigit(i32 235)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1180, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_one();
int main(void) {
  unsigned long i;
  for (i = 0; i < 1000000; i++)
    do_one();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0xf4240,-0x10(%rbp)
jae    114d <main+0x3d>
mov    $0x0,%al
call   1030 <do_one@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @do_one()
%4 = add nuw nsw i64 %2, 1
%5 = icmp eq i64 %4, 1000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}