xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
zsub() {
  ol("subl %eax, %edx");
  ol("movl %edx, %eax");
}


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

x86 assembly (clang, -O2):
<zsub>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"subl %eax, %edx\00"
@.str.1 = [16 x i8] c"movl %edx, %eax\00"
define i32 @zsub() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"subl %eax, %edx\00"
@.str.1 = [16 x i8] c"movl %edx, %eax\00"
define i32 @zsub() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
int test_imm_92uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x92 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_92uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 146
%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_92uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 627065225216
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int f() {
  int i;
  i = 0;
  while (i < 100) {
    i = i + 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1123 <f+0x23>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
br label %2
8: ; preds = %2
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @f() {
ret i32 100
}
int test_imm_71int16_mem(short *val) {
  return ((*val) & (0x71 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_71int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x71,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_71int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 113
%7 = icmp ne i32 %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_71int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 113
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void UARTIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000038))) |= ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<UARTIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x38(%rcx)
ret

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

LLVM IR (-O2):
define void @UARTIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 56
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Type definitions */
struct nl_handle {
  int dummy;
};

/* Variables and functions */
struct nl_handle *nl_handle_alloc();
struct nl_handle *nl_socket_alloc(void) {
  return nl_handle_alloc();
}


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

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

LLVM IR (-O0):
%struct.nl_handle = type { i32 }
define %struct.nl_handle* @nl_socket_alloc() {
%1 = call %struct.nl_handle* (...) @nl_handle_alloc()
ret %struct.nl_handle* %1
}

LLVM IR (-O2):
%struct.nl_handle = type { i32 }
define %struct.nl_handle* @nl_socket_alloc() {
%1 = tail call %struct.nl_handle* (...) @nl_handle_alloc()
ret %struct.nl_handle* %1
}
void zero(unsigned m[8][8]) {
  int i, j;
  for (i = 0; i < 8; i++)
    for (j = 0; j < 8; j++)
      m[i][j] = 0;
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1165 <zero+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1152 <zero+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <zero+0x20>
jmp    1157 <zero+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <zero+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
xorps  %xmm0,%xmm0
movups %xmm0,0xf0(%rdi)
movups %xmm0,0xe0(%rdi)
movups %xmm0,0xd0(%rdi)
movups %xmm0,0xc0(%rdi)
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @zero([8 x i32]* nocapture writeonly %0) {
%2 = bitcast [8 x i32]* %0 to i8*
ret void
}
/* Variables and functions */
char const *strerror(int);
const char *sim_get_os_error_text(int Error) { return strerror(Error); }


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

x86 assembly (clang, -O2):
<sim_get_os_error_text>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @sim_get_os_error_text(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  printf("Hello, what is your name?");
  char name[50];
  scanf("%s", name);
  printf("Hello %s, how are you doing today?\n", name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x40(%rbp),%rsi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Hello, what is your name?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [36 x i8] c"Hello %s, how are you doing today?\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Hello, what is your name?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [36 x i8] c"Hello %s, how are you doing today?\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i32 0
}
void wrhit(i) register int i;
{
  writel("Blot hit on ");
  wrint(i);
  writec('.');
  writec('\n');
}


x86 assembly (clang, -O0):
<wrhit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1050 <writel@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <wrint@plt>
mov    $0x2e,%edi
mov    $0x0,%al
call   1030 <writec@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <writec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrhit>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1050 <writel@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <wrint@plt>
mov    $0x2e,%edi
xor    %eax,%eax
call   1030 <writec@plt>
mov    $0xa,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <writec@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Blot hit on \00"
define void @wrhit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @writel to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @wrint to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @writec to i32 (i32, ...)*)(i32 46)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @writec to i32 (i32, ...)*)(i32 10)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Blot hit on \00"
define void @wrhit(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @writel to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @wrint to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @writec to i32 (i32, ...)*)(i32 46)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @writec to i32 (i32, ...)*)(i32 10)
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double rand_double_range(double min, double max) {
  if (min > max) {
    double tmp = min;
    min = max;
    max = tmp;
  }
  double r = (double)rand() / RAND_MAX;
  return min + r * (max - min);
}


x86 assembly (clang, -O0):
<rand_double_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1150 <rand_double_range+0x40>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e85(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double_range>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
maxsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
minsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mov    0x2ea6(%rip),%rax
divsd  (%rax),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_double_range(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fcmp ogt double %7, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load double, double* %3
store double %11, double* %5
%12 = load double, double* %4
store double %12, double* %3
%13 = load double, double* %5
store double %13, double* %4
br label %14
14: ; preds = %10, %2
%15 = call i64 (...) @rand()
%16 = sitofp i64 %15 to double
%17 = load double, double* @RAND_MAX
%18 = fdiv double %16, %17
store double %18, double* %6
%19 = load double, double* %3
%20 = load double, double* %6
%21 = load double, double* %4
%22 = load double, double* %3
%23 = fsub double %21, %22
%24 = call double @llvm.fmuladd.f64(double %20, double %23, double %19)
ret double %24
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_double_range(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
%5 = select i1 %3, double %1, double %0
%6 = tail call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = load double, double* @RAND_MAX
%9 = fdiv double %7, %8
%10 = fsub double %4, %5
%11 = tail call double @llvm.fmuladd.f64(double %9, double %10, double %5)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_fun(int s) { printf("signal : [%d]\n", s); }


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

x86 assembly (clang, -O2):
<sig_fun>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"signal : [%d]\0A\00"
define void @sig_fun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"signal : [%d]\0A\00"
define void @sig_fun(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sum();
int main() {
  sum();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sum()
ret i32 0
}
XSetCloseDownMode() {}


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

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

LLVM IR (-O0):
define i32 @XSetCloseDownMode() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetCloseDownMode() {
ret i32 undef
}
void bar2(void) {
#pragma omp parallel
  {}
}


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

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

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

LLVM IR (-O2):
define void @bar2() {
ret void
}
/* Variables and functions */
float vector_length2(float const *, int);
float magnitude2(const float vec[3]) { return vector_length2(vec, 3); }


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

x86 assembly (clang, -O2):
<magnitude2>:
mov    $0x3,%esi
jmp    1030 <vector_length2@plt>

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

LLVM IR (-O2):
define float @magnitude2(float* %0) {
%2 = tail call float @vector_length2(float* %0, i32 3)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ net_base_recv(int, int /*<<< orphan*/ *, size_t,
                                 int /*<<< orphan*/ *, int);
ssize_t net_stream_recv(int sock, uint8_t *buffer, size_t size,
                        int timeout_ms) {
  return net_base_recv(sock, buffer, size, NULL, timeout_ms);
}


x86 assembly (clang, -O0):
<net_stream_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <net_base_recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_stream_recv>:
mov    %ecx,%r8d
xor    %ecx,%ecx
jmp    1030 <net_base_recv@plt>

LLVM IR (-O0):
define i32 @net_stream_recv(i32 %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @net_base_recv(i32 %9, i32* %10, i64 %11, i32* null, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @net_stream_recv(i32 %0, i32* %1, i64 %2, i32 %3) {
%5 = tail call i32 @net_base_recv(i32 %0, i32* %1, i64 %2, i32* null, i32 %3)
ret i32 %5
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int buffer_find_char(struct buffer *, int, int, char const *, int *);
int buffer_find_char_prev(struct buffer *buf, int from, const char *accept,
                          int *newlines) {
  return buffer_find_char(buf, from, -1, accept, newlines);
}


x86 assembly (clang, -O0):
<buffer_find_char_prev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0xffffffff,%edx
call   1030 <buffer_find_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_find_char_prev>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    $0xffffffff,%edx
jmp    1030 <buffer_find_char@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @buffer_find_char_prev(%struct.buffer* %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca %struct.buffer*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
store %struct.buffer* %0, %struct.buffer** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load %struct.buffer*, %struct.buffer** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32*, i32** %8
%13 = call i32 @buffer_find_char(%struct.buffer* %9, i32 %10, i32 -1, i8* %11, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @buffer_find_char_prev(%struct.buffer* %0, i32 %1, i8* %2, i32* %3) {
%5 = tail call i32 @buffer_find_char(%struct.buffer* %0, i32 %1, i32 -1, i8* %2, i32* %3)
ret i32 %5
}
int add_asm(int a, int b) {
  asm("add %[b], %[a]" : [a] "+r"(a) : [b] "r"(b) :);
  return a;
}


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

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

LLVM IR (-O0):
define i32 @add_asm(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 = call i32 asm "add $1, $0", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %5)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @add_asm(i32 %0, i32 %1) {
%3 = tail call i32 asm "add $1, $0", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  int a = 2;
  int b = 2;
  __VERIFIER_assert(a < b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
int test_imm_C6uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xC6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C6uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xc6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C6uint64_midword_reg>:
test   $0xc60000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C6uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 198
%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_C6uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12976128
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void openfile(char *filename) {
  printf("Enter the name of the data file : ");
  scanf("%s", filename);
}


x86 assembly (clang, -O0):
<openfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee0(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openfile>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Enter the name of the data file : \00"
@.str.1 = [3 x i8] c"%s\00"
define void @openfile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Enter the name of the data file : \00"
@.str.1 = [3 x i8] c"%s\00"
define void @openfile(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned char inb(int);
unsigned char keyboard_getStatus() { return inb(0x64); }


x86 assembly (clang, -O0):
<keyboard_getStatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <inb@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_getStatus>:
mov    $0x64,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @keyboard_getStatus() {
%1 = call zeroext i8 @inb(i32 100)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @keyboard_getStatus() {
%1 = tail call zeroext i8 @inb(i32 100)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int do_exit(char **arguments) {
  if ((arguments[0] != NULL) && !strcmp(arguments[0], "exit")) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1152 <do_exit+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xec8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1152 <do_exit+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1159 <do_exit+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_exit>:
push   %rax
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1129 <do_exit+0x19>
lea    0xee0(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     112d <do_exit+0x1d>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
define i32 @do_exit(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char input_string[256];
  scanf("%[^\n]", input_string);
  printf("Hello, World.\n");
  printf("%s\n", input_string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%[^\0A]\00"
@.str.1 = [15 x i8] c"Hello, World.\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%[^\0A]\00"
@str = [14 x i8] c"Hello, World.\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* %2)
ret i32 0
}
void kim() {}


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

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

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

LLVM IR (-O2):
define void @kim() {
ret void
}
void create_dir(const char *name, int parent_dir) {}


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

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

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

LLVM IR (-O2):
define void @create_dir(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  register void *val = malloc(size);
  if (val == 0)
    error("not enough virtual memory!");
  return val;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"not enough virtual memory!\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"not enough virtual memory!\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void free_dmar_iommu(struct intel_iommu *iommu) {}


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

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

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

LLVM IR (-O2):
%struct.intel_iommu = type opaque
define void @free_dmar_iommu(%struct.intel_iommu* nocapture %0) {
ret void
}
void INT_Excep_PERIB_INTB187(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB187() {
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ era_sinh(double);
double ourDuration_SpeedTest(double x) {
  clock_t start = clock();
  era_sinh(x);
  clock_t stop = clock();
  return (double)(stop - start) / CLOCKS_PER_SEC * 1000;
}


x86 assembly (clang, -O0):
<ourDuration_SpeedTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <era_sinh@plt>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e87(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xe93(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ourDuration_SpeedTest>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <era_sinh@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2e8f(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0xe9b(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @ourDuration_SpeedTest(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca i64
store double %0, double* %2
%5 = call i64 (...) @clock()
store i64 %5, i64* %3
%6 = load double, double* %2
%7 = call i32 @era_sinh(double %6)
%8 = call i64 (...) @clock()
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = load i64, i64* %3
%11 = sub nsw i64 %9, %10
%12 = sitofp i64 %11 to double
%13 = load double, double* @CLOCKS_PER_SEC
%14 = fdiv double %12, %13
%15 = fmul double %14, 1.000000e+03
ret double %15
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @ourDuration_SpeedTest(double %0) {
%2 = tail call i64 (...) @clock()
%3 = tail call i32 @era_sinh(double %0)
%4 = tail call i64 (...) @clock()
%5 = sub nsw i64 %4, %2
%6 = sitofp i64 %5 to double
%7 = load double, double* @CLOCKS_PER_SEC
%8 = fdiv double %6, %7
%9 = fmul double %8, 1.000000e+03
ret double %9
}
int test_025(int a, int b, int c, int d) { return ((a >> 31) & 1) + a; }


x86 assembly (clang, -O0):
<test_025>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_025>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @test_025(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = ashr i32 %9, 31
%11 = and i32 %10, 1
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_025(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = lshr i32 %0, 31
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void BellCallback(void *ctx) { fprintf(stderr, "bell\n"); }


x86 assembly (clang, -O0):
<BellCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BellCallback>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"bell\0A\00"
define void @BellCallback(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void XRecolorCursor() {}


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

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

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

LLVM IR (-O2):
define void @XRecolorCursor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ printf(char *);
void ksft_print_header(void) {
  if (!(getenv("KSFT_TAP_LEVEL")))
    printf("TAP version 13\n");
}


x86 assembly (clang, -O0):
<ksft_print_header>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%eax
jne    1145 <ksft_print_header+0x25>
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ksft_print_header>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %eax,%eax
je     1133 <ksft_print_header+0x13>
pop    %rax
ret
lea    0xed5(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"KSFT_TAP_LEVEL\00"
@.str.1 = [16 x i8] c"TAP version 13\0A\00"
define void @ksft_print_header() {
%1 = call i32 @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"KSFT_TAP_LEVEL\00"
@str = [15 x i8] c"TAP version 13\00"
define void @ksft_print_header() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
int dname_is_self(char *name) { return name[0] == '.' && name[1] == '\0'; }


x86 assembly (clang, -O0):
<dname_is_self>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    112e <dname_is_self+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dname_is_self>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    1110 <dname_is_self+0x10>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @dname_is_self(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 46
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @dname_is_self(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
void can_relocate_jump(void) {
  int ok = 0;
  asm("    .global "
      "set_point1"
      "\n"
      "set_point1"
      ":\n"
      ".byte 0xe9\n"
      ".byte 0x00\n"
      ".byte 0x00\n"
      ".byte 0x00\n"
      ".byte 0x00\n"
      "  mov $1, %[ok]\n"
      : [ok] "=r"(ok));
  if (ok == 1)
    pass();
  else
    fail();
}


x86 assembly (clang, -O0):
<can_relocate_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)

x86 assembly (clang, -O2):
<can_relocate_jump>:
jmp    1125 <can_relocate_jump+0x5>
mov    $0x1,%eax
cmp    $0x1,%eax
jne    1136 <can_relocate_jump+0x16>
xor    %eax,%eax
jmp    1040 <pass@plt>
xor    %eax,%eax
jmp    1030 <fail@plt>

LLVM IR (-O0):
define void @can_relocate_jump() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 asm " .global set_point1\0Aset_point1:\0A.byte 0xe9\0A.byte 0x00\0A.byte 0x00\0A.byte 0x00\0A.byte 0x00\0A mov $$1, $0\0A", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @pass()
br label %9
7: ; preds = %0
%8 = call i32 (...) @fail()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @can_relocate_jump() {
%1 = tail call i32 asm " .global set_point1\0Aset_point1:\0A.byte 0xe9\0A.byte 0x00\0A.byte 0x00\0A.byte 0x00\0A.byte 0x00\0A mov $$1, $0\0A", "=r,~{dirflag},~{fpsr},~{flags}"()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @pass()
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @fail()
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void rtp2435_set_type(uint8_t *header, uint8_t type) { header[4] = type; }


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

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

LLVM IR (-O0):
define void @rtp2435_set_type(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 4
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @rtp2435_set_type(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xd1() {
  Assert_real((isprint(209) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1050, ("isprint should be 0 for 0xd1"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xd1>:
push   %rax
mov    $0xd1,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd1\00"
define void @t_isprint_0xd1() {
%1 = call i64 @isprint(i32 209)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1050, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd1\00"
define void @t_isprint_0xd1() {
%1 = tail call i64 @isprint(i32 209)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1050, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "Usage: %s\n"
                "\t%s -p <proto>\n"
                "\t%s -n <name>\n",
                getprogname(), getprogname(), getprogname());
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s\0A\09%s -p <proto>\0A\09%s -n <name>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i8* (...) @getprogname()
%4 = call i8* (...) @getprogname()
%5 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s\0A\09%s -p <proto>\0A\09%s -n <name>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i8* (...) @getprogname()
%4 = tail call i8* (...) @getprogname()
%5 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}