xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn18() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn18");
  return result;
}


x86 assembly (clang, -O0):
<fn18>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn18>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn18\00"
define i8* @fn18() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn18\00"
define i8* @fn18() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
void virtio_load_stage2() {}


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

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

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

LLVM IR (-O2):
define void @virtio_load_stage2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_reset_sigsv() {
  printf("NOT IMPLEMENTED:"
         "pa_reset_sigsv"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_reset_sigsv\0A\00"
define i32 @pa_reset_sigsv() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_reset_sigsv\00"
define i32 @pa_reset_sigsv() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf(
      "Usage: %s [OPTION]... [FILE]...\n\nOptions:\n    -H, --human\t\tdisplay "
      "filesize in kilobytes and megabytes if appropriate (implies --long)\n   "
      " -a, --all\t\tinclude dotfiles and implied `.' and `..' entries\n    "
      "-i, --inode\t\tdisplay inode numbers\n    -d, --dereference\tshow "
      "information for the file links reference rather than for the link "
      "itself\n    -h, --help\t\tdisplay this help\n    -c, --colour\tuse "
      "colour output\n    -V, --version\tdisplay version information\n\nReport "
      "bugs to <bulliver@gmail.com>\n",
      "vdir");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0x10ce(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [492 x i8] c"Usage: %s [OPTION]... [FILE]...\0A\0AOptions:\0A -H, --human\09\09display filesize in kilobytes and megabytes if appropriate (implies --long)\0A -a, --all\09\09include dotfiles and implied `.' and `..' entries\0A -i, --inode\09\09display inode numbers\0A -d, --dereference\09show information for the file links reference rather than for the link itself\0A -h, --help\09\09display this help\0A -c, --colour\09use colour output\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"vdir\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([492 x i8], [492 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [492 x i8] c"Usage: %s [OPTION]... [FILE]...\0A\0AOptions:\0A -H, --human\09\09display filesize in kilobytes and megabytes if appropriate (implies --long)\0A -a, --all\09\09include dotfiles and implied `.' and `..' entries\0A -i, --inode\09\09display inode numbers\0A -d, --dereference\09show information for the file links reference rather than for the link itself\0A -h, --help\09\09display this help\0A -c, --colour\09use colour output\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"vdir\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([492 x i8], [492 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int get_byte(FILE *f) {
  int c = fgetc(f);
  return c == EOF ? -1 : c;
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
jne    1147 <get_byte+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <get_byte+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
push   %rax
call   1030 <fgetc@plt>
mov    0x2ecb(%rip),%rcx
cmp    (%rcx),%eax
mov    $0xffffffff,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @get_byte(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
%5 = select i1 %4, i32 -1, i32 %2
ret i32 %5
}
int numberofSequences(long number) {
  if (number == 1) {
    return 1;
  } else {
    if (number % 2 == 0) {
      return 1 + numberofSequences(number / 2);
    } else {
      return 1 + numberofSequences(3 * number + 1);
    }
  }
}


x86 assembly (clang, -O0):
<numberofSequences>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1133 <numberofSequences+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1180 <numberofSequences+0x70>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    116c <numberofSequences+0x5c>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <numberofSequences@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <numberofSequences+0x70>
imul   $0x3,-0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <numberofSequences@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberofSequences>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x1,%rdi
je     1164 <numberofSequences+0x54>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%dil
jne    1155 <numberofSequences+0x45>
mov    %rdi,%rax
shr    $0x3f,%rax
add    %rdi,%rax
sar    %rax
and    $0xfffffffffffffffe,%rdi
add    $0x1,%ebx
cmp    $0x2,%rdi
mov    %rax,%rdi
jne    1130 <numberofSequences+0x20>
jmp    1164 <numberofSequences+0x54>
lea    (%rdi,%rdi,2),%rdi
add    $0x1,%rdi
call   1030 <numberofSequences@plt>
add    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @numberofSequences(i64 %0) {
%2 = icmp eq i64 %0, 1
br i1 %2, label %13, label %3
3: ; preds = %1, %8
%4 = phi i64 [ %9, %8 ], [ %0, %1 ]
%5 = phi i32 [ %10, %8 ], [ 0, %1 ]
%6 = and i64 %4, 1
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = sdiv i64 %4, 2
%10 = add nuw nsw i32 %5, 1
%11 = and i64 %4, -2
%12 = icmp eq i64 %11, 2
br i1 %12, label %21, label %3
13: ; preds = %1, %21, %15
%14 = phi i32 [ %20, %15 ], [ 1, %1 ], [ %22, %21 ]
ret i32 %14
15: ; preds = %3
%16 = mul nsw i64 %4, 3
%17 = add nsw i64 %16, 1
%18 = tail call i32 @numberofSequences(i64 %17)
%19 = add nuw i32 %5, 1
%20 = add i32 %19, %18
br label %13
21: ; preds = %8
%22 = add nuw i32 %5, 2
br label %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ch;
  while (1) {
    scanf("%c", &ch);
    printf("%c\n", ch);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xf(%rsp),%r15
lea    0xec7(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %5)
br label %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ num;

/* Variables and functions */
int findPeakElement(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int num[] = {1, 2, 3, 1};
  printf("%d\n", findPeakElement(num, sizeof(num) / sizeof(int)));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <findPeakElement@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <findPeakElement@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.num = [4 x i32] [i32 1, i32 2, i32 3, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @findPeakElement(i32* %3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
unsigned char toprint(unsigned char c) {
  if (c < ' ' || c >= 0x7f)
    return '.';
  return c;
}


x86 assembly (clang, -O0):
<toprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     1124 <toprint+0x24>
movzbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jl     112d <toprint+0x2d>
movb   $0x2e,-0x1(%rbp)
jmp    1133 <toprint+0x33>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toprint>:
lea    -0x7f(%rdi),%eax
cmp    $0xa1,%al
mov    $0x2e,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @toprint(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 32
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sge i32 %9, 127
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8 46, i8* %2
br label %14
12: ; preds = %7
%13 = load i8, i8* %3
store i8 %13, i8* %2
br label %14
14: ; preds = %12, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @toprint(i8 zeroext %0) {
%2 = add i8 %0, -127
%3 = icmp ult i8 %2, -95
%4 = select i1 %3, i8 46, i8 %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void passTest(int value) {
  printf("PASS: test27\n");
  exit(0);
}


x86 assembly (clang, -O0):
<passTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<passTest>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"PASS: test27\0A\00"
define void @passTest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"PASS: test27\00"
define void @passTest(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
void ff_hevc_put_hevc_uni_w_epel_v4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v4_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gms_styled_string(int, char const *);
void gms_banner_string(const char *message) { gms_styled_string((4), message); }


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

x86 assembly (clang, -O2):
<gms_banner_string>:
mov    %rdi,%rsi
mov    $0x4,%edi
jmp    1030 <gms_styled_string@plt>

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

LLVM IR (-O2):
define void @gms_banner_string(i8* %0) {
%2 = tail call i32 @gms_styled_string(i32 4, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reset_current_packet_pointer();
int CFC_filter_duplicate_sn_ap() {
  int nb_packets = 0;
  puts("Cloaking - Removing the duplicate SN for the AP");
  reset_current_packet_pointer();
  return nb_packets;
}


x86 assembly (clang, -O0):
<CFC_filter_duplicate_sn_ap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <reset_current_packet_pointer@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CFC_filter_duplicate_sn_ap>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <reset_current_packet_pointer@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Cloaking - Removing the duplicate SN for the AP\00"
define i32 @CFC_filter_duplicate_sn_ap() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @reset_current_packet_pointer()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [48 x i8] c"Cloaking - Removing the duplicate SN for the AP\00"
define i32 @CFC_filter_duplicate_sn_ap() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @reset_current_packet_pointer()
ret i32 0
}
int test_imm_2Buint8_reg(unsigned char val) {
  return ((val) & (-0x2B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Buint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -43
%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_2Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -43
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int rand();
int hasard(int min, int max) { return (rand() % (max - min + 1)) + min; }


x86 assembly (clang, -O0):
<hasard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasard>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hasard(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @hasard(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ unsetenv(char *);
void set_up_environment(void) {
  setenv("ASAN_OPTIONS",
         "abort_on_error=1:"
         "detect_leaks=0:"
         "allocator_may_return_null=1",
         0);
  setenv("MSAN_OPTIONS",
         "exit_code="
         "86"
         ":"
         "msan_track_origins=0",
         0);
  unsetenv("AFL_PERSISTENT");
}


x86 assembly (clang, -O0):
<set_up_environment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
lea    0xf09(%rip),%rdi
lea    0xf0f(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
lea    0xf23(%rip),%rdi
call   1040 <unsetenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_up_environment>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
lea    0xf0c(%rip),%rdi
lea    0xf12(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
lea    0xf26(%rip),%rdi
pop    %rax
jmp    1040 <unsetenv@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"ASAN_OPTIONS\00"
@.str.1 = [60 x i8] c"abort_on_error=1:detect_leaks=0:allocator_may_return_null=1\00"
@.str.2 = [13 x i8] c"MSAN_OPTIONS\00"
@.str.3 = [34 x i8] c"exit_code=86:msan_track_origins=0\00"
@.str.4 = [15 x i8] c"AFL_PERSISTENT\00"
define void @set_up_environment() {
%1 = call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 0)
%3 = call i32 @unsetenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"ASAN_OPTIONS\00"
@.str.1 = [60 x i8] c"abort_on_error=1:detect_leaks=0:allocator_may_return_null=1\00"
@.str.2 = [13 x i8] c"MSAN_OPTIONS\00"
@.str.3 = [34 x i8] c"exit_code=86:msan_track_origins=0\00"
@.str.4 = [15 x i8] c"AFL_PERSISTENT\00"
define void @set_up_environment() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = tail call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 0)
%3 = tail call i32 @unsetenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int show_options(void) {
  printf("\t%c\n", 'A');
  printf("\t%c\n", 'B');
  printf("\t%c\n", 'C');
  return (0);
}


x86 assembly (clang, -O0):
<show_options>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x42,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x43,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_options>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x42,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x43,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\09%c\0A\00"
define i32 @show_options() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 65)
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 66)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\09%c\0A\00"
define i32 @show_options() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 65)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 66)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 67)
ret i32 0
}
void RTFileWriteAt(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileWriteAt() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int _print_nb(int /*<<< orphan*/ *, int, int);
int printf_handle_flag_p(va_list *parameters) {
  return _print_nb(parameters, 1, 16);
}


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

x86 assembly (clang, -O2):
<printf_handle_flag_p>:
mov    $0x1,%esi
mov    $0x10,%edx
jmp    1030 <_print_nb@plt>

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

LLVM IR (-O2):
define i32 @printf_handle_flag_p(i32* %0) {
%2 = tail call i32 @_print_nb(i32* %0, i32 1, i32 16)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ check();
int main() {
  check();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check()
ret i32 0
}
__attribute__((always_)) int api0(int api_no) {
  int ret = 0;
  __asm__ __volatile__("int $0x44" : "=a"(ret) : "0"(api_no));
  return ret;
}


x86 assembly (clang, -O0):
<api0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
int    $0x44
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<api0>:
mov    %edi,%eax
int    $0x44
ret

LLVM IR (-O0):
define i32 @api0(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "int $$0x44", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @api0(i32 %0) {
%2 = tail call i32 asm sideeffect "int $$0x44", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int externalize(char *destfilename, char *srcbuf, int n) {
  FILE *destfile = fopen(destfilename, "wb");
  int size = fwrite(srcbuf, n, 1, destfile);
  fclose(destfile);
  return size;
}


x86 assembly (clang, -O0):
<externalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<externalize>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @externalize(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i32 %2, i32 1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret i32 %5
}
int Key(const char *name) {
  int v;
  int c;
  v = 0;
  while ((c = *name++) != 0)
    v += c & ~32;
  return v % 32;
}


x86 assembly (clang, -O0):
<Key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113e <Key+0x3e>
mov    -0x10(%rbp),%eax
and    $0xffffffdf,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <Key+0xf>
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key>:
mov    (%rdi),%cl
test   %cl,%cl
je     1131 <Key+0x31>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0xdf,%cl
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <Key+0x10>
lea    0x1f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffe0,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Key(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = load i32, i32* %4
%13 = and i32 %12, -33
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %3
%18 = srem i32 %17, 32
ret i32 %18
}

LLVM IR (-O2):
define i32 @Key(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = and i8 %5, -33
%10 = sext i8 %9 to i32
%11 = add nsw i32 %7, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = srem i32 %11, 32
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int get_last(int, int);
unsigned invert(unsigned x, int p, int n) {
  int mask = ((1 << (p + 1)) - 1);
  int last = get_last(mask, p - n + 1);
  mask ^= last;
  return x ^ mask;
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <get_last@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
push   %rbp
push   %rbx
push   %rax
add    $0x1,%esi
mov    $0xffffffff,%ebx
mov    %esi,%ecx
shl    %cl,%ebx
mov    %edi,%ebp
not    %ebx
sub    %edx,%esi
mov    %ebx,%edi
call   1030 <get_last@plt>
xor    %ebp,%ebx
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, 1
%5 = shl nsw i32 -1, %4
%6 = xor i32 %5, -1
%7 = sub i32 %4, %2
%8 = tail call i32 @get_last(i32 %6, i32 %7)
%9 = xor i32 %6, %0
%10 = xor i32 %9, %8
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t ip_get_ttl(const uint8_t *p_ip) { return p_ip[8]; }


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

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

LLVM IR (-O0):
define i32 @ip_get_ttl(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @ip_get_ttl(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("It should be valid\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"It should be valid\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"It should be valid\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
f(int i) { return 2 + i; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
char *BLNK_LookupAddrNameOS(void *, void **);
char *BIPRO_LookupAddrNameOS(void *ptr, void **rbase) {
  return (BLNK_LookupAddrNameOS(ptr, rbase));
}


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

x86 assembly (clang, -O2):
<BIPRO_LookupAddrNameOS>:
jmp    1030 <BLNK_LookupAddrNameOS@plt>

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

LLVM IR (-O2):
define i8* @BIPRO_LookupAddrNameOS(i8* %0, i8** %1) {
%3 = tail call i8* @BLNK_LookupAddrNameOS(i8* %0, i8** %1)
ret i8* %3
}
int fun1346() { return 1346; }


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

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

LLVM IR (-O0):
define i32 @fun1346() {
ret i32 1346
}

LLVM IR (-O2):
define i32 @fun1346() {
ret i32 1346
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int *ivector(long nl, long nh) {
  int *v;
  v = (int *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(int)));
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %rbx
mov    %rdi,%rbx
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1030 <malloc@plt>
shl    $0x2,%rbx
neg    %rbx
add    %rbx,%rax
add    $0x4,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @ivector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = load i64, i64* %3
%16 = sub i64 0, %15
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = getelementptr inbounds i32, i32* %17, i64 1
ret i32* %18
}

LLVM IR (-O2):
define i32* @ivector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i32*
%8 = sub i64 0, %0
%9 = getelementptr inbounds i32, i32* %7, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 1
ret i32* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_parse_boolean() {
  printf("NOT IMPLEMENTED:"
         "pa_parse_boolean"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_parse_boolean\0A\00"
define i32 @pa_parse_boolean() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_parse_boolean\00"
define i32 @pa_parse_boolean() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void rt2x00rfkill_resume(struct rt2x00_dev *rt2x00dev) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define void @rt2x00rfkill_resume(%struct.rt2x00_dev* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef char int8_t;

/* Variables and functions */
char toupper(int /*<<< orphan*/);
void strupr(char *temp) {
  int8_t *s = temp;
  while (*s) {
    *s = toupper((uint8_t)*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strupr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupr+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strupr+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strupr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call signext i8 @toupper(i32 %7)
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void initlog() {
  FILE *fp = fopen("/tmp/stripper.log", "w");
  fclose(fp);
}


x86 assembly (clang, -O0):
<initlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initlog>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"/tmp/stripper.log\00"
@.str.1 = [2 x i8] c"w\00"
define void @initlog() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fclose(i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"/tmp/stripper.log\00"
@.str.1 = [2 x i8] c"w\00"
define void @initlog() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ simple_command(struct chirp_client *, int /*<<< orphan*/,
                                  char *, char const *, char const *);
int64_t chirp_client_login(struct chirp_client *c, const char *name,
                           const char *password, time_t stoptime) {
  return simple_command(c, stoptime, "login %s %s\n", name, password);
}


x86 assembly (clang, -O0):
<chirp_client_login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xec3(%rip),%rdx
call   1030 <simple_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_login>:
mov    %rdx,%r8
mov    %rsi,%rax
lea    0xee3(%rip),%rdx
mov    %ecx,%esi
mov    %rax,%rcx
jmp    1030 <simple_command@plt>

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
@.str = [13 x i8] c"login %s %s\0A\00"
define i32 @chirp_client_login(%struct.chirp_client* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.chirp_client*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.chirp_client* %0, %struct.chirp_client** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.chirp_client*, %struct.chirp_client** %5
%10 = load i32, i32* %8
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = call i32 @simple_command(%struct.chirp_client* %9, i32 %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
@.str = [13 x i8] c"login %s %s\0A\00"
define i32 @chirp_client_login(%struct.chirp_client* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @simple_command(%struct.chirp_client* %0, i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 %5
}
int mustquote_body(int c) {
  if (c != '\n' && (c < 040 || c == '=' || c >= 0177))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<mustquote_body>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     113b <mustquote_body+0x3b>
cmpl   $0x20,-0x8(%rbp)
jl     112f <mustquote_body+0x2f>
cmpl   $0x3d,-0x8(%rbp)
je     112f <mustquote_body+0x2f>
cmpl   $0x7f,-0x8(%rbp)
jl     113b <mustquote_body+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <mustquote_body+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mustquote_body>:
cmp    $0xa,%edi
je     1117 <mustquote_body+0x17>
mov    $0x1,%eax
cmp    $0x3d,%edi
je     1119 <mustquote_body+0x19>
add    $0xffffff81,%edi
cmp    $0xffffffa1,%edi
jb     1119 <mustquote_body+0x19>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mustquote_body(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 61
%5 = add i32 %0, -127
%6 = icmp ult i32 %5, -95
%7 = or i1 %4, %6
br i1 %7, label %9, label %8
8: ; preds = %3, %1
br label %9
9: ; preds = %3, %8
%10 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %10
}