xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x98() {
  Assert_real((isalpha(152) == 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_isalpha.c",
              765, ("isalpha should be 0 for 0x98"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x98\00"
define void @t_isalpha_0x98() {
%1 = tail call i64 @isalpha(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strspn(char const *, char *);
char *skip_email_wsp(const char *s) {
  if (s)
    return (char *)(s + strspn(s, " \t\r\n"));
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_email_wsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <skip_email_wsp+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strspn@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    115c <skip_email_wsp+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_email_wsp>:
test   %rdi,%rdi
je     112c <skip_email_wsp+0x1c>
push   %rbx
mov    %rdi,%rbx
lea    0xee0(%rip),%rsi
call   1030 <strspn@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0D\0A\00"
define i8* @skip_email_wsp(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strspn(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %8
}
void test_ar_2_LONG(void *d, long n) {
  if (0x7fffffffffffffffL - 2 <= n && n <= 0x7fffffffffffffffL - 1)
    n = 0x7fffffffffffffffL - 3;
  __builtin_memset(d, 0, n);
}


x86 assembly (clang, -O0):
<test_ar_2_LONG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x7ffffffffffffffd,%rax
ff ff 7f
cmp    -0x10(%rbp),%rax
jg     1156 <test_ar_2_LONG+0x46>
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
cmp    %rax,-0x10(%rbp)
jg     1156 <test_ar_2_LONG+0x46>
movabs $0x7ffffffffffffffc,%rax
ff ff 7f
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ar_2_LONG>:
movabs $0x7ffffffffffffffc,%rdx
ff ff 7f
lea    (%rsi,%rdx,1),%rax
add    $0x7,%rax
cmp    $0x2,%rax
cmovae %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @test_ar_2_LONG(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp sle i64 9223372036854775805, %5
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp sle i64 %8, 9223372036854775806
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 9223372036854775804, i64* %4
br label %11
11: ; preds = %10, %7, %2
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @test_ar_2_LONG(i8* nocapture writeonly %0, i64 %1) {
%3 = add i64 %1, -9223372036854775805
%4 = icmp ult i64 %3, 2
%5 = select i1 %4, i64 9223372036854775804, i64 %1
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %5, i1 false)
ret void
}
void unspace(char *s, int len) {
  while (*s && *s != ' ' && len--)
    ++s;
  if (len > 0)
    *s = '\0';
}


x86 assembly (clang, -O0):
<unspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1149 <unspace+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0xd(%rbp)
je     1149 <unspace+0x49>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1159 <unspace+0x59>
jmp    116a <unspace+0x6a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <unspace+0xb>
cmpl   $0x0,-0xc(%rbp)
jle    117b <unspace+0x7b>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unspace>:
mov    %esi,%ecx
xor    %eax,%eax
testb  $0xdf,(%rdi,%rax,1)
je     111e <unspace+0x1e>
nopw   0x0(%rax,%rax,1)
cmp    %eax,%ecx
je     1128 <unspace+0x28>
add    $0x1,%rax
testb  $0xdf,(%rdi,%rax,1)
jne    1110 <unspace+0x10>
sub    %eax,%esi
test   %esi,%esi
jle    1128 <unspace+0x28>
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @unspace(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i32 [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %12
i8 32, label %12
]
7: ; preds = %3
%8 = icmp eq i32 %5, 0
br i1 %8, label %15, label %9
9: ; preds = %7
%10 = add nsw i32 %5, -1
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
12: ; preds = %3, %3
%13 = icmp sgt i32 %5, 0
br i1 %13, label %14, label %15
14: ; preds = %12
store i8 0, i8* %4
br label %15
15: ; preds = %7, %14, %12
ret void
}
int IsSectorValid(int x, int y) { return (x >= 1 && x < 9 && y >= 1 && y < 9); }


x86 assembly (clang, -O0):
<IsSectorValid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <IsSectorValid+0x41>
xor    %eax,%eax
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jge    1141 <IsSectorValid+0x41>
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <IsSectorValid+0x41>
cmpl   $0x9,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSectorValid>:
add    $0xffffffff,%edi
add    $0xffffffff,%esi
or     %edi,%esi
xor    %eax,%eax
cmp    $0x8,%esi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsSectorValid(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 = icmp sge i32 %5, 1
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 9
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 9
br label %16
16: ; preds = %13, %10, %7, %2
%17 = phi i1 [ false, %10 ], [ false, %7 ], [ false, %2 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @IsSectorValid(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %1, -1
%5 = or i32 %4, %3
%6 = icmp ult i32 %5, 8
%7 = zext i1 %6 to i32
ret i32 %7
}
int tabpos(int pos, char *tab) {
  if (pos > 1000)
    return 1;
  else
    return tab[pos];
}


x86 assembly (clang, -O0):
<tabpos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jle    1124 <tabpos+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1133 <tabpos+0x33>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabpos>:
mov    $0x1,%eax
cmp    $0x3e8,%edi
jg     1114 <tabpos+0x14>
movslq %edi,%rax
movsbl (%rsi,%rax,1),%eax
ret

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

LLVM IR (-O2):
define i32 @tabpos(i32 %0, i8* nocapture %1) {
%3 = icmp sgt i32 %0, 1000
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 1, %2 ]
ret i32 %10
}
/* Type definitions */
struct in6_addr {
  scalar_t__ s6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memmove(scalar_t__, scalar_t__, int);
int /*<<< orphan*/ memset(scalar_t__, int, int);
void v42v6_map(char *addr) {
  struct in6_addr *a6 = (struct in6_addr *)addr;
  memmove(a6->s6_addr + 12, a6->s6_addr, 4);
  memset(a6->s6_addr + 10, 0xff, 2);
  memset(a6->s6_addr, 0, 10);
}


x86 assembly (clang, -O0):
<v42v6_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
add    $0xc,%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x4,%edx
call   1040 <memmove@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
add    $0xa,%rdi
mov    $0xff,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v42v6_map>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xc(%rsi),%rdi
mov    $0x4,%edx
call   1040 <memmove@plt>
mov    (%rbx),%rdi
add    $0xa,%rdi
mov    $0xff,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
mov    (%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i64 }
define void @v42v6_map(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.in6_addr*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.in6_addr*
store %struct.in6_addr* %5, %struct.in6_addr** %3
%6 = load %struct.in6_addr*, %struct.in6_addr** %3
%7 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %8, 12
%10 = load %struct.in6_addr*, %struct.in6_addr** %3
%11 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = call i32 @memmove(i64 %9, i64 %12, i32 4)
%14 = load %struct.in6_addr*, %struct.in6_addr** %3
%15 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %14, i32 0, i32 0
%16 = load i64, i64* %15
%17 = add nsw i64 %16, 10
%18 = call i32 @memset(i64 %17, i32 255, i32 2)
%19 = load %struct.in6_addr*, %struct.in6_addr** %3
%20 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %19, i32 0, i32 0
%21 = load i64, i64* %20
%22 = call i32 @memset(i64 %21, i32 0, i32 10)
ret void
}

LLVM IR (-O2):
define void @v42v6_map(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 12
%5 = tail call i32 @memmove(i64 %4, i64 %3, i32 4)
%6 = load i64, i64* %2
%7 = add nsw i64 %6, 10
%8 = tail call i32 @memset(i64 %7, i32 255, i32 2)
%9 = load i64, i64* %2
%10 = tail call i32 @memset(i64 %9, i32 0, i32 10)
ret void
}
/* Type definitions */
struct event_base {
  int dummy;
};
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int /*<<< orphan*/ event_base_loopexit(struct event_base *,
                                       int /*<<< orphan*/ *);
void _sighandler(evutil_socket_t signal, short events, void *user_data) {
  struct event_base *evb = user_data;
  event_base_loopexit(evb, NULL);
}


x86 assembly (clang, -O0):
<_sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <event_base_loopexit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sighandler>:
mov    %rdx,%rdi
xor    %esi,%esi
jmp    1030 <event_base_loopexit@plt>

LLVM IR (-O0):
%struct.event_base = type { i32 }
define void @_sighandler(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.event_base*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.event_base*
store %struct.event_base* %9, %struct.event_base** %7
%10 = load %struct.event_base*, %struct.event_base** %7
%11 = call i32 @event_base_loopexit(%struct.event_base* %10, i32* null)
ret void
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
define void @_sighandler(i32 %0, i16 signext %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.event_base*
%5 = tail call i32 @event_base_loopexit(%struct.event_base* %4, i32* null)
ret void
}
void CopyCDistList(Schema, A, B) struct univStruct *Schema;
struct Teacher **A;
struct Teacher **B;
{
  AssignTeacherCDistListFirst(B, AccessTeacherCDistListFirst(A));
}


x86 assembly (clang, -O0):
<CopyCDistList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <AccessTeacherCDistListFirst@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    $0x0,%al
call   1040 <AssignTeacherCDistListFirst@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyCDistList>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <AccessTeacherCDistListFirst@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <AssignTeacherCDistListFirst@plt>

LLVM IR (-O0):
%struct.univStruct = type opaque
%struct.Teacher = type opaque
define void @CopyCDistList(%struct.univStruct* %0, %struct.Teacher** %1, %struct.Teacher** %2) {
%4 = alloca %struct.univStruct*
%5 = alloca %struct.Teacher**
%6 = alloca %struct.Teacher**
store %struct.univStruct* %0, %struct.univStruct** %4
store %struct.Teacher** %1, %struct.Teacher*** %5
store %struct.Teacher** %2, %struct.Teacher*** %6
%7 = load %struct.Teacher**, %struct.Teacher*** %6
%8 = load %struct.Teacher**, %struct.Teacher*** %5
%9 = call i32 (%struct.Teacher**, ...) bitcast (i32 (...)* @AccessTeacherCDistListFirst to i32 (%struct.Teacher**, ...)*)(%struct.Teacher** %8)
%10 = call i32 (%struct.Teacher**, i32, ...) bitcast (i32 (...)* @AssignTeacherCDistListFirst to i32 (%struct.Teacher**, i32, ...)*)(%struct.Teacher** %7, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.univStruct = type opaque
%struct.Teacher = type opaque
define void @CopyCDistList(%struct.univStruct* nocapture readnone %0, %struct.Teacher** %1, %struct.Teacher** %2) {
%4 = tail call i32 (%struct.Teacher**, ...) bitcast (i32 (...)* @AccessTeacherCDistListFirst to i32 (%struct.Teacher**, ...)*)(%struct.Teacher** %1)
%5 = tail call i32 (%struct.Teacher**, i32, ...) bitcast (i32 (...)* @AssignTeacherCDistListFirst to i32 (%struct.Teacher**, i32, ...)*)(%struct.Teacher** %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *trim(char *);
int main(int argc, char *argv[]) { printf("%s", trim(argv[1])); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <trim@plt>
mov    %rax,%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <trim@plt>
lea    0xecf(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i8* @trim(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @trim(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void cli_exit(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @cli_exit() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int write(int, ...);
int send_request(int sfd, size_t size, const char *request) {
  if (write(sfd, &size, sizeof(size_t)) == -1)
    return -1;
  if (write(sfd, request, size) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<send_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    114b <send_request+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <send_request+0x69>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1172 <send_request+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <send_request+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_request>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     114e <send_request+0x3e>
mov    (%rsp),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <write@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
jmp    1153 <send_request+0x43>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @send_request(i32 %0, i64 %1, i8* %2) {
%4 = alloca i64
store i64 %1, i64* %4
%5 = call i32 (i32, ...) @write(i32 %0, i64* %4, i64 8)
%6 = icmp eq i32 %5, -1
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = load i64, i64* %4
%9 = call i32 (i32, ...) @write(i32 %0, i8* %2, i64 %8)
%10 = icmp eq i32 %9, -1
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %7, %3
%13 = phi i32 [ -1, %3 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int _doio(int, void *, int, int);
int read(int fd, void *buf, int count) { return _doio(fd, buf, count, 1); }


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <_doio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
mov    $0x1,%ecx
jmp    1030 <_doio@plt>

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

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @_doio(i32 %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned int b) {
  return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
}


x86 assembly (clang, -O0):
<rgb_to_pixel8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%ecx
shr    $0x5,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    $0x6,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_pixel8>:
mov    %edx,%eax
and    $0xffffffe0,%edi
shr    $0x3,%esi
and    $0xfffffffc,%esi
shr    $0x6,%eax
or     %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @rgb_to_pixel8(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* %4
%8 = lshr i32 %7, 5
%9 = shl i32 %8, 5
%10 = load i32, i32* %5
%11 = lshr i32 %10, 5
%12 = shl i32 %11, 2
%13 = or i32 %9, %12
%14 = load i32, i32* %6
%15 = lshr i32 %14, 6
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @rgb_to_pixel8(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %0, -32
%5 = lshr i32 %1, 3
%6 = and i32 %5, 536870908
%7 = or i32 %6, %4
%8 = lshr i32 %2, 6
%9 = or i32 %7, %8
ret i32 %9
}
int isreturn(unsigned char c) { return c == '\r' || c == '\n'; }


x86 assembly (clang, -O0):
<isreturn>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isreturn+0x29>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreturn>:
cmp    $0xd,%dil
sete   %al
cmp    $0xa,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isreturn(i8 zeroext %0) {
%2 = icmp eq i8 %0, 13
%3 = icmp eq i8 %0, 10
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned hashFunIncrement(unsigned oldHash, char ch) {
  unsigned newHash = oldHash;
  newHash += ch;
  newHash += (newHash << 10);
  newHash ^= (newHash >> 6);
  return newHash;
}


x86 assembly (clang, -O0):
<hashFunIncrement>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0x5(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0xa,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x6,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashFunIncrement>:
lea    (%rdi,%rsi,1),%eax
mov    %eax,%ecx
shl    $0xa,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x6,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hashFunIncrement(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i32, i32* %5
%10 = add i32 %9, %8
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = shl i32 %11, 10
%13 = load i32, i32* %5
%14 = add i32 %13, %12
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = lshr i32 %15, 6
%17 = load i32, i32* %5
%18 = xor i32 %17, %16
store i32 %18, i32* %5
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @hashFunIncrement(i32 %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = add i32 %3, %0
%5 = mul i32 %4, 1025
%6 = lshr i32 %5, 6
%7 = xor i32 %6, %5
ret i32 %7
}
float convertFtoC(float fahren) {
  float celsius;
  celsius = (fahren - 32) / 1.8;
  return (celsius);
}


x86 assembly (clang, -O0):
<convertFtoC>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertFtoC>:
addss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @convertFtoC(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float %4, 3.200000e+01
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @convertFtoC(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fpext float %2 to double
%4 = fdiv double %3, 1.800000e+00
%5 = fptrunc double %4 to float
ret float %5
}
double Rnet(double alb, double Lnet, double Kin) {
  double result = (1 - alb) * Kin + Lnet;
  return (result);
}


x86 assembly (clang, -O0):
<Rnet>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rnet>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @Rnet(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %6
%11 = load double, double* %5
%12 = call double @llvm.fmuladd.f64(double %9, double %10, double %11)
store double %12, double* %7
%13 = load double, double* %7
ret double %13
}

LLVM IR (-O2):
define double @Rnet(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %1)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ QvalToIangle(unsigned int);
int SIN_ROM(int /*<<< orphan*/);
unsigned SIN_Deg(unsigned qVd) { return (SIN_ROM(QvalToIangle(qVd))); }


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

x86 assembly (clang, -O2):
<SIN_Deg>:
push   %rax
call   1030 <QvalToIangle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <SIN_ROM@plt>

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

LLVM IR (-O2):
define i32 @SIN_Deg(i32 %0) {
%2 = tail call i32 @QvalToIangle(i32 %0)
%3 = tail call i32 @SIN_ROM(i32 %2)
ret i32 %3
}
int test_011(int a, int c, int b, int d) { return (b & 1) + a + b; }


x86 assembly (clang, -O0):
<test_011>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
add    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_011>:
mov    %edx,%eax
and    $0x1,%eax
add    %edi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_011(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = and i32 %9, 1
%11 = load i32, i32* %5
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_011(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %2, 1
%6 = add i32 %2, %0
%7 = add i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Filip Piorski\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 = [15 x i8] c"Filip Piorski\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Filip Piorski\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void uevent_register_notifier(struct uevent_notify *nb) {}


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

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

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

LLVM IR (-O2):
%struct.uevent_notify = type opaque
define void @uevent_register_notifier(%struct.uevent_notify* nocapture %0) {
ret void
}
int reverse(int x) {
  int result = 0;
  while (x != 0) {
    int tail = x % 10;
    int newResult = result * 10 + tail;
    if ((newResult - tail) / 10 != result)
      return 0;
    result = newResult;
    x = x / 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116c <reverse+0x6c>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    -0xc(%rbp),%eax
je     1153 <reverse+0x53>
movl   $0x0,-0x4(%rbp)
jmp    1172 <reverse+0x72>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    110e <reverse+0xe>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
je     113f <reverse+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverse+0x10>
ret

LLVM IR (-O0):
define i32 @reverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %24, %1
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = load i32, i32* %3
%12 = srem i32 %11, 10
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 10
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = sub nsw i32 %17, %18
%20 = sdiv i32 %19, 10
%21 = load i32, i32* %4
%22 = icmp ne i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %10
store i32 0, i32* %2
br label %30
24: ; preds = %10
%25 = load i32, i32* %6
store i32 %25, i32* %4
%26 = load i32, i32* %3
%27 = sdiv i32 %26, 10
store i32 %27, i32* %3
br label %7
28: ; preds = %7
%29 = load i32, i32* %4
store i32 %29, i32* %2
br label %30
30: ; preds = %28, %23
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int getkind();
int /*<<< orphan*/ init();
int /*<<< orphan*/ printf(char *, int);
int main() {
  init();
  printf("%d\n", getkind());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init@plt>
xor    %eax,%eax
call   1030 <getkind@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @getkind()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
void YUY2ToUV422Row_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToUV422Row_Any_SSE2() {
ret void
}
int mapi(int val, int min1, int max1, int min2, int max2) {
  return (val - min1) / (max1 - min1) * (max2 - min2) + min2;
}


x86 assembly (clang, -O0):
<mapi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapi>:
mov    %edx,%r9d
mov    %edi,%eax
sub    %esi,%eax
sub    %esi,%r9d
cltd
idiv   %r9d
sub    %ecx,%r8d
imul   %r8d,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mapi(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = load i32, i32* %7
%16 = sub nsw i32 %14, %15
%17 = sdiv i32 %13, %16
%18 = load i32, i32* %10
%19 = load i32, i32* %9
%20 = sub nsw i32 %18, %19
%21 = mul nsw i32 %17, %20
%22 = load i32, i32* %9
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @mapi(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sub nsw i32 %0, %1
%7 = sub nsw i32 %2, %1
%8 = sdiv i32 %6, %7
%9 = sub nsw i32 %4, %3
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void svcunix_rendezvous_abort(void) { abort(); }


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

x86 assembly (clang, -O2):
<svcunix_rendezvous_abort>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @svcunix_rendezvous_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @svcunix_rendezvous_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ vt100TextDefault();
void PrintNeutralMessage(const char *msg) {
  vt100TextDefault();
  printf("%s\r\n", msg);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @PrintNeutralMessage(i8* %0) {
%2 = tail call i32 (...) @vt100TextDefault()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void lift_free_and_null(void *ptrptr) {
  void **pp = ptrptr;
  if ((NULL != pp) && (NULL != *pp)) {
    free(*pp);
    *pp = NULL;
  }
}


x86 assembly (clang, -O0):
<lift_free_and_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1156 <lift_free_and_null+0x46>
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%rax
je     1156 <lift_free_and_null+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lift_free_and_null>:
push   %rbx
test   %rdi,%rdi
je     112d <lift_free_and_null+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <lift_free_and_null+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lift_free_and_null(i8* %0) {
%2 = bitcast i8* %0 to i8**
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @free(i8* %5)
store i8* null, i8** %2
br label %9
9: ; preds = %7, %4, %1
ret void
}
long calculate_ulint_max() {
  unsigned long int i = 0;
  --i;
  return i;
}


x86 assembly (clang, -O0):
<calculate_ulint_max>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_ulint_max>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @calculate_ulint_max() {
%1 = alloca i64
store i64 0, i64* %1
%2 = load i64, i64* %1
%3 = add i64 %2, -1
store i64 %3, i64* %1
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @calculate_ulint_max() {
ret i64 -1
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
bool defaultCompare(void *a, void *b) {
  return strcmp((char *)a, (char *)b) == 0;
}


x86 assembly (clang, -O0):
<defaultCompare>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defaultCompare>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @defaultCompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @defaultCompare(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int lrand48();
int gen_signed_number(int range) {
  int temp;
  temp = lrand48() % (2 * range);
  temp = temp - (range);
  if (temp >= 0)
    temp++;
  return temp;
}


x86 assembly (clang, -O0):
<gen_signed_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114a <gen_signed_number+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_signed_number>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <lrand48@plt>
lea    (%rbx,%rbx,1),%ecx
cltd
idiv   %ecx
sub    %ebx,%edx
mov    %edx,%eax
not    %eax
shr    $0x1f,%eax
add    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_signed_number(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @lrand48()
%5 = load i32, i32* %2
%6 = mul nsw i32 2, %5
%7 = srem i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gen_signed_number(i32 %0) {
%2 = tail call i32 (...) @lrand48()
%3 = shl nsw i32 %0, 1
%4 = srem i32 %2, %3
%5 = sub nsw i32 %4, %0
%6 = xor i32 %5, -1
%7 = lshr i32 %6, 31
%8 = add nsw i32 %7, %5
ret i32 %8
}
void AbsoluteGoToXY(X, Y) int X, Y;
{
  char Str[20];
  sprintf(Str, "\033[%d;%dH", Y, X);
  WRITETEST(Str);
}


x86 assembly (clang, -O0):
<AbsoluteGoToXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <WRITETEST@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AbsoluteGoToXY>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%edx
mov    %edi,%ecx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <WRITETEST@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @AbsoluteGoToXY(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @AbsoluteGoToXY(i32 %0, i32 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
void write_skiff_init_pid(pid_t pid) {}


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

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

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

LLVM IR (-O2):
define void @write_skiff_init_pid(i32 %0) {
ret void
}