xunge/DecIR huggingface dataset:
int sum_square_difference_2(int num) {
  int sum = 0;
  int sum_of_num_natural_numbers = num * (num - 1) / 2;
  int sum_of_squares = (num * (num + 1) * (2 * num + 1)) / 6;
  sum =
      sum_of_num_natural_numbers * sum_of_num_natural_numbers - sum_of_squares;
  return sum;
}


x86 assembly (clang, -O0):
<sum_square_difference_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_square_difference_2>:
lea    -0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
lea    (%rdi,%rdi,1),%edx
add    $0x1,%edx
imul   %ecx,%edx
movslq %edx,%rcx
imul   $0xffffffffd5555555,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
imul   %eax,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sum_square_difference_2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %0, 1
%6 = mul nsw i32 %5, %0
%7 = shl nsw i32 %0, 1
%8 = or i32 %7, 1
%9 = mul nsw i32 %6, %8
%10 = sdiv i32 %9, -6
%11 = mul nsw i32 %4, %4
%12 = add i32 %10, %11
ret i32 %12
}
char translate(char ch) {
  switch (ch) {
  case '{':
    return '<';
  case '}':
    return '>';
  case 'i':
    return '^';
  case '!':
    return 'v';
  }
  return ch;
}


x86 assembly (clang, -O0):
<translate>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x21,%eax
je     116d <translate+0x6d>
jmp    111f <translate+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x69,%eax
je     1164 <translate+0x64>
jmp    1130 <translate+0x30>
mov    -0x8(%rbp),%eax
sub    $0x7b,%eax
je     1152 <translate+0x52>
jmp    1141 <translate+0x41>
mov    -0x8(%rbp),%eax
sub    $0x7d,%eax
je     115b <translate+0x5b>
jmp    1176 <translate+0x76>
movb   $0x3c,-0x1(%rbp)
jmp    117c <translate+0x7c>
movb   $0x3e,-0x1(%rbp)
jmp    117c <translate+0x7c>
movb   $0x5e,-0x1(%rbp)
jmp    117c <translate+0x7c>
movb   $0x76,-0x1(%rbp)
jmp    117c <translate+0x7c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate>:
mov    %edi,%eax
cmp    $0x7a,%edi
jg     1114 <translate+0x14>
cmp    $0x21,%eax
je     1121 <translate+0x21>
cmp    $0x69,%eax
jne    1123 <translate+0x23>
mov    $0x5e,%al
ret
cmp    $0x7b,%eax
je     1124 <translate+0x24>
cmp    $0x7d,%eax
jne    1123 <translate+0x23>
mov    $0x3e,%al
ret
mov    $0x76,%al
ret
mov    $0x3c,%al
ret

LLVM IR (-O0):
define signext i8 @translate(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 123, label %6
i32 125, label %7
i32 105, label %8
i32 33, label %9
]
6: ; preds = %1
store i8 60, i8* %2
br label %12
7: ; preds = %1
store i8 62, i8* %2
br label %12
8: ; preds = %1
store i8 94, i8* %2
br label %12
9: ; preds = %1
store i8 118, i8* %2
br label %12
10: ; preds = %1
%11 = load i8, i8* %3
store i8 %11, i8* %2
br label %12
12: ; preds = %10, %9, %8, %7, %6
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @translate(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 123, label %7
i32 125, label %3
i32 105, label %4
i32 33, label %5
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i8 [ %0, %6 ], [ 118, %5 ], [ 94, %4 ], [ 62, %3 ], [ 60, %1 ]
ret i8 %8
}
/* Variables and functions */
char *strtok(char *, char *);
char *get_value(char *line) {
  char *token, *tmp;
  token = strtok(line, " ");
  for (;;) {
    if ((tmp = strtok(NULL, " ")) == NULL)
      break;
    else
      token = tmp;
  }
  return token;
}


x86 assembly (clang, -O0):
<get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xec5(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1153 <get_value+0x43>
jmp    1160 <get_value+0x50>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <get_value+0x20>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    %r14,%rsi
call   1030 <strtok@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rbx
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
jne    1130 <get_value+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i8* @get_value(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %5, %3 ]
%5 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %3
7: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushreal8array(double *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 8));
}


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

