xunge/DecIR huggingface dataset:
/* Type definitions */
struct netif {
  int dummy;
};

/* Variables and functions */
char *ip4addr_ntoa(int /*<<< orphan*/);
int /*<<< orphan*/ netif_ip4_addr(struct netif *);
int /*<<< orphan*/ printf(char *, char *);
void netif_status_callback(struct netif *netif) {
  printf("netif status changed %s\n", ip4addr_ntoa(netif_ip4_addr(netif)));
}


x86 assembly (clang, -O0):
<netif_status_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <netif_ip4_addr@plt>
mov    %eax,%edi
call   1030 <ip4addr_ntoa@plt>
mov    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netif_status_callback>:
push   %rax
call   1050 <netif_ip4_addr@plt>
mov    %eax,%edi
call   1030 <ip4addr_ntoa@plt>
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.netif = type { i32 }
@.str = [25 x i8] c"netif status changed %s\0A\00"
define void @netif_status_callback(%struct.netif* %0) {
%2 = alloca %struct.netif*
store %struct.netif* %0, %struct.netif** %2
%3 = load %struct.netif*, %struct.netif** %2
%4 = call i32 @netif_ip4_addr(%struct.netif* %3)
%5 = call i8* @ip4addr_ntoa(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
%struct.netif = type { i32 }
@.str = [25 x i8] c"netif status changed %s\0A\00"
define void @netif_status_callback(%struct.netif* %0) {
%2 = tail call i32 @netif_ip4_addr(%struct.netif* %0)
%3 = tail call i8* @ip4addr_ntoa(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
long long sqrt(long long);
int isPrime(long long num) {
  long long aux;
  for (aux = 2; aux <= sqrt(num); aux++) {
    if (num % aux == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sqrt@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jg     117b <isPrime+0x6b>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
jne    1165 <isPrime+0x55>
movl   $0x0,-0x4(%rbp)
jmp    1182 <isPrime+0x72>
jmp    116a <isPrime+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <isPrime+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <sqrt@plt>
mov    $0x1,%r14d
cmp    $0x2,%rax
jl     116d <isPrime+0x5d>
mov    $0x1,%ebp
nopl   (%rax)
add    $0x1,%rbp
mov    %rbx,%rax
or     %rbp,%rax
shr    $0x20,%rax
je     1150 <isPrime+0x40>
mov    %rbx,%rax
cqto
idiv   %rbp
test   %rdx,%rdx
jne    115b <isPrime+0x4b>
jmp    116a <isPrime+0x5a>
nop
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
test   %rdx,%rdx
je     116a <isPrime+0x5a>
mov    %rbx,%rdi
call   1030 <sqrt@plt>
cmp    %rax,%rbp
jl     1130 <isPrime+0x20>
jmp    116d <isPrime+0x5d>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isPrime(i64 %0) {
%2 = tail call i64 @sqrt(i64 %0)
%3 = icmp slt i64 %2, 2
br i1 %3, label %12, label %8
4: ; preds = %8
%5 = add nuw nsw i64 %9, 1
%6 = tail call i64 @sqrt(i64 %0)
%7 = icmp slt i64 %9, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %4
%9 = phi i64 [ %5, %4 ], [ 2, %1 ]
%10 = srem i64 %0, %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4, %1
%13 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %13
}
void g_DUMMY_scrollbar_reset(int win_id) { win_id = win_id; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_scrollbar_reset(i32 %0) {
ret void
}
copyip(ipfrom, ipto) int *ipfrom, *ipto;
{
  register int *ipf, *ipt;
  ipf = ipfrom;
  ipt = ipto;
  while ((*ipt = *ipf) && *ipf++ != -1)
    ipt++;
  *ipt = 0;
  return (ipt);
}


x86 assembly (clang, -O0):
<copyip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
je     114e <copyip+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
cmpl   $0xffffffff,(%rax)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    115e <copyip+0x5e>
jmp    116f <copyip+0x6f>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <copyip+0x1c>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyip>:
mov    %rsi,%rax
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
test   %ecx,%ecx
je     1127 <copyip+0x27>
add    $0x4,%rdi
nop
cmpl   $0xffffffff,-0x4(%rdi)
je     1127 <copyip+0x27>
mov    (%rdi),%ecx
mov    %ecx,0x4(%rax)
add    $0x4,%rax
add    $0x4,%rdi
test   %ecx,%ecx
jne    1110 <copyip+0x10>
movl   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i32 @copyip(i32* nocapture %0, i32* %1) {
%3 = load i32, i32* %0
store i32 %3, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %10
%6 = phi i32* [ %12, %10 ], [ %1, %2 ]
%7 = phi i32* [ %11, %10 ], [ %0, %2 ]
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, -1
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = getelementptr inbounds i32, i32* %7, i64 1
%12 = getelementptr inbounds i32, i32* %6, i64 1
%13 = load i32, i32* %11
store i32 %13, i32* %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %10, %2
%16 = phi i32* [ %1, %2 ], [ %12, %10 ], [ %6, %5 ]
store i32 0, i32* %16
%17 = ptrtoint i32* %16 to i64
%18 = trunc i64 %17 to i32
ret i32 %18
}
/* Variables and functions */
size_t rnd();
size_t randomSize8(int i) {
  size_t maxSize = 2 * 160 * 0x2000;
  size_t size;
  size = rnd() %
             ((((maxSize >> (i / 10))) > (2)) ? ((maxSize >> (i / 10))) : (2)) +
         1;
  return size;
}


x86 assembly (clang, -O0):
<randomSize8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x280000,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rnd@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
shr    %cl,%rax
cmp    $0x2,%rax
jbe    117d <randomSize8+0x6d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,%ecx
shr    %cl,%rax
mov    %rax,-0x30(%rbp)
jmp    118b <randomSize8+0x7b>
mov    $0x2,%eax
mov    %rax,-0x30(%rbp)
jmp    118b <randomSize8+0x7b>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
xor    %edx,%edx
div    %rcx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomSize8>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rnd@plt>
movslq %ebx,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
mov    $0x280000,%edx
shr    %cl,%rdx
cmp    $0x3,%rdx
mov    $0x2,%ecx
cmovae %rdx,%rcx
mov    %rax,%rdx
shr    $0x20,%rdx
je     1159 <randomSize8+0x49>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
jmp    115f <randomSize8+0x4f>
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @randomSize8(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
store i64 2621440, i64* %3
%5 = call i64 (...) @rnd()
%6 = load i64, i64* %3
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 10
%9 = zext i32 %8 to i64
%10 = lshr i64 %6, %9
%11 = icmp ugt i64 %10, 2
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = load i64, i64* %3
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 10
%16 = zext i32 %15 to i64
%17 = lshr i64 %13, %16
br label %19
18: ; preds = %1
br label %19
19: ; preds = %18, %12
%20 = phi i64 [ %17, %12 ], [ 2, %18 ]
%21 = urem i64 %5, %20
%22 = add i64 %21, 1
store i64 %22, i64* %4
%23 = load i64, i64* %4
ret i64 %23
}

LLVM IR (-O2):
define i64 @randomSize8(i32 %0) {
%2 = tail call i64 (...) @rnd()
%3 = sdiv i32 %0, 10
%4 = zext i32 %3 to i64
%5 = lshr i64 2621440, %4
%6 = icmp ugt i64 %5, 2
%7 = select i1 %6, i64 %5, i64 2
%8 = urem i64 %2, %7
%9 = add nuw nsw i64 %8, 1
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void hardening_trigger(char *p, int i, void (*f)(char *)) {
  char test[10];
  memcpy(test, p, i);
  f(test);
  printf("%s", test);
}


x86 assembly (clang, -O0):
<hardening_trigger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
lea    -0x22(%rbp),%rdi
call   *%rax
lea    -0x22(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hardening_trigger>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xe(%rsp),%r14
mov    %r14,%rdi
call   1040 <memcpy@plt>
mov    %r14,%rdi
call   *%rbx
lea    0xeb8(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @hardening_trigger(i8* %0, i32 %1, void (i8*)* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca void (i8*)*
%7 = alloca [10 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store void (i8*)* %2, void (i8*)** %6
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
%12 = load void (i8*)*, void (i8*)** %6
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @hardening_trigger(i8* %0, i32 %1, void (i8*)* nocapture %2) {
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = call i32 @memcpy(i8* %5, i8* %0, i32 %1)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int strlen(char *);
char *substr(char *, char *);
char *dupstr(char *str) { return substr(str, str + strlen(str)); }


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdi
cltq
add    %rax,%rsi
call   1040 <substr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rsi
add    %rbx,%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <substr@plt>

LLVM IR (-O0):
define i8* @dupstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = call i8* @substr(i8* %3, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @dupstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i8* @substr(i8* %0, i8* %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int openat(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int main(void) {
  int fd = openat(0, "/", O_RDONLY);
  return (fd < 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
lea    0xecf(%rip),%rsi
call   1030 <openat@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0xedf(%rip),%rsi
xor    %edi,%edi
call   1030 <openat@plt>
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @openat(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @openat(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = lshr i32 %2, 31
ret i32 %3
}
void rop3_240_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  *D = (T & S) | (T & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_240_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_240_0_1>:
mov    %edx,%eax
and    %sil,%al
not    %sil
and    %dl,%sil
and    (%rdi),%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_240_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = and i32 %8, %10
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = and i32 %13, %16
%18 = or i32 %11, %17
%19 = load i8, i8* %6
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = and i32 %24, %27
%29 = or i32 %18, %28
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_240_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = xor i8 %1, -1
%6 = and i8 %5, %2
%7 = load i8, i8* %0
%8 = and i8 %6, %7
%9 = or i8 %8, %4
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setU2();
__attribute__((constructor)) void myInit() { setU2(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit, i8* null }]
define void @myInit() {
%1 = call i32 (...) @setU2()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit, i8* null }]
define void @myInit() {
%1 = tail call i32 (...) @setU2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glfwTerminate();
int /*<<< orphan*/ runGame();
int /*<<< orphan*/ setupLibraries(int, char **);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand((unsigned)time(NULL));
  setupLibraries(argc, argv);
  runGame();
  glfwTerminate();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <setupLibraries@plt>
mov    $0x0,%al
call   1070 <runGame@plt>
mov    $0x0,%al
call   1060 <glfwTerminate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <setupLibraries@plt>
xor    %eax,%eax
call   1070 <runGame@plt>
xor    %eax,%eax
call   1060 <glfwTerminate@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @time(i32* null)
%7 = trunc i64 %6 to i32
%8 = call i32 @srand(i32 %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @setupLibraries(i32 %9, i8** %10)
%12 = call i32 (...) @runGame()
%13 = call i32 (...) @glfwTerminate()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 @setupLibraries(i32 %0, i8** %1)
%7 = tail call i32 (...) @runGame()
%8 = tail call i32 (...) @glfwTerminate()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Cdgesd2d(int, int, int, double *, int, int, int);
void wcc_Cdgesd2d(int ConTxt, int m, int n, char *A, int lda, int rdest,
                  int cdest) {
  Cdgesd2d(ConTxt, m, n, (double *)A, lda, rdest, cdest);
}


x86 assembly (clang, -O0):
<wcc_Cdgesd2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <Cdgesd2d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_Cdgesd2d>:
jmp    1030 <Cdgesd2d@plt>

LLVM IR (-O0):
define void @wcc_Cdgesd2d(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i8*, i8** %11
%19 = bitcast i8* %18 to double*
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = call i32 @Cdgesd2d(i32 %15, i32 %16, i32 %17, double* %19, i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @wcc_Cdgesd2d(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = bitcast i8* %3 to double*
%9 = tail call i32 @Cdgesd2d(i32 %0, i32 %1, i32 %2, double* %8, i32 %4, i32 %5, i32 %6)
ret void
}
int imin(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <imin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void X509V3_add_standard_extensions(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_add_standard_extensions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x06() {
  Assert_real((isalnum(6) == 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_isalnum.c",
              35, ("isalnum should be 0 for 0x06"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x06>:
push   %rax
mov    $0x6,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x23,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x06\00"
define void @t_isalnum_0x06() {
%1 = call i64 @isalnum(i32 6)
%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 35, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x06\00"
define void @t_isalnum_0x06() {
%1 = tail call i64 @isalnum(i32 6)
%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 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long insert_bd(unsigned long insn, long value, const char **errmsg) {
  return insn | (value & 0xfffc);
}


x86 assembly (clang, -O0):
<insert_bd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0xfffc,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_bd>:
mov    %rsi,%rax
and    $0xfffc,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @insert_bd(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = and i64 %8, 65532
%10 = or i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @insert_bd(i64 %0, i64 %1, i8** nocapture readnone %2) {
%4 = and i64 %1, 65532
%5 = or i64 %4, %0
ret i64 %5
}
int flag_index(char c) {
  int idx;
  if (c >= 'A' && c <= 'Z') {
    idx = 26 + (c - 'A');
  } else if (c >= 'a' && c <= 'z') {
    idx = (c - 'a');
  } else {
    idx = -1;
  }
  return idx;
}


x86 assembly (clang, -O0):
<flag_index>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <flag_index+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <flag_index+0x36>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x1a,%eax
mov    %eax,-0x8(%rbp)
jmp    116b <flag_index+0x6b>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     115f <flag_index+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     115f <flag_index+0x5f>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <flag_index+0x66>
movl   $0xffffffff,-0x8(%rbp)
jmp    116b <flag_index+0x6b>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_index>:
mov    %edi,%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     110e <flag_index+0xe>
add    $0xffffffd9,%eax
ret
lea    -0x61(%rax),%ecx
add    $0xffffff9f,%eax
cmp    $0x1a,%cl
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @flag_index(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 26, %14
store i32 %15, i32* %3
br label %30
16: ; preds = %7, %1
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 97
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 122
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8, i8* %2
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 97
store i32 %27, i32* %3
br label %29
28: ; preds = %20, %16
store i32 -1, i32* %3
br label %29
29: ; preds = %28, %24
br label %30
30: ; preds = %29, %11
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @flag_index(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -39
br label %12
7: ; preds = %1
%8 = add i8 %0, -97
%9 = icmp ult i8 %8, 26
%10 = add nsw i32 %2, -97
%11 = select i1 %9, i32 %10, i32 -1
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int pthread_cancel(int /*<<< orphan*/);
void __safe_p_cancel(pthread_t t) {
  int en = pthread_cancel(t);
  if (en) {
    abort();
  }
}


x86 assembly (clang, -O0):
<__safe_p_cancel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pthread_cancel@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1147 <__safe_p_cancel+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__safe_p_cancel>:
push   %rax
call   1040 <pthread_cancel@plt>
test   %eax,%eax
jne    112c <__safe_p_cancel+0xc>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__safe_p_cancel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @pthread_cancel(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @__safe_p_cancel(i32 %0) {
%2 = tail call i32 @pthread_cancel(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int atoh(char *str) {
  int val;
  sscanf(str, "%x", &val);
  return val;
}


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

x86 assembly (clang, -O2):
<atoh>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @atoh(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ munmap(void *, unsigned int);
void file_unmap(int fd, void *map, unsigned int size) {
  munmap(map, size);
  close(fd);
}


x86 assembly (clang, -O0):
<file_unmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <munmap@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_unmap>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <munmap@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @file_unmap(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 i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @munmap(i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @close(i32 %10)
ret void
}

LLVM IR (-O2):
define void @file_unmap(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @munmap(i8* %1, i32 %2)
%5 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void freeCharMatrixInline(char **matrix) { free(matrix); }


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

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

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

LLVM IR (-O2):
define void @freeCharMatrixInline(i8** nocapture %0) {
%2 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void die_usage(void) {
  fputs("Usage: hashstr algorithm string\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<die_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: hashstr algorithm string\0A\00"
@stderr = global i32 0
define void @die_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: hashstr algorithm string\0A\00"
@stderr = global i32 0
define void @die_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct mm {
  int dummy;
};

/* Variables and functions */
int opt_build(struct mm *);
int opt_init(struct mm *mm) { return opt_build(mm); }


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

x86 assembly (clang, -O2):
<opt_init>:
jmp    1030 <opt_build@plt>

LLVM IR (-O0):
%struct.mm = type { i32 }
define i32 @opt_init(%struct.mm* %0) {
%2 = alloca %struct.mm*
store %struct.mm* %0, %struct.mm** %2
%3 = load %struct.mm*, %struct.mm** %2
%4 = call i32 @opt_build(%struct.mm* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.mm = type { i32 }
define i32 @opt_init(%struct.mm* %0) {
%2 = tail call i32 @opt_build(%struct.mm* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void printUsage(char *programName) {
  printf("\n Usage: %s  [Character: pipe-type, n for named, u for unamed] "
         "[String: If pipe-type is n, enter the name of the pipe] [Character: "
         "The direction of the pipe, p for parent to child, c for child to "
         "parent] [String: message that will be transffered between child and "
         "parent. Maximum of 32 characters.]\n",
         programName);
  exit(1);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [300 x i8] c"\0A Usage: %s [Character: pipe-type, n for named, u for unamed] [String: If pipe-type is n, enter the name of the pipe] [Character: The direction of the pipe, p for parent to child, c for child to parent] [String: message that will be transffered between child and parent. Maximum of 32 characters.]\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [300 x i8] c"\0A Usage: %s [Character: pipe-type, n for named, u for unamed] [String: If pipe-type is n, enter the name of the pipe] [Character: The direction of the pipe, p for parent to child, c for child to parent] [String: message that will be transffered between child and parent. Maximum of 32 characters.]\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((unused)) int iuAlwaysZero(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @iuAlwaysZero() {
ret i32 0
}
__attribute__((always_)) __attribute__((warn_unused_result)) float
fclamp2(float in, float min, float max) {
  return in >= max ? max : (in <= min ? min : in);
}


x86 assembly (clang, -O0):
<fclamp2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1131 <fclamp2+0x31>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <fclamp2+0x67>
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1153 <fclamp2+0x53>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <fclamp2+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @fclamp2(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fcmp oge float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %6
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %5
%15 = fcmp ole float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %5
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @fclamp2(float %0, float %1, float %2) {
%4 = fcmp ult float %0, %2
%5 = fcmp ole float %0, %1
%6 = select i1 %5, float %1, float %0
%7 = select i1 %4, float %6, float %2
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigint_handler(int sig) { printf("SIGINT recieved.\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"SIGINT recieved.\00"
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_memory_new();
int /*<<< orphan*/ test_memory_old();
int main(void) {
  if (1)
    test_memory_old();
  if (1)
    test_memory_new();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_memory_old()
%2 = tail call i32 (...) @test_memory_new()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_ram();
void n32016_init() { init_ram(); }


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

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

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

LLVM IR (-O2):
define void @n32016_init() {
%1 = tail call i32 (...) @init_ram()
ret void
}
void swapPuntero(void **p1, void **p2) {
  void *paux;
  paux = *p1;
  *p1 = *p2;
  *p2 = paux;
}


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

x86 assembly (clang, -O2):
<swapPuntero>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @swapPuntero(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swapPuntero(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
void qdss_put(struct qdss_source *src) {}


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

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

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

LLVM IR (-O2):
%struct.qdss_source = type opaque
define void @qdss_put(%struct.qdss_source* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FS460_autofade(int, int, int);
void demo_autofade(void) {
  static int mode = 0;
  switch (mode++) {
  default:
    mode = 1;
  case 0:
    FS460_autofade(127, 0, 2000);
    break;
  case 1:
    FS460_autofade(0, 127, 2000);
    break;
  }
}


x86 assembly (clang, -O0):
<demo_autofade>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f0e(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f00(%rip)
test   %eax,%eax
je     1154 <demo_autofade+0x44>
jmp    1139 <demo_autofade+0x29>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
je     116a <demo_autofade+0x5a>
jmp    114a <demo_autofade+0x3a>
movl   $0x1,0x2ed8(%rip)
mov    $0x7f,%edi
xor    %esi,%esi
mov    $0x7d0,%edx
call   1030 <FS460_autofade@plt>
jmp    117b <demo_autofade+0x6b>
xor    %edi,%edi
mov    $0x7f,%esi
mov    $0x7d0,%edx
call   1030 <FS460_autofade@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<demo_autofade>:
mov    0x2f16(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0d(%rip)
test   %eax,%eax
je     1143 <demo_autofade+0x33>
cmp    $0x1,%eax
jne    1139 <demo_autofade+0x29>
xor    %edi,%edi
mov    $0x7f,%esi
mov    $0x7d0,%edx
jmp    1030 <FS460_autofade@plt>
movl   $0x1,0x2ee9(%rip)
mov    $0x7f,%edi
xor    %esi,%esi
mov    $0x7d0,%edx
jmp    1030 <FS460_autofade@plt>

LLVM IR (-O0):
@demo_autofade.mode = internal global i32 0
define void @demo_autofade() {
%1 = load i32, i32* @demo_autofade.mode
%2 = add nsw i32 %1, 1
store i32 %2, i32* @demo_autofade.mode
switch i32 %1, label %3 [
i32 0, label %4
i32 1, label %6
]
3: ; preds = %0
store i32 1, i32* @demo_autofade.mode
br label %4
4: ; preds = %0, %3
%5 = call i32 @FS460_autofade(i32 127, i32 0, i32 2000)
br label %8
6: ; preds = %0
%7 = call i32 @FS460_autofade(i32 0, i32 127, i32 2000)
br label %8
8: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@demo_autofade.mode = internal unnamed_addr global i32 0
define void @demo_autofade() {
%1 = load i32, i32* @demo_autofade.mode
%2 = add nsw i32 %1, 1
store i32 %2, i32* @demo_autofade.mode
switch i32 %1, label %3 [
i32 0, label %4
i32 1, label %6
]
3: ; preds = %0
store i32 1, i32* @demo_autofade.mode
br label %4
4: ; preds = %0, %3
%5 = tail call i32 @FS460_autofade(i32 127, i32 0, i32 2000)
br label %8
6: ; preds = %0
%7 = tail call i32 @FS460_autofade(i32 0, i32 127, i32 2000)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qsort(void *, size_t, size_t,
                         int (*)(void const *, void const *));
int qsort_opt(void *base, size_t nelem, size_t es,
              int (*compar)(const void *, const void *)) {
  qsort(base, nelem, es, compar);
  return 1;
}


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

x86 assembly (clang, -O2):
<qsort_opt>:
push   %rax
call   1030 <qsort@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @qsort_opt(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%13 = call i32 @qsort(i8* %9, i64 %10, i64 %11, i32 (i8*, i8*)* %12)
ret i32 1
}

LLVM IR (-O2):
define i32 @qsort_opt(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* nocapture %3) {
%5 = tail call i32 @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3)
ret i32 1
}