xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int is_unicode_valid(const uint32_t ch) {
  if (ch >= 0x110000)
    return 0;
  if ((ch & 0xFFFFF800) == 0xD800)
    return 0;
  if ((ch >= 0xFDD0) && (ch <= 0xFDEF))
    return 0;
  if ((ch & 0xFFFE) == 0xFFFE)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_unicode_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x110000,-0x8(%rbp)
jl     1120 <is_unicode_valid+0x20>
movl   $0x0,-0x4(%rbp)
jmp    118b <is_unicode_valid+0x8b>
mov    -0x8(%rbp),%eax
and    $0xfffff800,%eax
cmp    $0xd800,%eax
jne    113f <is_unicode_valid+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    118b <is_unicode_valid+0x8b>
cmpl   $0xfdd0,-0x8(%rbp)
jl     1165 <is_unicode_valid+0x65>
cmpl   $0xfdef,-0x8(%rbp)
jg     1165 <is_unicode_valid+0x65>
movl   $0x0,-0x4(%rbp)
jmp    118b <is_unicode_valid+0x8b>
mov    -0x8(%rbp),%eax
and    $0xfffe,%eax
cmp    $0xfffe,%eax
jne    1184 <is_unicode_valid+0x84>
movl   $0x0,-0x4(%rbp)
jmp    118b <is_unicode_valid+0x8b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unicode_valid>:
cmp    $0x110000,%edi
setl   %al
mov    %edi,%ecx
and    $0xfffff800,%ecx
cmp    $0xd800,%ecx
setne  %cl
and    %al,%cl
lea    -0xfdd0(%rdi),%eax
cmp    $0x20,%eax
setae  %al
not    %edi
test   $0xfffe,%edi
setne  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @is_unicode_valid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 1114112
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %25
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, -2048
%10 = icmp eq i32 %9, 55296
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %25
12: ; preds = %7
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 64976
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 65007
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 0, i32* %2
br label %25
19: ; preds = %15, %12
%20 = load i32, i32* %3
%21 = and i32 %20, 65534
%22 = icmp eq i32 %21, 65534
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 0, i32* %2
br label %25
24: ; preds = %19
store i32 1, i32* %2
br label %25
25: ; preds = %24, %23, %18, %11, %6
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_unicode_valid(i32 %0) {
%2 = icmp sgt i32 %0, 1114111
%3 = and i32 %0, -2048
%4 = icmp eq i32 %3, 55296
%5 = or i1 %2, %4
%6 = add i32 %0, -64976
%7 = icmp ult i32 %6, 32
%8 = or i1 %7, %5
%9 = and i32 %0, 65534
%10 = icmp ne i32 %9, 65534
%11 = xor i1 %8, true
%12 = and i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_char(char c) {
  if (c >= 32 && c < 127)
    printf("%c", c);
  else
    printf("<%02x>", c);
}


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jl     114d <print_char+0x3d>
movsbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
jge    114d <print_char+0x3d>
lea    0xec1(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
jmp    115d <print_char+0x4d>
lea    0xeaf(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
mov    %edi,%esi
lea    -0x20(%rsi),%eax
cmp    $0x5f,%al
lea    0xee2(%rip),%rax
lea    0xede(%rip),%rdi
cmovb  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [7 x i8] c"<%02x>\00"
define void @print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %8, 127
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i8, i8* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
br label %16
13: ; preds = %6, %1
%14 = load i8, i8* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
br label %16
16: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [7 x i8] c"<%02x>\00"
define void @print_char(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f_menu();
int main() { f_menu(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f_menu()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f_menu()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ captains_log(char *);
int main(int argc, char *argv[]) {
  captains_log(argv[1]);
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <captains_log@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @captains_log(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @captains_log(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int foul;
  int bowl;
  foul = 10;
  bowl = 2;
  foul = 20;
  printf("Hello world\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x14,-0x8(%rbp)
lea    0xec5(%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 = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 2, i32* %3
store i32 20, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ barriereNatif32(short);
scalar_t__ systemeBigEndian();
short natif16VersBig(short natif) {
  if (systemeBigEndian()) {
    return natif;
  } else {
    return (short)barriereNatif32(natif);
  }
}


x86 assembly (clang, -O0):
<natif16VersBig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <systemeBigEndian@plt>
cmp    $0x0,%rax
je     114d <natif16VersBig+0x2d>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115a <natif16VersBig+0x3a>
movswl -0x4(%rbp),%edi
call   1040 <barriereNatif32@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<natif16VersBig>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <systemeBigEndian@plt>
test   %rax,%rax
jne    113a <natif16VersBig+0x1a>
movswl %bx,%edi
call   1040 <barriereNatif32@plt>
mov    %rax,%rbx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @natif16VersBig(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = call i64 (...) @systemeBigEndian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i16, i16* %3
store i16 %7, i16* %2
br label %12
8: ; preds = %1
%9 = load i16, i16* %3
%10 = call i64 @barriereNatif32(i16 signext %9)
%11 = trunc i64 %10 to i16
store i16 %11, i16* %2
br label %12
12: ; preds = %8, %6
%13 = load i16, i16* %2
ret i16 %13
}

LLVM IR (-O2):
define signext i16 @natif16VersBig(i16 signext %0) {
%2 = tail call i64 (...) @systemeBigEndian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i64 @barriereNatif32(i16 signext %0)
%6 = trunc i64 %5 to i16
br label %7
7: ; preds = %1, %4
%8 = phi i16 [ %6, %4 ], [ %0, %1 ]
ret i16 %8
}
/* Variables and functions */
int has3digitfactor(int);
int prev_palindrome(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int s = (999 * 999) + 1;
  int match = 0;
  while (!match) {
    s = prev_palindrome(s);
    match = has3digitfactor(s);
  }
  printf("%d\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf3a72,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1163 <main+0x33>
jmp    117e <main+0x4e>
mov    -0x8(%rbp),%edi
call   1040 <prev_palindrome@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <has3digitfactor@plt>
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf3a72,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <prev_palindrome@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <has3digitfactor@plt>
test   %eax,%eax
je     1140 <main+0x10>
lea    0xea5(%rip),%rdi
mov    %ebx,%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
%3 = alloca i32
store i32 0, i32* %1
store i32 998002, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @prev_palindrome(i32 %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @has3digitfactor(i32 %11)
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 998002, %0 ], [ %3, %1 ]
%3 = tail call i32 @prev_palindrome(i32 %2)
%4 = tail call i32 @has3digitfactor(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %1, label %6
6: ; preds = %1
%7 = 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 mt_genrand_int32();
int mtrandom_bool() { return mt_genrand_int32() & 0x1; }


x86 assembly (clang, -O0):
<mtrandom_bool>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt_genrand_int32@plt>
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtrandom_bool>:
push   %rax
xor    %eax,%eax
call   1030 <mt_genrand_int32@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mtrandom_bool() {
%1 = call i32 (...) @mt_genrand_int32()
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @mtrandom_bool() {
%1 = tail call i32 (...) @mt_genrand_int32()
%2 = and i32 %1, 1
ret i32 %2
}
float fmaxf(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<fmaxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <fmaxf+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <fmaxf+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaxf>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fmaxf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int Cyc_Lex_token_rec(struct Cyc_Lexing_lexbuf *, int /*<<< orphan*/);
int Cyc_Lex_token(struct Cyc_Lexing_lexbuf *lexbuf) {
  int _T0;
  _T0 = Cyc_Lex_token_rec(lexbuf, 0);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Lex_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <Cyc_Lex_token_rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Lex_token>:
xor    %esi,%esi
jmp    1030 <Cyc_Lex_token_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_token(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_Lex_token_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_token(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_Lex_token_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 0)
ret i32 %2
}
int fibbonacci(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<fibbonacci>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @fibbonacci(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int ioctl(int const, int, int);
int /*<<< orphan*/ printf(char *, int);
void flush_addresses(const int fd) {
  int ret;
  int portNum = 987;
  ret = ioctl(fd, 1, portNum);
  if (ret < 0) {
    printf("ioctl - flush_addresses failed:%d\n", ret);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<flush_addresses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x3db,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1040 <ioctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1178 <flush_addresses+0x48>
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_addresses>:
push   %rax
mov    $0x1,%esi
mov    $0x3db,%edx
call   1040 <ioctl@plt>
test   %eax,%eax
js     1146 <flush_addresses+0x16>
pop    %rax
ret
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ioctl - flush_addresses failed:%d\0A\00"
define void @flush_addresses(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 987, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %4
%7 = call i32 @ioctl(i32 %5, i32 1, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ioctl - flush_addresses failed:%d\0A\00"
define void @flush_addresses(i32 %0) {
%2 = tail call i32 @ioctl(i32 %0, i32 1, i32 987)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ keccak_absorb(int /*<<< orphan*/ *, int,
                                 unsigned char const *, unsigned int, int);
void shake256_absorb(uint64_t *s, const unsigned char *input,
                     unsigned int inputByteLen) {
  keccak_absorb(s, 136, input, inputByteLen, 0x1F);
}


x86 assembly (clang, -O0):
<shake256_absorb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x88,%esi
mov    $0x1f,%r8d
call   1030 <keccak_absorb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shake256_absorb>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x88,%esi
mov    $0x1f,%r8d
jmp    1030 <keccak_absorb@plt>

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

LLVM IR (-O2):
define void @shake256_absorb(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @keccak_absorb(i32* %0, i32 136, i8* %1, i32 %2, i32 31)
ret void
}
void ECAPGlobalIntEnable(unsigned int baseAdd) {
  (*((volatile unsigned short *)(baseAdd + (0x30)))) |= (0x0001u);
}


x86 assembly (clang, -O0):
<ECAPGlobalIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
or     $0x1,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPGlobalIntEnable>:
add    $0x30,%edi
orw    $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @ECAPGlobalIntEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 48
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
%8 = zext i16 %7 to i32
%9 = or i32 %8, 1
%10 = trunc i32 %9 to i16
store volatile i16 %10, i16* %6
ret void
}

LLVM IR (-O2):
define void @ECAPGlobalIntEnable(i32 %0) {
%2 = add i32 %0, 48
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i16*
%5 = load volatile i16, i16* %4
%6 = or i16 %5, 1
store volatile i16 %6, i16* %4
ret void
}
int get_salt_size(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @get_salt_size() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ endswap_int_array(void *, int);
void endswap_float_array(float *ptr, int len) {
  endswap_int_array((void *)ptr, len);
}


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

x86 assembly (clang, -O2):
<endswap_float_array>:
jmp    1030 <endswap_int_array@plt>

LLVM IR (-O0):
define void @endswap_float_array(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = bitcast float* %5 to i8*
%7 = load i32, i32* %4
%8 = call i32 @endswap_int_array(i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @endswap_float_array(float* %0, i32 %1) {
%3 = bitcast float* %0 to i8*
%4 = tail call i32 @endswap_int_array(i8* %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fb_init();
int /*<<< orphan*/ init_gdt();
int /*<<< orphan*/ serial_init();
void init(void) {
  init_gdt();
  fb_init();
  serial_init();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init_gdt@plt>
mov    $0x0,%al
call   1030 <fb_init@plt>
mov    $0x0,%al
call   1050 <serial_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1040 <init_gdt@plt>
xor    %eax,%eax
call   1030 <fb_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <serial_init@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @init_gdt()
%2 = call i32 (...) @fb_init()
%3 = call i32 (...) @serial_init()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @init_gdt()
%2 = tail call i32 (...) @fb_init()
%3 = tail call i32 (...) @serial_init()
ret void
}
void *pointerTest(void *value) { return value; }


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

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

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

LLVM IR (-O2):
define i8* @pointerTest(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int my_main();
void _start() {
  int ret = my_main();
  exit(ret);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <my_main@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1040 <my_main@plt>
mov    %eax,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @_start() {
%1 = alloca i32
%2 = call i32 (...) @my_main()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @my_main()
%2 = tail call i32 @exit(i32 %1)
unreachable
}
int conv_ind(char c) {
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + ('z' - 'a') + 1;
  if (c >= 'a' && c <= 'z')
    return c - 'a';
  return -1;
}


x86 assembly (clang, -O0):
<conv_ind>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1139 <conv_ind+0x39>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1139 <conv_ind+0x39>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0x19,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <conv_ind+0x69>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1162 <conv_ind+0x62>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1162 <conv_ind+0x62>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <conv_ind+0x69>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @conv_ind(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -39
br label %12
7: ; preds = %1
%8 = add i8 %0, -97
%9 = icmp ult i8 %8, 26
%10 = add nsw i32 %2, -97
%11 = select i1 %9, i32 %10, i32 -1
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
unsigned int f33(unsigned int x, unsigned int y) {
  return (x >> y) | (x << ((-y) & (8 * 4 - 1)));
}


x86 assembly (clang, -O0):
<f33>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f33>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f33(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 0, %9
%11 = and i32 %10, 31
%12 = shl i32 %8, %11
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f33(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 0, %1
%5 = and i32 %4, 31
%6 = shl i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
unsigned long simple_strtoul(char *x, char **y, unsigned int z) {
  unsigned long a;
  return a;
}


x86 assembly (clang, -O0):
<simple_strtoul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @simple_strtoul(i8* nocapture readnone %0, i8** nocapture readnone %1, i32 %2) {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ handle_57(int /*<<< orphan*/);
int gen_57(void) {
  handle_57(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_57>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_57@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_57() {
%1 = call i32 @handle_57(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_57() {
%1 = tail call i32 @handle_57(i32 0)
ret i32 0
}
int test_imm_7Fuint32_reg(unsigned int val) {
  return ((val) & (0x7F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Fuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x7f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_7Fuint32_reg(i32 %0) {
%2 = and i32 %0, 127
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int compf(const void *p1, const void *p2) {
  if ((*(float *)p1) > (*(float *)p2))
    return 1;
  if ((*(float *)p1) < (*(float *)p2))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    112d <compf+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1159 <compf+0x59>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1152 <compf+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <compf+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compf>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compf(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to float*
%8 = load float, float* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
%12 = fcmp ogt float %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to float*
%17 = load float, float* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to float*
%20 = load float, float* %19
%21 = fcmp olt float %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 -1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compf(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("padxorer by xerpi\n"
         "usage: padxorer <input file 1> <input file 2>\n"
         "the output will be <input file 1>.out\n");
}


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

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

LLVM IR (-O0):
@.str = [103 x i8] c"padxorer by xerpi\0Ausage: padxorer <input file 1> <input file 2>\0Athe output will be <input file 1>.out\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [102 x i8] c"padxorer by xerpi\0Ausage: padxorer <input file 1> <input file 2>\0Athe output will be <input file 1>.out\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex16(int, unsigned short);
void print_debug_hex16(unsigned short value) { __console_tx_hex16(7, value); }


x86 assembly (clang, -O0):
<print_debug_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x7,%edi
movzwl -0x2(%rbp),%esi
call   1030 <__console_tx_hex16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_hex16>:
mov    %edi,%esi
mov    $0x7,%edi
jmp    1030 <__console_tx_hex16@plt>

LLVM IR (-O0):
define void @print_debug_hex16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @__console_tx_hex16(i32 7, i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_debug_hex16(i16 zeroext %0) {
%2 = tail call i32 @__console_tx_hex16(i32 7, i16 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "Usage: %s [-Cr] [-g <goal>] [-m|w <max>] [<files>..]\n"
                "\t %s [-Cr] [<goal>] [<max>] [<files>]\n",
                getprogname(), getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rdx
mov    %rax,%rcx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ea6(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getprogname@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [92 x i8] c"Usage: %s [-Cr] [-g <goal>] [-m|w <max>] [<files>..]\0A\09 %s [-Cr] [<goal>] [<max>] [<files>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i8* (...) @getprogname()
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [92 x i8] c"Usage: %s [-Cr] [-g <goal>] [-m|w <max>] [<files>..]\0A\09 %s [-Cr] [<goal>] [<max>] [<files>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i8* (...) @getprogname()
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
void set_XConfigureEvent_send_event(void *_p, int _v) {
  ((XConfigureEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XConfigureEvent_send_event>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XConfigureEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void foo325() {}


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

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

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

LLVM IR (-O2):
define void @foo325() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ unlink(char *);
void cleanup(void) {
  printf("Removing fifo %s...\n", "test-fifo");
  if (unlink("test-fifo")) {
    perror("unlink");
    exit(1);
  };
  printf("Done.\n");
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1185 <cleanup+0x45>
lea    0xea9(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
lea    0xea8(%rip),%rdi
lea    0xeb6(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
test   %rax,%rax
jne    1183 <cleanup+0x33>
lea    0xea9(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
lea    0xe95(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Removing fifo %s...\0A\00"
@.str.1 = [10 x i8] c"test-fifo\00"
@.str.2 = [7 x i8] c"unlink\00"
@.str.3 = [7 x i8] c"Done.\0A\00"
define void @cleanup() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i64 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Removing fifo %s...\0A\00"
@.str.1 = [10 x i8] c"test-fifo\00"
@.str.2 = [7 x i8] c"unlink\00"
@str = [6 x i8] c"Done.\00"
define void @cleanup() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  struct data {
    int a : 3;
    unsigned int b;
  } DAT;
  DAT.a = 0x07;
  DAT.b = 3;
  printf("%d\n", DAT.a);
  printf("%d\n", DAT.b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%al
and    $0xf8,%al
or     $0x7,%al
mov    %al,-0x18(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x18(%rbp),%al
shl    $0x5,%al
sar    $0x5,%al
movsbl %al,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.data = type { i8, i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.data
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast %struct.data* %6 to i8*
%8 = load i8, i8* %7
%9 = and i8 %8, -8
%10 = or i8 %9, 7
store i8 %10, i8* %7
%11 = getelementptr inbounds %struct.data, %struct.data* %6, i32 0, i32 1
store i32 3, i32* %11
%12 = bitcast %struct.data* %6 to i8*
%13 = load i8, i8* %12
%14 = shl i8 %13, 5
%15 = ashr i8 %14, 5
%16 = sext i8 %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds %struct.data, %struct.data* %6, i32 0, i32 1
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_read_block(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *, int);
uint32_t eeprom_read_dword(const uint32_t *addr) {
  uint32_t ret = 0;
  eeprom_read_block(&ret, addr, 4);
  return ret;
}


x86 assembly (clang, -O0):
<eeprom_read_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <eeprom_read_block@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_read_dword>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <eeprom_read_block@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eeprom_read_dword(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 @eeprom_read_block(i32* %3, i32* %4, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @eeprom_read_dword(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @eeprom_read_block(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ crypto_thread_cleanup();
void subsys_crypto_thread_cleanup(void) { crypto_thread_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @subsys_crypto_thread_cleanup() {
%1 = tail call i32 (...) @crypto_thread_cleanup()
ret void
}
/* Variables and functions */
void *safe_malloc(size_t, size_t);
void *safe_matrix_malloc(size_t rows, size_t cols, size_t size) {
  size_t matrix_size = rows * cols;
  if (matrix_size / rows != cols) {
    return NULL;
  }
  return safe_malloc(matrix_size, size);
}


x86 assembly (clang, -O0):
<safe_matrix_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    -0x18(%rbp),%rax
je     1154 <safe_matrix_malloc+0x44>
movq   $0x0,-0x8(%rbp)
jmp    1165 <safe_matrix_malloc+0x55>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <safe_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_matrix_malloc>:
mov    %rdx,%rcx
mov    %rdi,%rax
mul    %rsi
jno    111e <safe_matrix_malloc+0xe>
xor    %eax,%eax
ret
mov    %rax,%rdi
mov    %rcx,%rsi
jmp    1030 <safe_malloc@plt>

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

LLVM IR (-O2):
define i8* @safe_matrix_malloc(i64 %0, i64 %1, i64 %2) {
%4 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %0, i64 %1)
%5 = extractvalue { i64, i1 } %4, 1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = extractvalue { i64, i1 } %4, 0
%8 = tail call i8* @safe_malloc(i64 %7, i64 %2)
br label %9
9: ; preds = %3, %6
%10 = phi i8* [ %8, %6 ], [ null, %3 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x1e() {
  Assert_real((ispunct(30) == 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_ispunct.c",
              155, ("ispunct should be 0 for 0x1e"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x1e>:
push   %rax
mov    $0x1e,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x9b,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x1e\00"
define void @t_ispunct_0x1e() {
%1 = call i64 @ispunct(i32 30)
%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 155, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x1e\00"
define void @t_ispunct_0x1e() {
%1 = tail call i64 @ispunct(i32 30)
%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 155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long long test_llrint(double x) { return __builtin_llrint(x); }


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

x86 assembly (clang, -O2):
<test_llrint>:
jmp    1030 <llrint@plt>

LLVM IR (-O0):
define i64 @test_llrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @llrint(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test_llrint(double %0) {
%2 = tail call i64 @llrint(double %0)
ret i64 %2
}