xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ qaeMemDestroy();
void osMemDestroy(void) { (void)qaeMemDestroy(); }


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

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

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

LLVM IR (-O2):
define void @osMemDestroy() {
%1 = tail call i32 (...) @qaeMemDestroy()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void check() {
  FILE *file = fopen("~/.bashrc", "r");
  fclose(file);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed4(%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):
<check>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"~/.bashrc\00"
@.str.1 = [2 x i8] c"r\00"
define void @check() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 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 = [10 x i8] c"~/.bashrc\00"
@.str.1 = [2 x i8] c"r\00"
define void @check() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 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
}
pb(b) { p(b, 8); }


x86 assembly (clang, -O0):
<pb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <p@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pb>:
mov    $0x8,%esi
xor    %eax,%eax
jmp    1030 <p@plt>

LLVM IR (-O0):
define i32 @pb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @p to i32 (i32, i32, ...)*)(i32 %4, i32 8)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @pb(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @p to i32 (i32, i32, ...)*)(i32 %0, i32 8)
ret i32 undef
}
/* Variables and functions */
int soma();
int main() {
  int one_parameter = 5;
  int second_paramater = 7;
  int resultado_soma = 0;
  resultado_soma = soma();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @soma()
ret i32 0
}
void fill(int len, char *p, char c) {
  int i;
  if (len > 0) {
    for (i = 0; i < len; i++)
      p[i] = c;
    p[len] = '\0';
  }
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1155 <fill+0x55>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1149 <fill+0x49>
mov    -0x11(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1121 <fill+0x21>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
test   %edi,%edi
jle    1137 <fill+0x27>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
movzbl %dl,%esi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1030 <memset@plt>
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fill(i32 %0, i8* %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %3
store i32 0, i32* %7
br label %11
11: ; preds = %21, %10
%12 = load i32, i32* %7
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = load i8, i8* %6
%17 = load i8*, i8** %5
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %15
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %11
24: ; preds = %11
%25 = load i8*, i8** %5
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 0, i8* %28
br label %29
29: ; preds = %24, %3
ret void
}

LLVM IR (-O2):
define void @fill(i32 %0, i8* nocapture writeonly %1, i8 signext %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = zext i32 %0 to i64
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %5, %3
ret void
}
void dmawait(void) {
  while (((*(volatile unsigned int *)(((((unsigned int)0x40000000) + 0x20000) +
                                       0x6400) +
                                      0x00)) &
          (1 << 5)) == 0)
    ;
  (*(volatile unsigned int *)(((((unsigned int)0x40000000) + 0x20000) +
                               0x6400) +
                              0x08)) |=
      (1 << 0) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5);
}


x86 assembly (clang, -O0):
<dmawait>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <dmawait+0x9>
mov    $0x40026400,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1121 <dmawait+0x21>
jmp    1109 <dmawait+0x9>
mov    $0x40026408,%eax
mov    (%rax),%ecx
or     $0x3d,%ecx
mov    $0x40026408,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmawait>:
testl  $0x20,0x40026400
je     1100 <dmawait>
orl    $0x3d,0x40026408
3d
ret

LLVM IR (-O0):
define void @dmawait() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 1073898496 to i32*)
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 1073898504 to i32*)
%8 = or i32 %7, 61
store volatile i32 %8, i32* inttoptr (i64 1073898504 to i32*)
ret void
}

LLVM IR (-O2):
define void @dmawait() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1073898496 to i32*)
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 1073898504 to i32*)
%7 = or i32 %6, 61
store volatile i32 %7, i32* inttoptr (i64 1073898504 to i32*)
ret void
}
void av_buffer_get_ref_count() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_get_ref_count() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ scanf(char *, char *);
unsigned int strtoul(char *, char **, int);
unsigned int GetDec(const char *szComment) {
  char cmd[1024];
  printf("%s:", szComment);
  scanf("%1023s", cmd);
  return (strtoul(cmd, (char **)NULL, 10));
}


