xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_diffrle_binary_format();
int /*<<< orphan*/ test_diffrle_decompression();
int main(void) {
  test_diffrle_binary_format();
  test_diffrle_decompression();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_diffrle_binary_format()
%2 = tail call i32 (...) @test_diffrle_decompression()
ret i32 0
}
float ao_mpu6000_gyro(float sensor) {
  return sensor * ((float)(((float)2000 * 3.1415926535897832384626433 / 180.0) /
                           32767.0));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ao_mpu6000_gyro(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3F51742DE0000000
ret float %4
}

LLVM IR (-O2):
define float @ao_mpu6000_gyro(float %0) {
%2 = fmul float %0, 0x3F51742DE0000000
ret float %2
}
int sync_test_and_clear_bit(long nr, volatile unsigned long *addr) {
  int oldbit;
  asm volatile("lock; btr %2,%1\n\tsbbl %0,%0"
               : "=r"(oldbit), "+m"((*(volatile long *)addr))
               : "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<sync_test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
lock btr %rcx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_test_and_clear_bit>:
lock btr %rdi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sync_test_and_clear_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i32
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %3
%8 = call i32 asm sideeffect "lock; btr $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @sync_test_and_clear_bit(i64 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "lock; btr $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret i32 %3
}
int test_imm_75int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x75 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_75int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x75,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_75int64_highword_mem>:
testb  $0x75,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_75int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 502511173632
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void funAreaOfCircle(void) {
  float a;
  float r;
  printf("enter r ");
  scanf("%f", &r);
  a = 3.14 * r * r;
  printf("area = %f ", a);
}


x86 assembly (clang, -O0):
<funAreaOfCircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe93(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funAreaOfCircle>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"enter r \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [11 x i8] c"area = %f \00"
define void @funAreaOfCircle() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double 3.140000e+00, %6
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %7, %9
%11 = fptrunc double %10 to float
store float %11, float* %1
%12 = load float, float* %1
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double %13)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"enter r \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [11 x i8] c"area = %f \00"
define void @funAreaOfCircle() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 3.140000e+00
%8 = fmul double %7, %6
%9 = fptrunc double %8 to float
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OutputGetActualSpeed(unsigned char, char *);
char MotorActualSpeed(unsigned char Output) {
  char Result = 0;
  OutputGetActualSpeed(Output, &Result);
  return Result;
}


x86 assembly (clang, -O0):
<MotorActualSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x2(%rbp),%rsi
movzbl -0x1(%rbp),%edi
call   1030 <OutputGetActualSpeed@plt>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MotorActualSpeed>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
call   1030 <OutputGetActualSpeed@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @MotorActualSpeed(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = call i32 @OutputGetActualSpeed(i8 zeroext %4, i8* %3)
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @MotorActualSpeed(i8 zeroext %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 @OutputGetActualSpeed(i8 zeroext %0, i8* %2)
%4 = load i8, i8* %2
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ show_version();
int /*<<< orphan*/ stderr;
void usage(void) {
  show_version();
  fprintf(
      stderr,
      "\n"
      "usage: smc [-hs] [-b <baud rate>] [-d <device node file>] [-r <role>]"
      "\\\n"
      "\n"
      "options:\n"
      "   -h   show this usage\n"
      "   -b   baud rate\n"
      "   -d   device node file (e.g. /dev/ttyS0, /dev/ttyUSB2)\n"
      "   -r   work role (0:transmitter, 1:receiver, 2:repeater)\n"
      "   -s   enable rssi information (only effective under role of "
      "receiver)\n"
      "   -B   run daemon in the background\n"
      "   -v   show hostapd version\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <show_version@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1030 <show_version@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [378 x i8] c"\0Ausage: smc [-hs] [-b <baud rate>] [-d <device node file>] [-r <role>]\\\0A\0Aoptions:\0A -h show this usage\0A -b baud rate\0A -d device node file (e.g. /dev/ttyS0, /dev/ttyUSB2)\0A -r work role (0:transmitter, 1:receiver, 2:repeater)\0A -s enable rssi information (only effective under role of receiver)\0A -B run daemon in the background\0A -v show hostapd version\0A\00"
define void @usage() {
%1 = call i32 (...) @show_version()
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [378 x i8] c"\0Ausage: smc [-hs] [-b <baud rate>] [-d <device node file>] [-r <role>]\\\0A\0Aoptions:\0A -h show this usage\0A -b baud rate\0A -d device node file (e.g. /dev/ttyS0, /dev/ttyUSB2)\0A -r work role (0:transmitter, 1:receiver, 2:repeater)\0A -s enable rssi information (only effective under role of receiver)\0A -B run daemon in the background\0A -v show hostapd version\0A\00"
define void @usage() {
%1 = tail call i32 (...) @show_version()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void so_init3(void) {
  printf("so_init3"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"so_init3\00"
define void @so_init3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_41() {
  Assert_real((isqrt(41) == 6),
              "/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/stdlib/isqrt.c",
              210, ("Integer square root of 41 should be 6"));
}


x86 assembly (clang, -O0):
<t_sqrt_41>:
push   %rbp
mov    %rsp,%rbp
mov    $0x29,%edi
call   1030 <isqrt@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xd2,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_41>:
push   %rax
mov    $0x29,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xd2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 41 should be 6\00"
define void @t_sqrt_41() {
%1 = call i32 @isqrt(i32 41)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 41 should be 6\00"
define void @t_sqrt_41() {
%1 = tail call i32 @isqrt(i32 41)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  char *szFirst = "Literal String";
  char *szSecond = "Literal String";
  szFirst[3] = 'q';
  printf("szFirst (%s) is at %d, szSecond (%s) is at %d\n", szFirst, szFirst,
         szSecond, szSecond);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x71,0x3(%rax)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef7(%rip),%rdi
lea    0xee1(%rip),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Literal String\00"
@.str.1 = [47 x i8] c"szFirst (%s) is at %d, szSecond (%s) is at %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
store i8 113, i8* %5
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7, i8* %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Literal String\00"
@.str.1 = [47 x i8] c"szFirst (%s) is at %d, szSecond (%s) is at %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int MPI_Send(const void *buf, int count, int datatype, int dest, int tag,
             int comm) {
  static int callcount = 0;
  if (callcount == 0) {
    printf("MPI Stub WARNING: Should not send message to self\n");
    ++callcount;
  }
  return 0;
}


x86 assembly (clang, -O0):
<MPI_Send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x0,0x2ef8(%rip)
jne    1155 <MPI_Send+0x45>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ee0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed7(%rip)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Send>:
push   %rax
cmpl   $0x0,0x2f14(%rip)
jne    112d <MPI_Send+0x1d>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
addl   $0x1,0x2eff(%rip)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@MPI_Send.callcount = internal global i32 0
@.str = [51 x i8] c"MPI Stub WARNING: Should not send message to self\0A\00"
define i32 @MPI_Send(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* @MPI_Send.callcount
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %6
%16 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @MPI_Send.callcount
%18 = add nsw i32 %17, 1
store i32 %18, i32* @MPI_Send.callcount
br label %19
19: ; preds = %15, %6
ret i32 0
}

LLVM IR (-O2):
@MPI_Send.callcount = internal unnamed_addr global i32 0
@str = [50 x i8] c"MPI Stub WARNING: Should not send message to self\00"
define i32 @MPI_Send(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = load i32, i32* @MPI_Send.callcount
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%11 = load i32, i32* @MPI_Send.callcount
%12 = add nsw i32 %11, 1
store i32 %12, i32* @MPI_Send.callcount
br label %13
13: ; preds = %9, %6
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
const char *page_flag_type(uint64_t flag) {
  if (flag & (0xffffULL << 32))
    return "(r)";
  if (flag & (0xffffULL << 48))
    return "(o)";
  return "   ";
}


x86 assembly (clang, -O0):
<page_flag_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movabs $0xffff00000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1132 <page_flag_type+0x32>
lea    0xed7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <page_flag_type+0x68>
movslq -0xc(%rbp),%rax
movabs $0xffff000000000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     115d <page_flag_type+0x5d>
lea    0xeb0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <page_flag_type+0x68>
lea    0xea4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_flag_type>:
movslq %edi,%rax
test   %eax,%eax
lea    0xefc(%rip),%rcx
lea    0xef1(%rip),%rdx
cmovns %rcx,%rdx
movabs $0xffff00000000,%rcx
test   %rcx,%rax
lea    0xed5(%rip),%rax
cmove  %rdx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"(r)\00"
@.str.1 = [4 x i8] c"(o)\00"
@.str.2 = [4 x i8] c" \00"
define i8* @page_flag_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = and i64 %5, 281470681743360
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = and i64 %11, -281474976710656
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %16
15: ; preds = %9
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"(r)\00"
@.str.1 = [4 x i8] c"(o)\00"
@.str.2 = [4 x i8] c" \00"
define i8* @page_flag_type(i32 %0) {
%2 = sext i32 %0 to i64
%3 = and i64 %2, 281470681743360
%4 = icmp eq i64 %3, 0
%5 = icmp sgt i32 %0, -1
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%7 = select i1 %4, i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %7
}
/* Variables and functions */
int *realloc(int *, int);
int *tabRealloc(int *tab, int size) { return realloc(tab, size * sizeof(int)); }


x86 assembly (clang, -O0):
<tabRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabRealloc>:
shl    $0x2,%esi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i32* @tabRealloc(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 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i32* @realloc(i32* %5, i32 %9)
ret i32* %10
}

LLVM IR (-O2):
define i32* @tabRealloc(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32* @realloc(i32* %0, i32 %3)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ DSF(int /*<<< orphan*/);
int main() {
  DSF(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @DSF(i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ copysignf(float, float);
int /*<<< orphan*/ link_failure_copysignf();
void test_copysignf(float f1, float f2) {
  if (copysignf(f1, f2) != copysignf(f1, f2))
    link_failure_copysignf();
}


x86 assembly (clang, -O0):
<test_copysignf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <copysignf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <copysignf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_copysignf+0x4b>
mov    $0x0,%al
call   1040 <link_failure_copysignf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_copysignf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1030 <copysignf@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1030 <copysignf@plt>
cmp    %rax,%rbx
jne    1155 <test_copysignf+0x35>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_copysignf@plt>

LLVM IR (-O0):
define void @test_copysignf(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 = call i64 @copysignf(float %5, float %6)
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call i64 @copysignf(float %8, float %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_copysignf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_copysignf(float %0, float %1) {
%3 = tail call i64 @copysignf(float %0, float %1)
%4 = tail call i64 @copysignf(float %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_copysignf()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ test_multiplex_2_extended(int /*<<< orphan*/ const *,
                                             size_t);
int /*<<< orphan*/ test_multiplex_2_extended_types(int /*<<< orphan*/ const *,
                                                   size_t);
int /*<<< orphan*/ test_multiplex_2_normal(int /*<<< orphan*/ const *, size_t);
int /*<<< orphan*/ test_multiplex_2_shared(int /*<<< orphan*/ const *, size_t);
int LLVMFuzzerTestOneInput(const uint8_t *data_p, size_t size) {
  test_multiplex_2_shared(data_p, size);
  test_multiplex_2_normal(data_p, size);
  test_multiplex_2_extended(data_p, size);
  test_multiplex_2_extended_types(data_p, size);
  return (0);
}


x86 assembly (clang, -O0):
<LLVMFuzzerTestOneInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <test_multiplex_2_shared@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <test_multiplex_2_normal@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <test_multiplex_2_extended@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <test_multiplex_2_extended_types@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LLVMFuzzerTestOneInput>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <test_multiplex_2_shared@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <test_multiplex_2_normal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <test_multiplex_2_extended@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <test_multiplex_2_extended_types@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @LLVMFuzzerTestOneInput(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = call i32 @test_multiplex_2_shared(i32* %5, i64 %6)
%8 = load i32*, i32** %3
%9 = load i64, i64* %4
%10 = call i32 @test_multiplex_2_normal(i32* %8, i64 %9)
%11 = load i32*, i32** %3
%12 = load i64, i64* %4
%13 = call i32 @test_multiplex_2_extended(i32* %11, i64 %12)
%14 = load i32*, i32** %3
%15 = load i64, i64* %4
%16 = call i32 @test_multiplex_2_extended_types(i32* %14, i64 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @LLVMFuzzerTestOneInput(i32* %0, i64 %1) {
%3 = tail call i32 @test_multiplex_2_shared(i32* %0, i64 %1)
%4 = tail call i32 @test_multiplex_2_normal(i32* %0, i64 %1)
%5 = tail call i32 @test_multiplex_2_extended(i32* %0, i64 %1)
%6 = tail call i32 @test_multiplex_2_extended_types(i32* %0, i64 %1)
ret i32 0
}
/* Variables and functions */
unsigned long long foo(int, int);
int main() {
  unsigned long long res;
  res = foo(3, 4);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 3, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BuildWord(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char buffer[10];
  char *pchWord;
  strcpy(buffer, "foo");
  pchWord = buffer;
  BuildWord(pchWord);
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xe(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <BuildWord@plt>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <BuildWord@plt>
lea    0xe9c(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @BuildWord(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @BuildWord(i8* %2)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test(int, int);
int main() {
  test(11, 22);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb,%edi
mov    $0x16,%esi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 11, i32 22)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void file_error(char *s) {
  fprintf(stderr, "Couldn't open file: %s\n", s);
  exit(0);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Couldn't open file: %s\0A\00"
define void @file_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) { fprintf(stdout, "Hello, dtruss!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [16 x i8] c"Hello, dtruss!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [16 x i8] c"Hello, dtruss!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_bad1() {
  int arr1[10];
  int arr2[20];
  memcpy(arr1, arr2, 44);
}


x86 assembly (clang, -O0):
<memcpy_bad1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x30(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x2c,%edx
call   1030 <memcpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_bad1>:
sub    $0x88,%rsp
mov    %rsp,%rdi
lea    0x30(%rsp),%rsi
mov    $0x2c,%edx
call   1030 <memcpy@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @memcpy_bad1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i32* %3, i32* %4, i32 44)
ret void
}

LLVM IR (-O2):
define void @memcpy_bad1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 44)
ret void
}
p(const void *a, const void *b) { return **(int **)a - **(int **)b; }


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

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

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

LLVM IR (-O2):
define i32 @p(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32**
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int INTFC_ChoixNbJoueurs() {
  int n;
  printf("Veuiller entrer le nombre de joueurs\t");
  scanf("%d", &n);
  return n;
}


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

x86 assembly (clang, -O2):
<INTFC_ChoixNbJoueurs>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Veuiller entrer le nombre de joueurs\09\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @INTFC_ChoixNbJoueurs() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [38 x i8] c"Veuiller entrer le nombre de joueurs\09\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @INTFC_ChoixNbJoueurs() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
const char *jac_chain_nm5_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<jac_chain_nm5_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <jac_chain_nm5_name_out+0x2b>
jmp    111a <jac_chain_nm5_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <jac_chain_nm5_name_out+0x3b>
jmp    114b <jac_chain_nm5_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jac_chain_nm5_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jac_chain_nm5_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm5_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @jac_chain_nm5_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @jac_chain_nm5_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void adjust_lowmem_bounds_mpu(void) {}


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

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

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

LLVM IR (-O2):
define void @adjust_lowmem_bounds_mpu() {
ret void
}
unsigned int DRV_PWRCTRL_STANDBYSTATEACPU(unsigned int ulStandbyTime,
                                          unsigned int ulSwitchtime) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @DRV_PWRCTRL_STANDBYSTATEACPU(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void XMLDB_Generate_End_Paragraph(FILE *dest_doc) {
  fprintf(dest_doc, "%s", "</para>\n");
}


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

x86 assembly (clang, -O2):
<XMLDB_Generate_End_Paragraph>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [9 x i8] c"</para>\0A\00"
define void @XMLDB_Generate_End_Paragraph(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"</para>\0A\00"
define void @XMLDB_Generate_End_Paragraph(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 8, i64 1, i32* %0)
ret void
}
void _infix_operator_mod_i32_i32(signed long lhs, signed long rhs,
                                 signed long *__rval_1) {
  *__rval_1 = lhs % rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_mod_i32_i32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rdx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_mod_i32_i32>:
mov    %rdx,%rcx
mov    %rdi,%rax
mov    %rdi,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     111b <_infix_operator_mod_i32_i32+0x1b>
cqto
idiv   %rsi
mov    %rdx,(%rcx)
ret
xor    %edx,%edx
div    %esi
mov    %rdx,(%rcx)
ret

LLVM IR (-O0):
define void @_infix_operator_mod_i32_i32(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = srem i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_mod_i32_i32(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = srem i64 %0, %1
store i64 %4, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int shmdt(void const *);
void shared_end(const void *shm) {
  if (shmdt(shm) == -1)
    perror("shmdt");
}


x86 assembly (clang, -O0):
<shared_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <shmdt@plt>
cmp    $0xffffffff,%eax
jne    114a <shared_end+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shared_end>:
push   %rax
call   1030 <shmdt@plt>
cmp    $0xffffffff,%eax
je     112d <shared_end+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"shmdt\00"
define void @shared_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @shmdt(i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"shmdt\00"
define void @shared_end(i8* %0) {
%2 = tail call i32 @shmdt(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int calc_h_start(int id, int height, int number_of_threads) {
  if (height < number_of_threads) {
    if (id == 0) {
      return 0;
    } else {
      return height + 1;
    }
  } else {
    return (id * height / number_of_threads);
  }
}


x86 assembly (clang, -O0):
<calc_h_start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    113d <calc_h_start+0x3d>
cmpl   $0x0,-0x8(%rbp)
jne    112f <calc_h_start+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    114b <calc_h_start+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <calc_h_start+0x4b>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_h_start>:
mov    %esi,%eax
cmp    %edx,%esi
jge    110f <calc_h_start+0xf>
add    $0x1,%eax
test   %edi,%edi
cmove  %edi,%eax
ret
mov    %edx,%ecx
imul   %edi,%eax
cltd
idiv   %ecx
ret

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

LLVM IR (-O2):
define i32 @calc_h_start(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = icmp eq i32 %0, 0
%7 = add nsw i32 %1, 1
%8 = select i1 %6, i32 0, i32 %7
br label %12
9: ; preds = %3
%10 = mul nsw i32 %1, %0
%11 = sdiv i32 %10, %2
br label %12
12: ; preds = %5, %9
%13 = phi i32 [ %11, %9 ], [ %8, %5 ]
ret i32 %13
}
sh4op(i0000_0000_0000_1001) {}


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

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

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

LLVM IR (-O2):
define i32 @sh4op(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA1_Stream7_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA1_Stream7_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_Stream7_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int test_imm_63int64_highword_reg(long long val) {
  return ((val >> 32) & (0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x63,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_63int64_highword_reg>:
movabs $0x6300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_63int64_highword_reg(i64 %0) {
%2 = and i64 %0, 425201762304
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}