xunge/DecIR huggingface dataset:
/* Variables and functions */
int scramble(char *, int /*<<< orphan*/, scalar_t__, char *, int /*<<< orphan*/,
             scalar_t__);
scalar_t__ strlen(char *);
bool isScramble(char *s1, char *s2) {
  return scramble(s1, 0, strlen(s1) - 1, s2, 0, strlen(s2) - 1);
}


x86 assembly (clang, -O0):
<isScramble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    %rax,%r9
sub    $0x1,%r9
xor    %r8d,%r8d
mov    %r8d,%esi
call   1030 <scramble@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isScramble>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    -0x1(%rax),%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    -0x1(%rax),%r9
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %r8d,%r8d
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <scramble@plt>

LLVM IR (-O0):
define i32 @isScramble(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = sub nsw i64 %7, 1
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = sub nsw i64 %11, 1
%13 = call i32 @scramble(i8* %5, i32 0, i64 %8, i8* %9, i32 0, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @isScramble(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, -1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = add nsw i64 %5, -1
%7 = tail call i32 @scramble(i8* %0, i32 0, i64 %4, i8* %1, i32 0, i64 %6)
ret i32 %7
}
/* Variables and functions */
int clock();
void delay(unsigned long *d_o, unsigned long delay) {
  int start, ticks;
  start = clock();
  ticks = 0;
  while (ticks < delay)
    ticks = clock() - start;
  return;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1151 <delay+0x41>
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <delay+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
test   %rbx,%rbx
je     1140 <delay+0x30>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <clock@plt>
sub    %ebp,%eax
cltq
cmp    %rbx,%rax
jb     1130 <delay+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @delay(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = call i32 (...) @clock()
store i32 %7, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %13, %2
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = load i64, i64* %4
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = call i32 (...) @clock()
%15 = load i32, i32* %5
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %6
br label %8
17: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @delay(i64* nocapture readnone %0, i64 %1) {
%3 = tail call i32 (...) @clock()
%4 = icmp eq i64 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @clock()
%7 = sub nsw i32 %6, %3
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, %1
br i1 %9, label %5, label %10
10: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef scalar_t__ __u64;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ mfd_assert_get_seals(int);
int /*<<< orphan*/ printf(char *, unsigned long long, unsigned long long, int);
void mfd_assert_has_seals(int fd, __u64 seals) {
  __u64 s;
  s = mfd_assert_get_seals(fd);
  if (s != seals) {
    printf("%llu != %llu = GET_SEALS(%d)\n", (unsigned long long)seals,
           (unsigned long long)s, fd);
    abort();
  }
}


x86 assembly (clang, -O0):
<mfd_assert_has_seals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <mfd_assert_get_seals@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1177 <mfd_assert_has_seals+0x47>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfd_assert_has_seals>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <mfd_assert_get_seals@plt>
cmp    %rbx,%rax
jne    1149 <mfd_assert_has_seals+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %ebp,%ecx
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%llu != %llu = GET_SEALS(%d)\0A\00"
define void @mfd_assert_has_seals(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = call i64 @mfd_assert_get_seals(i32 %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13, i32 %14)
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%llu != %llu = GET_SEALS(%d)\0A\00"
define void @mfd_assert_has_seals(i32 %0, i64 %1) {
%3 = tail call i64 @mfd_assert_get_seals(i32 %0)
%4 = icmp eq i64 %3, %1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %1, i64 %3, i32 %0)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret void
}
void donothing(int n) {}


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

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

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

LLVM IR (-O2):
define void @donothing(i32 %0) {
ret void
}
/* Variables and functions */
double pow(int, double);
int sin(double);
double f3(double x) { return pow(2, pow(sin(x), 2)); }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%edi
movsd  0xebf(%rip),%xmm0
call   1040 <pow@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
call   1030 <sin@plt>
movsd  0xed2(%rip),%xmm0
mov    %eax,%edi
call   1040 <pow@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @f3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sin(double %3)
%5 = call double @pow(i32 %4, double 2.000000e+00)
%6 = call double @pow(i32 2, double %5)
ret double %6
}

LLVM IR (-O2):
define double @f3(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = tail call double @pow(i32 %2, double 2.000000e+00)
%4 = tail call double @pow(i32 2, double %3)
ret double %4
}
void movsb(char *dest, const char *src, int len, int decrement) {
  if (decrement) {
    __asm__ volatile("std");
  }

  __asm__ volatile("rep movsb" ::"S"(src), "D"(dest), "c"(len) : "memory");
  if (decrement) {
    __asm__ volatile("cld");
  }
}


x86 assembly (clang, -O0):
<movsb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     111d <movsb+0x1d>
std
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
rep movsb %ds:(%rsi),%es:(%rdi)
cmpl   $0x0,-0x18(%rbp)
je     1135 <movsb+0x35>
cld
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsb>:
mov    %ecx,%eax
mov    %edx,%ecx
test   %eax,%eax
je     110d <movsb+0xd>
std
rep movsb %ds:(%rsi),%es:(%rdi)
cld
ret
rep movsb %ds:(%rsi),%es:(%rdi)
ret

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

LLVM IR (-O2):
define void @movsb(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %7, label %6
6: ; preds = %4
tail call void asm sideeffect "std", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "rep movsb", "{si},{di},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0, i32 %2)
tail call void asm sideeffect "cld", "~{dirflag},~{fpsr},~{flags}"()
br label %8
7: ; preds = %4
tail call void asm sideeffect "rep movsb", "{si},{di},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0, i32 %2)
br label %8
8: ; preds = %7, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int sysnerr(int x, const char *s) {
  if (x == 0) {
    perror(s);
    exit(1);
  }
  return x;
}


x86 assembly (clang, -O0):
<sysnerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114c <sysnerr+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysnerr>:
test   %edi,%edi
je     1127 <sysnerr+0x7>
mov    %edi,%eax
ret
push   %rax
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @sysnerr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @perror(i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @sysnerr(i32 returned %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret i32 %0
}
char *append_string(char *target, const char *source) {
  while ((*target = *source))
    source++, target++;
  return target;
}


x86 assembly (clang, -O0):
<append_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     113d <append_string+0x3d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <append_string+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_string>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     1122 <append_string+0x22>
add    $0x1,%rsi
nop
movzbl (%rsi),%ecx
mov    %cl,0x1(%rax)
add    $0x1,%rax
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <append_string+0x10>
ret

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

LLVM IR (-O2):
define i8* @append_string(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %1, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i8* [ %0, %2 ], [ %9, %5 ]
ret i8* %13
}
void rop3_148_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = T | S;
  stk3 = *D & stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_148_1_0>:
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
or     %ecx,%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xe(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%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
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%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_148_1_0>:
mov    %edx,%eax
or     %sil,%al
mov    (%rdi),%cl
and    %cl,%al
xor    %sil,%dl
xor    %al,%dl
xor    %dl,%cl
and    %sil,%cl
xor    %dl,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_148_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %10
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
%22 = and i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8, i8* %6
%31 = zext i8 %30 to i32
%32 = load i8, i8* %8
%33 = zext i8 %32 to i32
%34 = xor i32 %31, %33
%35 = trunc i32 %34 to i8
store i8 %35, i8* %7
%36 = load i8, i8* %7
%37 = zext i8 %36 to i32
%38 = load i8, i8* %5
%39 = zext i8 %38 to i32
%40 = xor i32 %39, -1
%41 = and i32 %37, %40
%42 = load i8*, i8** %4
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = load i8, i8* %5
%46 = zext i8 %45 to i32
%47 = and i32 %44, %46
%48 = or i32 %41, %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_148_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %2, %1
%8 = xor i8 %7, %6
%9 = xor i8 %1, -1
%10 = and i8 %8, %9
%11 = and i8 %5, %1
%12 = or i8 %10, %11
store i8 %12, i8* %0
ret void
}
void rop3_160_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D & T;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_160_1_0>:
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 -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%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_160_1_0>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_160_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %5, %4
store i8 %6, i8* %0
ret void
}
void debug_show_held_locks(struct task_struct *task) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @debug_show_held_locks(%struct.task_struct* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int nd();
int32_t compute1(int32_t *t) {
  int i1 = nd();
  return t[2] + t[4] + t[6] + t[15];
}


x86 assembly (clang, -O0):
<compute1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nd@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x8(%rbp),%rcx
add    0x20(%rcx),%rax
mov    -0x8(%rbp),%rcx
add    0x30(%rcx),%rax
mov    -0x8(%rbp),%rcx
add    0x78(%rcx),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute1>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <nd@plt>
mov    0x20(%rbx),%rax
add    0x10(%rbx),%rax
add    0x30(%rbx),%rax
add    0x78(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @compute1(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = call i32 (...) @nd()
store i32 %4, i32* %3
%5 = load i64*, i64** %2
%6 = getelementptr inbounds i64, i64* %5, i64 2
%7 = load i64, i64* %6
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 4
%10 = load i64, i64* %9
%11 = add nsw i64 %7, %10
%12 = load i64*, i64** %2
%13 = getelementptr inbounds i64, i64* %12, i64 6
%14 = load i64, i64* %13
%15 = add nsw i64 %11, %14
%16 = load i64*, i64** %2
%17 = getelementptr inbounds i64, i64* %16, i64 15
%18 = load i64, i64* %17
%19 = add nsw i64 %15, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @compute1(i64* nocapture %0) {
%2 = tail call i32 (...) @nd()
%3 = getelementptr inbounds i64, i64* %0, i64 2
%4 = load i64, i64* %3
%5 = getelementptr inbounds i64, i64* %0, i64 4
%6 = load i64, i64* %5
%7 = add nsw i64 %6, %4
%8 = getelementptr inbounds i64, i64* %0, i64 6
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
%11 = getelementptr inbounds i64, i64* %0, i64 15
%12 = load i64, i64* %11
%13 = add nsw i64 %10, %12
ret i64 %13
}
/* Variables and functions */
int mul3div4(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 12;
  printf("%d\n", mul3div4(x));
  x = -12;
  printf("%d\n", mul3div4(x));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc,%edi
call   1040 <mul3div4@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xfffffff4,%edi
call   1040 <mul3div4@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @mul3div4(i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @mul3div4(i32 -12)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xb2() {
  Assert_real((isupper(178) == 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_isupper.c",
              895, ("isupper should be 0 for 0xb2"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xb2>:
push   %rax
mov    $0xb2,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37f,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xb2\00"
define void @t_isupper_0xb2() {
%1 = call i64 @isupper(i32 178)
%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 895, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xb2\00"
define void @t_isupper_0xb2() {
%1 = tail call i64 @isupper(i32 178)
%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 895, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct event_base {
  int dummy;
};
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int /*<<< orphan*/ event_base_loopexit(struct event_base *,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void timeoutcb(evutil_socket_t fd, short what, void *arg) {
  struct event_base *base = arg;
  printf("timeout\n");
  event_base_loopexit(base, NULL);
}


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

x86 assembly (clang, -O2):
<timeoutcb>:
push   %rbx
mov    %rdx,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <event_base_loopexit@plt>

LLVM IR (-O0):
%struct.event_base = type { i32 }
@.str = [9 x i8] c"timeout\0A\00"
define void @timeoutcb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.event_base*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.event_base*
store %struct.event_base* %9, %struct.event_base** %7
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load %struct.event_base*, %struct.event_base** %7
%12 = call i32 @event_base_loopexit(%struct.event_base* %11, i32* null)
ret void
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
@str = [8 x i8] c"timeout\00"
define void @timeoutcb(i32 %0, i16 signext %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.event_base*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @event_base_loopexit(%struct.event_base* %4, i32* null)
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *str) {
  size_t siz;
  char *copy;
  siz = strlen(str) + 1;
  if ((copy = malloc(siz)) == NULL)
    return (NULL);
  (void)memcpy(copy, str, siz);
  return (copy);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1172 <strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118b <strdup+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t booleanp(int32_t val) { return ((val & 0x7f) == 0x1f); }


x86 assembly (clang, -O0):
<booleanp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
cmp    $0x1f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<booleanp>:
and    $0x7f,%edi
xor    %eax,%eax
cmp    $0x1f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @booleanp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
%5 = icmp eq i32 %4, 31
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @booleanp(i32 %0) {
%2 = and i32 %0, 127
%3 = icmp eq i32 %2, 31
%4 = zext i1 %3 to i32
ret i32 %4
}
signed long long f22(signed long long v_foo) {
  signed long long v_shr = v_foo >> 60;
  signed long long v_and = v_shr & 14;
  return v_and;
}


x86 assembly (clang, -O0):
<f22>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x3c,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xe,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f22>:
mov    %rdi,%rax
shr    $0x3c,%rax
and    $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i64 @f22(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = ashr i64 %5, 60
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = and i64 %7, 14
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @f22(i64 %0) {
%2 = lshr i64 %0, 60
%3 = and i64 %2, 14
ret i64 %3
}
/* Variables and functions */
void nmi_handler(void) {
  while (true)
    ;
}


x86 assembly (clang, -O0):
<nmi_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <nmi_handler+0x9>
jmp    1109 <nmi_handler+0x9>

x86 assembly (clang, -O2):
<nmi_handler>:
jmp    1100 <nmi_handler>

LLVM IR (-O0):
define void @nmi_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @nmi_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void ice(const char *f, int line, const char *fn, const char *fmt, ...) {
  (void)fmt;
  fprintf(stderr, "%s:%d: ice: %s\n", f, line, fn);
  exit(1);
}


x86 assembly (clang, -O0):
<ice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ice>:
push   %rax
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"%s:%d: ice: %s\0A\00"
define void @ice(i8* %0, i32 %1, i8* %2, i8* %3, ...) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"%s:%d: ice: %s\0A\00"
define void @ice(i8* %0, i32 %1, i8* %2, i8* nocapture readnone %3, ...) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%7 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int test_12(unsigned int a, int b) { return (a >> 2) | (b << 31); }


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

x86 assembly (clang, -O2):
<test_12>:
shr    $0x2,%edi
shl    $0x1f,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @test_12(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 = lshr i32 %5, 2
%7 = load i32, i32* %4
%8 = shl i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_12(i32 %0, i32 %1) {
%3 = lshr i32 %0, 2
%4 = shl i32 %1, 31
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get_TCP_src_port_from_TCP_header(uint8_t *tcp_packet) {
  return (tcp_packet[0] << 8) + tcp_packet[1];
}


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

x86 assembly (clang, -O2):
<get_TCP_src_port_from_TCP_header>:
mov    (%rdi),%eax
shl    $0x8,%eax
add    0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_TCP_src_port_from_TCP_header(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ xtoa(int, char *, int, int);
char *itoa(int value, char *str, int base) {
  xtoa(value, str, base, (value < 0));
  return str;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
cmpl   $0x0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%ecx
call   1030 <xtoa@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ecx
shr    $0x1f,%ecx
call   1030 <xtoa@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @itoa(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @xtoa(i32 %7, i8* %8, i32 %9, i32 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @itoa(i32 %0, i8* returned %1, i32 %2) {
%4 = lshr i32 %0, 31
%5 = tail call i32 @xtoa(i32 %0, i8* %1, i32 %2, i32 %4)
ret i8* %1
}
float deadzone(float value, float deadzone, float k) {
  if (value < -deadzone) {
    value = (value + deadzone) * k;
  } else if (value > deadzone) {
    value = (value - deadzone) * k;
  } else {
    value = 0;
  }
  return value;
}


x86 assembly (clang, -O0):
<deadzone>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
ucomiss %xmm1,%xmm0
jbe    114c <deadzone+0x4c>
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1181 <deadzone+0x81>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1174 <deadzone+0x74>
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    117c <deadzone+0x7c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1181 <deadzone+0x81>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deadzone>:
movaps 0xef9(%rip),%xmm3
xorps  %xmm1,%xmm3
ucomiss %xmm0,%xmm3
jbe    1115 <deadzone+0x15>
addss  %xmm1,%xmm0
jmp    1121 <deadzone+0x21>
xorps  %xmm3,%xmm3
ucomiss %xmm1,%xmm0
jbe    1128 <deadzone+0x28>
subss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
movaps %xmm0,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @deadzone(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* %5
%9 = fneg float %8
%10 = fcmp olt float %7, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load float, float* %4
%13 = load float, float* %5
%14 = fadd float %12, %13
%15 = load float, float* %6
%16 = fmul float %14, %15
store float %16, float* %4
br label %29
17: ; preds = %3
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fcmp ogt float %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load float, float* %4
%23 = load float, float* %5
%24 = fsub float %22, %23
%25 = load float, float* %6
%26 = fmul float %24, %25
store float %26, float* %4
br label %28
27: ; preds = %17
store float 0.000000e+00, float* %4
br label %28
28: ; preds = %27, %21
br label %29
29: ; preds = %28, %11
%30 = load float, float* %4
ret float %30
}

LLVM IR (-O2):
define float @deadzone(float %0, float %1, float %2) {
%4 = fneg float %1
%5 = fcmp ogt float %4, %0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = fadd float %0, %1
%8 = fmul float %7, %2
br label %14
9: ; preds = %3
%10 = fcmp ogt float %0, %1
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = fsub float %0, %1
%13 = fmul float %12, %2
br label %14
14: ; preds = %9, %11, %6
%15 = phi float [ %8, %6 ], [ %13, %11 ], [ 0.000000e+00, %9 ]
ret float %15
}
/* Variables and functions */
char *malloc(int);
int sprintf(char *, char const *, int);
char *msg_app_int(const char *msg1, int n) {
  char *p = malloc(200);
  int b = sprintf(p, msg1, n);
  return p;
}


x86 assembly (clang, -O0):
<msg_app_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_app_int>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <sprintf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @msg_app_int(i8* nocapture %0, i32 %1) {
%3 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
float m_min(float value_a, float value_b) {
  if (value_a < value_b)
    return value_a;
  return value_b;
}


x86 assembly (clang, -O0):
<m_min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <m_min+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <m_min+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @m_min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @m_min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ setTo(int /*<<< orphan*/);
void quoted_insert(void) { setTo(getch()); }


x86 assembly (clang, -O0):
<quoted_insert>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,%edi
call   1040 <setTo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quoted_insert>:
push   %rax
xor    %eax,%eax
call   1030 <getch@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <setTo@plt>

LLVM IR (-O0):
define void @quoted_insert() {
%1 = call i32 (...) @getch()
%2 = call i32 @setTo(i32 %1)
ret void
}

LLVM IR (-O2):
define void @quoted_insert() {
%1 = tail call i32 (...) @getch()
%2 = tail call i32 @setTo(i32 %1)
ret void
}
int av_empty(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @av_empty() {
ret i32 1
}

LLVM IR (-O2):
define i32 @av_empty() {
ret i32 1
}
void log_print_(int level, int line, const char *func, const char *file,
                const char *msg, ...) {}


x86 assembly (clang, -O0):
<log_print_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @log_print_(i32 %0, i32 %1, i8* %2, i8* %3, i8* %4, ...) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @log_print_(i32 %0, i32 %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef unsigned long long FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(unsigned long long *);
int read_uint64_from_file(unsigned long long *, int /*<<< orphan*/ *);
int read_unsigned_long_long_int_from_file(FILE *f, unsigned long long *num) {
  assert(f);
  assert(num);
  return read_uint64_from_file(f, (uint64_t *)num);
}


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

x86 assembly (clang, -O2):
<read_unsigned_long_long_int_from_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <read_uint64_from_file@plt>

LLVM IR (-O0):
define i32 @read_unsigned_long_long_int_from_file(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = call i32 @assert(i64* %5)
%7 = load i64*, i64** %4
%8 = call i32 @assert(i64* %7)
%9 = load i64*, i64** %3
%10 = load i64*, i64** %4
%11 = bitcast i64* %10 to i32*
%12 = call i32 @read_uint64_from_file(i64* %9, i32* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @read_unsigned_long_long_int_from_file(i64* %0, i64* %1) {
%3 = tail call i32 @assert(i64* %0)
%4 = tail call i32 @assert(i64* %1)
%5 = bitcast i64* %1 to i32*
%6 = tail call i32 @read_uint64_from_file(i64* %0, i32* %5)
ret i32 %6
}
int is_hex(char c) {
  if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
      (c >= 'A' && c <= 'F')) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <is_hex+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1158 <is_hex+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     113e <is_hex+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jle    1158 <is_hex+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1164 <is_hex+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1164 <is_hex+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <is_hex+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_hex(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
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %27, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 102
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 65
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 70
br i1 %26, label %27, label %28
27: ; preds = %23, %15, %7
store i32 1, i32* %2
br label %29
28: ; preds = %23, %19
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_hex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}