x86 assembly (clang, -O2):
<pushreal8array>:
shl    $0x3,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushreal8array(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = bitcast double* %5 to i8*
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 8
%9 = call i32 @pushNarray(i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushreal8array(double* %0, i32 %1) {
%3 = bitcast double* %0 to i8*
%4 = shl nsw i32 %1, 3
%5 = tail call i32 @pushNarray(i8* %3, i32 %4)
ret void
}
void mark_dirty(struct domain *d, unsigned int mfn) {}


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

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

LLVM IR (-O0):
%struct.domain = type opaque
define void @mark_dirty(%struct.domain* %0, i32 %1) {
%3 = alloca %struct.domain*
%4 = alloca i32
store %struct.domain* %0, %struct.domain** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.domain = type opaque
define void @mark_dirty(%struct.domain* nocapture %0, i32 %1) {
ret void
}
unsigned int get_ushort_i(const unsigned char *buf_ptr) {
  return ((unsigned int)buf_ptr[0]) + ((unsigned int)buf_ptr[1] << 8);
}


x86 assembly (clang, -O0):
<get_ushort_i>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ushort_i>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_ushort_i(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = add i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_ushort_i(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
void ppp() {}


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

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

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

LLVM IR (-O2):
define void @ppp() {
ret void
}
void affichage_liste(struct elem *liste) {}


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

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

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

LLVM IR (-O2):
%struct.elem = type opaque
define void @affichage_liste(%struct.elem* nocapture %0) {
ret void
}
/* Variables and functions */
int iptables_command(char *, char const *);
int deny_mac(const char *mac) {
  return iptables_command(
      "iptables -t nat -D prerouting_rule -m mac --mac-source %s -j RETURN",
      mac);
}


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

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

LLVM IR (-O0):
@.str = [68 x i8] c"iptables -t nat -D prerouting_rule -m mac --mac-source %s -j RETURN\00"
define i32 @deny_mac(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @iptables_command(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [68 x i8] c"iptables -t nat -D prerouting_rule -m mac --mac-source %s -j RETURN\00"
define i32 @deny_mac(i8* %0) {
%2 = tail call i32 @iptables_command(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
void swap(int num1, int num2) {
  int temp = num1;
  num1 = num2;
  num1 = temp;
  return;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _ping_error(char const *message, int ret) {
  fputs("ping"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_ping_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ping_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"ping: \00"
@stderr = global i32 0
define i32 @_ping_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
int onion_html_encoding_size(char c) {
  switch (c) {
  case '<':
    return 4;
  case '>':
    return 4;
  case '&':
    return 4;
  case '"':
    return 6;
  case '\'':
    return 5;
  }
  return 1;
}


x86 assembly (clang, -O0):
<onion_html_encoding_size>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x1c,%eax
ja     1170 <onion_html_encoding_size+0x70>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x4,-0x4(%rbp)
jmp    1177 <onion_html_encoding_size+0x77>
movl   $0x4,-0x4(%rbp)
jmp    1177 <onion_html_encoding_size+0x77>
movl   $0x4,-0x4(%rbp)
jmp    1177 <onion_html_encoding_size+0x77>
movl   $0x6,-0x4(%rbp)
jmp    1177 <onion_html_encoding_size+0x77>
movl   $0x5,-0x4(%rbp)
jmp    1177 <onion_html_encoding_size+0x77>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onion_html_encoding_size>:
add    $0xffffffde,%edi
cmp    $0x1c,%edi
ja     1124 <onion_html_encoding_size+0x24>
mov    $0x4,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
mov    $0x6,%eax
ret
mov    $0x1,%eax
ret
mov    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @onion_html_encoding_size(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 60, label %6
i32 62, label %7
i32 38, label %8
i32 34, label %9
i32 39, label %10
]
6: ; preds = %1
store i32 4, i32* %2
br label %12
7: ; preds = %1
store i32 4, i32* %2
br label %12
8: ; preds = %1
store i32 4, i32* %2
br label %12
9: ; preds = %1
store i32 6, i32* %2
br label %12
10: ; preds = %1
store i32 5, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @onion_html_encoding_size(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 60, label %6
i32 62, label %6
i32 38, label %6
i32 34, label %3
i32 39, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %1, %5, %4, %3
%7 = phi i32 [ 1, %5 ], [ 5, %4 ], [ 6, %3 ], [ 4, %1 ], [ 4, %1 ], [ 4, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char,
                           unsigned char);
int /*<<< orphan*/ stderr;
int hash(unsigned char c) {
  if (c < 256 && c >= 0)
    return c;
  else {
    fprintf(stderr, "\nhash is not between 0 to 255 %d %d", c, c);
    return c;
  }
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x100,%eax
jge    1146 <hash+0x36>
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jl     1146 <hash+0x36>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <hash+0x5c>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    -0x5(%rbp),%al
lea    0xea7(%rip),%rsi
movzbl %al,%edx
movzbl -0x5(%rbp),%ecx
call   1030 <fprintf@plt>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"\0Ahash is not between 0 to 255 %d %d\00"
define i32 @hash(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 256
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
store i32 %13, i32* %2
br label %21
14: ; preds = %7, %1
%15 = load i32, i32* @stderr
%16 = load i8, i8* %3
%17 = load i8, i8* %3
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %16, i8 zeroext %17)
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
store i32 %20, i32* %2
br label %21
21: ; preds = %14, %11
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @hash(i8 zeroext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, char *);
void notGoodSubnet(char *sns) {
  errAbort("'%s' is not a properly formatted subnet.  Subnets must consist of\n"
           "one to three dot-separated numbers between 0 and 255",
           sns);
}


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

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

LLVM IR (-O0):
@.str = [119 x i8] c"'%s' is not a properly formatted subnet. Subnets must consist of\0Aone to three dot-separated numbers between 0 and 255\00"
define void @notGoodSubnet(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @errAbort(i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [119 x i8] c"'%s' is not a properly formatted subnet. Subnets must consist of\0Aone to three dot-separated numbers between 0 and 255\00"
define void @notGoodSubnet(i8* %0) {
%2 = tail call i32 @errAbort(i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u_char;

/* Variables and functions */
int /*<<< orphan*/ cbmarch_pp_read(int);
__u_char cbm_pp_read(int HandleDevice) {
  ;
  return cbmarch_pp_read(HandleDevice);
}


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

x86 assembly (clang, -O2):
<cbm_pp_read>:
jmp    1030 <cbmarch_pp_read@plt>

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

LLVM IR (-O2):
define i32 @cbm_pp_read(i32 %0) {
%2 = tail call i32 @cbmarch_pp_read(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bandicoot_init();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ runBadCode();
int main() {
  printf("Initializing Bandicoot.\n");
  bandicoot_init();
  printf("Calling bad function.\n");
  runBadCode();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Initializing Bandicoot.\0A\00"
@.str.1 = [23 x i8] c"Calling bad function.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @bandicoot_init()
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @runBadCode()
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Initializing Bandicoot.\00"
@str.2 = [22 x i8] c"Calling bad function.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @bandicoot_init()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 (...) @runBadCode()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void sig_third_stop_handle(int signal) {
  sleep(15);
  printf("third process quit!\n");
}


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

x86 assembly (clang, -O2):
<sig_third_stop_handle>:
push   %rax
mov    $0xf,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"third process quit!\0A\00"
define void @sig_third_stop_handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sleep(i32 15)
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"third process quit!\00"
define void @sig_third_stop_handle(i32 %0) {
%2 = tail call i32 @sleep(i32 15)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_memdel(void **ap) {
  free(*ap);
  *ap = ((void *)0);
}


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

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

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

LLVM IR (-O2):
define void @ft_memdel(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_READONLY;
int memShmMap(sqlite3_file *pFile, int iPg, int pgsz, int bExtend,
              void volatile **pp) {
  return SQLITE_READONLY;
}


x86 assembly (clang, -O0):
<memShmMap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@SQLITE_READONLY = global i32 0
define i32 @memShmMap(i32* %0, i32 %1, i32 %2, i32 %3, i8** %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8**
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8** %4, i8*** %10
%11 = load i32, i32* @SQLITE_READONLY
ret i32 %11
}

LLVM IR (-O2):
@SQLITE_READONLY = global i32 0
define i32 @memShmMap(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i8** nocapture readnone %4) {
%6 = load i32, i32* @SQLITE_READONLY
ret i32 %6
}
int do_454() { return 454; }


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

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

LLVM IR (-O0):
define i32 @do_454() {
ret i32 454
}

LLVM IR (-O2):
define i32 @do_454() {
ret i32 454
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void ShowBanner(void) {
  printf("%s Multiprotocol VPN tool (%s).\n%s\n\n",
         "MultiVPN - Multiprotocol VPN tool", "v0.0.1",
         "Gorka Gorrotxategi - zgor <zgor@int80h.net>, Jose Ignacio Sanchez "
         "Martin - Topo[LB] <topolb@users.sourceforge.net>");
}


x86 assembly (clang, -O0):
<ShowBanner>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf03(%rip),%rsi
lea    0xf1e(%rip),%rdx
lea    0xf1e(%rip),%rcx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowBanner>:
lea    0xee9(%rip),%rdi
lea    0xf07(%rip),%rsi
lea    0xf22(%rip),%rdx
lea    0xf22(%rip),%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"%s Multiprotocol VPN tool (%s).\0A%s\0A\0A\00"
@.str.1 = [34 x i8] c"MultiVPN - Multiprotocol VPN tool\00"
@.str.2 = [7 x i8] c"v0.0.1\00"
@.str.3 = [115 x i8] c"Gorka Gorrotxategi - zgor <zgor@int80h.net>, Jose Ignacio Sanchez Martin - Topo[LB] <topolb@users.sourceforge.net>\00"
define void @ShowBanner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"%s Multiprotocol VPN tool (%s).\0A%s\0A\0A\00"
@.str.1 = [34 x i8] c"MultiVPN - Multiprotocol VPN tool\00"
@.str.2 = [7 x i8] c"v0.0.1\00"
@.str.3 = [115 x i8] c"Gorka Gorrotxategi - zgor <zgor@int80h.net>, Jose Ignacio Sanchez Martin - Topo[LB] <topolb@users.sourceforge.net>\00"
define void @ShowBanner() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int read(int, char *, int);
int serialReadChar(int fd) {
  char c;
  if (read(fd, &c, 1) == 1) {
    return ((int)c) & 0xFF;
  }
  return -1;
}


x86 assembly (clang, -O0):
<serialReadChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jne    1146 <serialReadChar+0x36>
movsbl -0x9(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
jmp    114d <serialReadChar+0x3d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialReadChar>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movzbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serialReadChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @read(i32 %5, i8* %4, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = and i32 %10, 255
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @serialReadChar(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cglognot(void) {
  gen("neg\tax");
  gen("sbb\tax,ax");
  gen("inc\tax");
}


x86 assembly (clang, -O0):
<cglognot>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <gen@plt>
lea    0xee0(%rip),%rdi
call   1030 <gen@plt>
lea    0xede(%rip),%rdi
call   1030 <gen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cglognot>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <gen@plt>
lea    0xee3(%rip),%rdi
call   1030 <gen@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"neg\09ax\00"
@.str.1 = [10 x i8] c"sbb\09ax,ax\00"
@.str.2 = [7 x i8] c"inc\09ax\00"
define void @cglognot() {
%1 = call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"neg\09ax\00"
@.str.1 = [10 x i8] c"sbb\09ax,ax\00"
@.str.2 = [7 x i8] c"inc\09ax\00"
define void @cglognot() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CLEAR_PRINTS();
int /*<<< orphan*/ PRINT_STRING_WITH_TWO_LITERAL_STRINGS(char *, char *, char *,
                                                         int, int);
void print_two(char *text, char *text2) {
  CLEAR_PRINTS();
  PRINT_STRING_WITH_TWO_LITERAL_STRINGS("string", text, text2, 3000, 1);
  return;
}


x86 assembly (clang, -O0):
<print_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <CLEAR_PRINTS@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rdi
mov    $0xbb8,%ecx
mov    $0x1,%r8d
call   1040 <PRINT_STRING_WITH_TWO_LITERAL_STRINGS@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_two>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <CLEAR_PRINTS@plt>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0xbb8,%ecx
mov    $0x1,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <PRINT_STRING_WITH_TWO_LITERAL_STRINGS@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"string\00"
define void @print_two(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @CLEAR_PRINTS()
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @PRINT_STRING_WITH_TWO_LITERAL_STRINGS(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7, i32 3000, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"string\00"
define void @print_two(i8* %0, i8* %1) {
%3 = tail call i32 (...) @CLEAR_PRINTS()
%4 = tail call i32 @PRINT_STRING_WITH_TWO_LITERAL_STRINGS(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 3000, i32 1)
ret void
}
/* Type definitions */
struct dance_matrix {
  int dummy;
};

/* Variables and functions */
int dance_init_cap(struct dance_matrix *, size_t, size_t, int const *, int);
int dance_init(struct dance_matrix *m, size_t rows, size_t cols,
               const int *data) {
  return dance_init_cap(m, rows, cols, data, 1000);
}


x86 assembly (clang, -O0):
<dance_init>:
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
mov    $0x3e8,%r8d
call   1030 <dance_init_cap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dance_init>:
mov    $0x3e8,%r8d
jmp    1030 <dance_init_cap@plt>

LLVM IR (-O0):
%struct.dance_matrix = type { i32 }
define i32 @dance_init(%struct.dance_matrix* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca %struct.dance_matrix*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store %struct.dance_matrix* %0, %struct.dance_matrix** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load %struct.dance_matrix*, %struct.dance_matrix** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i32 @dance_init_cap(%struct.dance_matrix* %9, i64 %10, i64 %11, i32* %12, i32 1000)
ret i32 %13
}

LLVM IR (-O2):
%struct.dance_matrix = type { i32 }
define i32 @dance_init(%struct.dance_matrix* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i32 @dance_init_cap(%struct.dance_matrix* %0, i64 %1, i64 %2, i32* %3, i32 1000)
ret i32 %5
}
void omap5_register_ion(void) { return; }


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

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

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

LLVM IR (-O2):
define void @omap5_register_ion() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _assert_int_equal(unsigned long long, unsigned long long,
                                     char *, int);
scalar_t__ find_operator_function_by_string(int /*<<< orphan*/,
                                            int /*<<< orphan*/ *, char *);
void test_find_operator_function_by_string_valid_null_functions(void **state) {
  (void)state;
  _assert_int_equal(
      ((unsigned long long)((
          size_t)(find_operator_function_by_string(0, NULL, "test")))),
      ((unsigned long long)((size_t)(NULL))),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/heads/master/example/"
      "calculator_test.c",
      162);
}


x86 assembly (clang, -O0):
<test_find_operator_function_by_string_valid_null_functions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
lea    0xec7(%rip),%rdx
call   1030 <find_operator_function_by_string@plt>
mov    %rax,%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xeb9(%rip),%rdx
mov    $0xa2,%ecx
call   1040 <_assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_find_operator_function_by_string_valid_null_functions>:
push   %rax
lea    0xed8(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <find_operator_function_by_string@plt>
lea    0xecd(%rip),%rdx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa2,%ecx
pop    %rax
jmp    1040 <_assert_int_equal@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/heads/master/example/calculator_test.c\00"
define void @test_find_operator_function_by_string_valid_null_functions(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i64 @find_operator_function_by_string(i32 0, i32* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @_assert_int_equal(i64 %4, i64 0, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 162)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/heads/master/example/calculator_test.c\00"
define void @test_find_operator_function_by_string_valid_null_functions(i8** nocapture readnone %0) {
%2 = tail call i64 @find_operator_function_by_string(i32 0, i32* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @_assert_int_equal(i64 %2, i64 0, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 162)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, size_t);
void dcFreeWX(void *p, size_t size) { munmap(p, size); }


x86 assembly (clang, -O0):
<dcFreeWX>:
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 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcFreeWX>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @dcFreeWX(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
void rop3_105_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_105_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)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%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_105_0_1>:
mov    (%rdi),%r8b
mov    %esi,%ecx
xor    %dl,%cl
xor    %r8b,%cl
not    %cl
mov    %edx,%eax
not    %al
or     %sil,%al
and    %cl,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_105_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_105_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, %2
%6 = xor i8 %5, %4
%7 = xor i8 %6, -1
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %9, %7
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
int zero_barcount(foundbar)
int *foundbar;
{
  *foundbar = 0;
  return (0);
}


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

x86 assembly (clang, -O2):
<zero_barcount>:
movl   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @zero_barcount(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ max_height;
};
typedef TYPE_1__ XIconSize;

/* Variables and functions */
int get_XIconSize_max_height(void *_p) {
  return (int)((XIconSize *)_p)->max_height;
}


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

x86 assembly (clang, -O2):
<get_XIconSize_max_height>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XIconSize_max_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XIconSize_max_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void abort(void) {
  _exit(127);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    $0x7f,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define void @abort() {
%1 = tail call i32 @_exit(i32 127)
unreachable
}
int nwd(int a, int b) {
  int tmp;
  while (b != 0) {
    tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}


x86 assembly (clang, -O0):
<nwd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <nwd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <nwd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nwd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <nwd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <nwd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @nwd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
int okn_mtx4_mult(struct okn_mtx4 *result, struct okn_mtx4 *m1,
                  struct okn_mtx4 *m2) {}


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

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

LLVM IR (-O0):
%struct.okn_mtx4 = type opaque
define i32 @okn_mtx4_mult(%struct.okn_mtx4* %0, %struct.okn_mtx4* %1, %struct.okn_mtx4* %2) {
%4 = alloca i32
%5 = alloca %struct.okn_mtx4*
%6 = alloca %struct.okn_mtx4*
%7 = alloca %struct.okn_mtx4*
store %struct.okn_mtx4* %0, %struct.okn_mtx4** %5
store %struct.okn_mtx4* %1, %struct.okn_mtx4** %6
store %struct.okn_mtx4* %2, %struct.okn_mtx4** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.okn_mtx4 = type opaque
define i32 @okn_mtx4_mult(%struct.okn_mtx4* nocapture readnone %0, %struct.okn_mtx4* nocapture readnone %1, %struct.okn_mtx4* nocapture readnone %2) {
ret i32 undef
}
int test_imm_A1int8_reg(signed char val) {
  return ((val) & (0xA1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A1int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xa1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A1int8_reg>:
test   $0xa1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A1int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 161
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_A1int8_reg(i8 signext %0) {
%2 = and i8 %0, -95
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int digitToTry(int d) { return 1 << (d - 1); }


x86 assembly (clang, -O0):
<digitToTry>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitToTry>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @digitToTry(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = shl i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @digitToTry(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = shl nuw i32 1, %2
ret i32 %3
}
struct tm *gmtime(const unsigned long *timep) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.tm = type opaque
define %struct.tm* @gmtime(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
ret %struct.tm* null
}

LLVM IR (-O2):
%struct.tm = type opaque
define noalias %struct.tm* @gmtime(i64* nocapture readnone %0) {
ret %struct.tm* null
}
long os_atomic_inc_long(volatile long *val) {
  return __atomic_add_fetch(val, 1, 5);
}


x86 assembly (clang, -O0):
<os_atomic_inc_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
lock xadd %rax,(%rdx)
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_atomic_inc_long>:
mov    $0x1,%eax
lock xadd %rax,(%rdi)
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @os_atomic_inc_long(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
store i64* %0, i64** %2
%5 = load i64*, i64** %2
store i64 1, i64* %3
%6 = load i64, i64* %3
%7 = atomicrmw volatile add i64* %5, i64 %6 seq_cst
%8 = add i64 %7, %6
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @os_atomic_inc_long(i64* %0) {
%2 = atomicrmw volatile add i64* %0, i64 1 seq_cst
%3 = add i64 %2, 1
ret i64 %3
}