x86 assembly (clang, -O0):
<GetDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x410(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x410(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDec>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s:\00"
@.str.1 = [7 x i8] c"%1023s\00"
define i32 @GetDec(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i32 @strtoul(i8* %8, i8** null, i32 10)
ret i32 %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s:\00"
@.str.1 = [7 x i8] c"%1023s\00"
define i32 @GetDec(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 @strtoul(i8* nocapture %3, i8** null, i32 10)
ret i32 %6
}
unsigned char unsignedchar_ignoring_signedlonglongint(unsigned char x,
                                                      signed long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_signedlonglongint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @unsignedchar_ignoring_signedlonglongint(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_signedlonglongint(i8 returned zeroext %0, i64 %1) {
ret i8 %0
}
void CANRegWrite(unsigned long ulRegAddress, unsigned long ulRegValue) {
  volatile unsigned long ulDelay;
  (*((volatile unsigned long *)(ulRegAddress))) = ulRegValue;
  for (ulDelay = 0; ulDelay < 5; ulDelay++) {
  }
}


x86 assembly (clang, -O0):
<CANRegWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    $0x5,%rax
jae    1143 <CANRegWrite+0x43>
jmp    1132 <CANRegWrite+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111f <CANRegWrite+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANRegWrite>:
mov    %rsi,(%rdi)
movq   $0x0,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x4,%rax
ja     1131 <CANRegWrite+0x31>
nopw   0x0(%rax,%rax,1)
addq   $0x1,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x5,%rax
jb     1120 <CANRegWrite+0x20>
ret

LLVM IR (-O0):
define void @CANRegWrite(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = inttoptr i64 %7 to i64*
store volatile i64 %6, i64* %8
store volatile i64 0, i64* %5
br label %9
9: ; preds = %13, %2
%10 = load volatile i64, i64* %5
%11 = icmp ult i64 %10, 5
br i1 %11, label %12, label %16
12: ; preds = %9
br label %13
13: ; preds = %12
%14 = load volatile i64, i64* %5
%15 = add i64 %14, 1
store volatile i64 %15, i64* %5
br label %9
16: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @CANRegWrite(i64 %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %5
store volatile i64 0, i64* %3
%6 = load volatile i64, i64* %3
%7 = icmp ult i64 %6, 5
br i1 %7, label %8, label %13
8: ; preds = %2, %8
%9 = load volatile i64, i64* %3
%10 = add i64 %9, 1
store volatile i64 %10, i64* %3
%11 = load volatile i64, i64* %3
%12 = icmp ult i64 %11, 5
br i1 %12, label %8, label %13
13: ; preds = %8, %2
ret void
}
void __attribute__((regparm(2))) fc_f1(int i, int j, int k) {}


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

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

LLVM IR (-O0):
define void @fc_f1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @fc_f1(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
struct cdrom_subchnl {
  int dummy;
};
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int main(void) {
  struct cdrom_subchnl s;
  (void)s;
  return sizeof(s);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long, int);
void output_table_line(FILE *f, long mjday, double delta) {
  fprintf(f, "\t%ld, %d,\n", mjday, (int)delta);
}


x86 assembly (clang, -O0):
<output_table_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
cvttsd2si -0x18(%rbp),%ecx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_table_line>:
mov    %rsi,%rdx
cvttsd2si %xmm0,%ecx
lea    0xee2(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\09%ld, %d,\0A\00"
define void @output_table_line(i32* %0, i64 %1, double %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca double
store i32* %0, i32** %4
store i64 %1, i64* %5
store double %2, double* %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = load double, double* %6
%10 = fptosi double %9 to i32
%11 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %8, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\09%ld, %d,\0A\00"
define void @output_table_line(i32* nocapture %0, i64 %1, double %2) {
%4 = fptosi double %2 to i32
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %1, i32 %4)
ret void
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
uid_t getuid(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getuid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getuid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getuid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
void GPMCECCAlgoSelect(unsigned int baseAddr, unsigned int algo) {
  (*((volatile unsigned int *)(baseAddr + (0x1F4)))) &= ~(0x00010000u);
  (*((volatile unsigned int *)(baseAddr + (0x1F4)))) |=
      ((algo << (0x00000010u)) & (0x00010000u));
}


x86 assembly (clang, -O0):
<GPMCECCAlgoSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f4,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffeffff,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0x10,%edx
and    $0x10000,%edx
mov    -0x4(%rbp),%eax
add    $0x1f4,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCECCAlgoSelect>:
add    $0x1f4,%edi
andl   $0xfffeffff,(%rdi)
and    $0x1,%esi
shl    $0x10,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCECCAlgoSelect(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 = add i32 %5, 500
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -65537
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = shl i32 %11, 16
%13 = and i32 %12, 65536
%14 = load i32, i32* %3
%15 = add i32 %14, 500
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, %13
store volatile i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @GPMCECCAlgoSelect(i32 %0, i32 %1) {
%3 = add i32 %0, 500
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -65537
store volatile i32 %7, i32* %5
%8 = shl i32 %1, 16
%9 = and i32 %8, 65536
%10 = load volatile i32, i32* %5
%11 = or i32 %10, %9
store volatile i32 %11, i32* %5
ret void
}
IR0AR1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((*p0) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl 0x43d11(%rcx),%ecx
cmp    %ecx,%eax
jg     1144 <IR0AR1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <IR0AR1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AR1>:
mov    (%r8),%cl
xor    %eax,%eax
cmp    0x43d11(%r9),%cl
setle  %al
ret

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

LLVM IR (-O2):
define i32 @IR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture %5) {
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 277777
%9 = load i8, i8* %8
%10 = icmp sle i8 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
int st_numhash(char *x, int size) {
  return ((((long)x) < 0 ? -((long)x) : ((long)x)) % (size));
}


x86 assembly (clang, -O0):
<st_numhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x0,%rax
jge    112b <st_numhash+0x2b>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1133 <st_numhash+0x33>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_numhash>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
movslq %esi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1122 <st_numhash+0x22>
cqto
idiv   %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @st_numhash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %9 to i64
%11 = sub nsw i64 0, %10
br label %15
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = ptrtoint i8* %13 to i64
br label %15
15: ; preds = %12, %8
%16 = phi i64 [ %11, %8 ], [ %14, %12 ]
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = srem i64 %16, %18
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @st_numhash(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i64 @llvm.abs.i64(i64 %3, i1 true)
%5 = sext i32 %1 to i64
%6 = srem i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ failure_count();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pruebas_heap_alumno();
int main(int argc, char *argv[]) {
  printf("~~~ PRUEBAS ALUMNO ~~~\n");
  pruebas_heap_alumno();
  return failure_count() > 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    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <pruebas_heap_alumno@plt>
mov    $0x0,%al
call   1040 <failure_count@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <pruebas_heap_alumno@plt>
xor    %eax,%eax
call   1040 <failure_count@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"~~~ PRUEBAS ALUMNO ~~~\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 ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @pruebas_heap_alumno()
%8 = call i64 (...) @failure_count()
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@str = [23 x i8] c"~~~ PRUEBAS ALUMNO ~~~\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @pruebas_heap_alumno()
%5 = tail call i64 (...) @failure_count()
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ wNotYet(char *);
void wBuiltinGetWxApp() { wNotYet("GetWxApp"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"GetWxApp\00"
define void @wBuiltinGetWxApp() {
%1 = call i32 @wNotYet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"GetWxApp\00"
define void @wBuiltinGetWxApp() {
%1 = tail call i32 @wNotYet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_hello();
int main(void) { print_hello(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_hello()
ret i32 0
}
/* Variables and functions */
int rec1(int);
int rec2(int x) { return rec1(x); }


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

x86 assembly (clang, -O2):
<rec2>:
jmp    1030 <rec1@plt>

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

LLVM IR (-O2):
define i32 @rec2(i32 %0) {
%2 = tail call i32 @rec1(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ nrf_drv_usbd_errata_type_52840_eng_b();
bool nrf_drv_usbd_errata_104(void) {
  return (1 && (!nrf_drv_usbd_errata_type_52840_eng_b()));
}


x86 assembly (clang, -O0):
<nrf_drv_usbd_errata_104>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nrf_drv_usbd_errata_type_52840_eng_b@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_drv_usbd_errata_104>:
push   %rax
xor    %eax,%eax
call   1030 <nrf_drv_usbd_errata_type_52840_eng_b@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @nrf_drv_usbd_errata_104() {
%1 = call i32 (...) @nrf_drv_usbd_errata_type_52840_eng_b()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @nrf_drv_usbd_errata_104() {
%1 = tail call i32 (...) @nrf_drv_usbd_errata_type_52840_eng_b()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ size(int *);
int isEmpty(int *a) {
  if (size(a) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <size@plt>
cmp    $0x0,%rax
jne    113b <isEmpty+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <isEmpty+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
push   %rax
call   1030 <size@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isEmpty(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i64 @size(i32* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @isEmpty(i32* %0) {
%2 = tail call i64 @size(i32* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int,
                           unsigned int, unsigned int);
int /*<<< orphan*/ stderr;
void explosion(unsigned r3, unsigned r4, unsigned r5) {
  fprintf(stderr, "\nloop test failed, r3 = %08x, r4 = %08x, r5 = %08x\n", r3,
          r4, r5);
  exit(1);
}


x86 assembly (clang, -O0):
<explosion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<explosion>:
push   %rax
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"\0Aloop test failed, r3 = %08x, r4 = %08x, r5 = %08x\0A\00"
define void @explosion(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"\0Aloop test failed, r3 = %08x, r4 = %08x, r5 = %08x\0A\00"
define void @explosion(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int __infer_nondet_int();
int /*<<< orphan*/ __require_allocated_array(void *);
int fsctl(const char *path, unsigned long request, void *data,
          unsigned int options) {
  int ret;
  __require_allocated_array(path);
  __require_allocated_array(data);
  ret = __infer_nondet_int();
  if (ret < -1 || ret > 0)
    while (1)
      ;
  return ret;
}


x86 assembly (clang, -O0):
<fsctl>:
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
call   1040 <__require_allocated_array@plt>
mov    -0x18(%rbp),%rdi
call   1040 <__require_allocated_array@plt>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jl     1167 <fsctl+0x47>
cmpl   $0x0,-0x20(%rbp)
jle    1171 <fsctl+0x51>
jmp    116c <fsctl+0x4c>
jmp    116c <fsctl+0x4c>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsctl>:
push   %rbx
mov    %rdx,%rbx
call   1040 <__require_allocated_array@plt>
mov    %rbx,%rdi
call   1040 <__require_allocated_array@plt>
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
lea    -0x1(%rax),%ecx
cmp    $0xfffffffd,%ecx
ja     1142 <fsctl+0x22>
jmp    1140 <fsctl+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fsctl(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @__require_allocated_array(i8* %0)
%6 = tail call i32 @__require_allocated_array(i8* %2)
%7 = tail call i32 (...) @__infer_nondet_int()
%8 = add i32 %7, -1
%9 = icmp ult i32 %8, -2
br i1 %9, label %10, label %11
10: ; preds = %4, %10
br label %10
11: ; preds = %4
ret i32 %7
}
/* Variables and functions */
scalar_t__ isalnum(int);
chkword(int c) { return ((isalnum(c) || c == '_' || c == '@' || c > 0x7f)); }


x86 assembly (clang, -O0):
<chkword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    115d <chkword+0x4d>
mov    $0x1,%al
cmpl   $0x5f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115d <chkword+0x4d>
mov    $0x1,%al
cmpl   $0x40,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115d <chkword+0x4d>
cmpl   $0x7f,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chkword>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <chkword+0x17>
pop    %rbx
ret
cmp    $0x40,%ebx
je     1125 <chkword+0x15>
cmp    $0x5f,%ebx
je     1125 <chkword+0x15>
xor    %eax,%eax
cmp    $0x7f,%ebx
setg   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chkword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 95
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 64
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 127
br label %15
15: ; preds = %12, %9, %6, %1
%16 = phi i1 [ true, %9 ], [ true, %6 ], [ true, %1 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @chkword(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i32 %0, label %6 [
i32 95, label %9
i32 64, label %9
]
6: ; preds = %5
%7 = icmp sgt i32 %0, 127
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ]
ret i32 %10
}
double applyForce(double *vel, float force) {
  double accel = force * 0.05;
  double displace = (*vel * 0.05) + (0.5 * accel * 0.05);
  *vel += accel;
  return displace;
}


x86 assembly (clang, -O0):
<applyForce>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xebc(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyForce>:
cvtss2sd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  (%rdi),%xmm2
movsd  0xeec(%rip),%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rdi)
ret

LLVM IR (-O0):
define double @applyForce(double* %0, float %1) {
%3 = alloca double*
%4 = alloca float
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store float %1, float* %4
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fmul double %8, 5.000000e-02
store double %9, double* %5
%10 = load double*, double** %3
%11 = load double, double* %10
%12 = load double, double* %5
%13 = fmul double 5.000000e-01, %12
%14 = fmul double %13, 5.000000e-02
%15 = call double @llvm.fmuladd.f64(double %11, double 5.000000e-02, double %14)
store double %15, double* %6
%16 = load double, double* %5
%17 = load double*, double** %3
%18 = load double, double* %17
%19 = fadd double %18, %16
store double %19, double* %17
%20 = load double, double* %6
ret double %20
}

LLVM IR (-O2):
define double @applyForce(double* nocapture %0, float %1) {
%3 = fpext float %1 to double
%4 = fmul double %3, 5.000000e-02
%5 = load double, double* %0
%6 = fmul double %4, 5.000000e-01
%7 = fmul double %6, 5.000000e-02
%8 = tail call double @llvm.fmuladd.f64(double %5, double 5.000000e-02, double %7)
%9 = fadd double %4, %5
store double %9, double* %0
ret double %8
}
void gdk_region_empty() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_empty() {
ret void
}
int LongCompare(const void *vp1, const void *vp2) {
  return (*(const long *)vp1) - (*(const long *)vp2);
}


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

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

LLVM IR (-O0):
define i32 @LongCompare(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @LongCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ output_with_tab(char *);
void gen_def_byte(void) { output_with_tab(".byte "); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c".byte \00"
define void @gen_def_byte() {
%1 = call i32 @output_with_tab(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c".byte \00"
define void @gen_def_byte() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned short int unsignedshortint_ignoring_signedlong(unsigned short int x,
                                                        signed long y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshortint_ignoring_signedlong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshortint_ignoring_signedlong(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_ignoring_signedlong(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
long long llabs(long long ll) { return ll > 0 ? ll : -ll; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <llabs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int rand();
int pivot(int arr[], int start, int end) {
  int p = start + rand() % (end - start + 1);
  return p;
}


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

x86 assembly (clang, -O2):
<pivot>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%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 @pivot(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = call i32 (...) @rand()
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
%13 = add nsw i32 %12, 1
%14 = srem i32 %9, %13
%15 = add nsw i32 %8, %14
store i32 %15, i32* %7
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @pivot(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @rand()
%5 = sub i32 1, %1
%6 = add i32 %5, %2
%7 = srem i32 %4, %6
%8 = add nsw i32 %7, %1
ret i32 %8
}
/* Variables and functions */
int reboot(int /*<<< orphan*/);
int main(void) { return (reboot(0)); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <reboot@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @reboot(i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int isakmp_validate_key_information(u_int8_t *buf, size_t sz) { return 0; }


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

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

LLVM IR (-O0):
define i32 @isakmp_validate_key_information(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @isakmp_validate_key_information(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_read_chunks();
int /*<<< orphan*/ test_read_string();
int /*<<< orphan*/ test_reader(char const *const);
int /*<<< orphan*/ test_writer(char const *const);
int main(void) {
  test_read_chunks();
  test_read_string();
  const char *const path = "serd_test.ttl";
  test_writer(path);
  test_reader(path);
  printf("Success\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_read_chunks@plt>
mov    $0x0,%al
call   1070 <test_read_string@plt>
lea    0xe8c(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe81(%rip),%rdi
call   1030 <test_writer@plt>
lea    0xe75(%rip),%rdi
call   1040 <test_reader@plt>
lea    0xe77(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <test_read_chunks@plt>
xor    %eax,%eax
call   1070 <test_read_string@plt>
lea    0xe9a(%rip),%rbx
mov    %rbx,%rdi
call   1040 <test_writer@plt>
mov    %rbx,%rdi
call   1050 <test_reader@plt>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"serd_test.ttl\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (...) @test_read_chunks()
%4 = call i32 (...) @test_read_string()
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = call i32 @test_writer(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i32 0, i32 0))
%6 = call i32 @test_reader(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i32 0, i32 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"serd_test.ttl\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 (...) @test_read_chunks()
%2 = tail call i32 (...) @test_read_string()
%3 = tail call i32 @test_writer(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @test_reader(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tm_cb();
void textModeFinish(unsigned int a, unsigned int b, unsigned int c) { tm_cb(); }


x86 assembly (clang, -O0):
<textModeFinish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1030 <tm_cb@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @textModeFinish(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (...) @tm_cb()
ret void
}

LLVM IR (-O2):
define void @textModeFinish(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @tm_cb()
ret void
}
unsigned long UARTParityModeGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x0000000C))) &
          (0x00000400 | 0x00000200));
}


x86 assembly (clang, -O0):
<UARTParityModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rax
and    $0x600,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeGet>:
mov    0xc(%rdi),%rax
and    $0x600,%eax
ret

LLVM IR (-O0):
define i64 @UARTParityModeGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 1536
ret i64 %7
}

LLVM IR (-O2):
define i64 @UARTParityModeGet(i64 %0) {
%2 = add i64 %0, 12
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 1536
ret i64 %5
}
/* Variables and functions */
scalar_t__ condition_alphanumeric(char);
int /*<<< orphan*/ condition_i(char);
int condition_alphanumericExcept_i(char c) {
  return !condition_i(c) && condition_alphanumeric(c);
}


x86 assembly (clang, -O0):
<condition_alphanumericExcept_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <condition_i@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    115a <condition_alphanumericExcept_i+0x3a>
movsbl -0x1(%rbp),%edi
call   1030 <condition_alphanumeric@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_alphanumericExcept_i>:
push   %rbx
mov    %edi,%ebx
call   1040 <condition_i@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1132 <condition_alphanumericExcept_i+0x12>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <condition_alphanumeric@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @condition_alphanumericExcept_i(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @condition_i(i8 signext %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @condition_alphanumeric(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @condition_alphanumericExcept_i(i8 signext %0) {
%2 = tail call i32 @condition_i(i8 signext %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @condition_alphanumeric(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}