xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("./temp_to_file");
  system("flite -voice slt -f "
         "\"/home/pi/work/Voice/CPU_temp_talk/cpu_temp_frase.txt\" ");
  system("flite -voice slt -f \"/home/pi/work/Programs/CPU_temp/temp.txt\" ");
  system("flite -voice slt -t \" degrees Celsius\" ");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
lea    0xedd(%rip),%rdi
call   1030 <system@plt>
lea    0xf1d(%rip),%rdi
call   1030 <system@plt>
lea    0xf51(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"./temp_to_file\00"
@.str.1 = [76 x i8] c"flite -voice slt -f \22/home/pi/work/Voice/CPU_temp_talk/cpu_temp_frase.txt\22 \00"
@.str.2 = [64 x i8] c"flite -voice slt -f \22/home/pi/work/Programs/CPU_temp/temp.txt\22 \00"
@.str.3 = [40 x i8] c"flite -voice slt -t \22 degrees Celsius\22 \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"./temp_to_file\00"
@.str.1 = [76 x i8] c"flite -voice slt -f \22/home/pi/work/Voice/CPU_temp_talk/cpu_temp_frase.txt\22 \00"
@.str.2 = [64 x i8] c"flite -voice slt -f \22/home/pi/work/Programs/CPU_temp/temp.txt\22 \00"
@.str.3 = [40 x i8] c"flite -voice slt -t \22 degrees Celsius\22 \00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DrawGraphicShifted(int, int, int, int, int, int, int, int);
void DrawGraphicShiftedThruMask(int x, int y, int dx, int dy, int graphic,
                                int frame, int cut_mode) {
  DrawGraphicShifted(x, y, dx, dy, graphic, frame, cut_mode, 1);
}


x86 assembly (clang, -O0):
<DrawGraphicShiftedThruMask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1030 <DrawGraphicShifted@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawGraphicShiftedThruMask>:
push   %rax
mov    0x10(%rsp),%eax
push   $0x1
push   %rax
call   1030 <DrawGraphicShifted@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @DrawGraphicShiftedThruMask(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = call i32 @DrawGraphicShifted(i32 %15, i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 1)
ret void
}

LLVM IR (-O2):
define void @DrawGraphicShiftedThruMask(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @DrawGraphicShifted(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 1)
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *ss = s;
  while (*ss) {
    ++ss;
  }
  return ss - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *stringFieldInSubmissionSet(struct sqlConnection *, int, char *);
char *genePixPubUrl(struct sqlConnection *conn, int id) {
  return stringFieldInSubmissionSet(conn, id, "pubUrl");
}


x86 assembly (clang, -O0):
<genePixPubUrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <stringFieldInSubmissionSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genePixPubUrl>:
lea    0xee9(%rip),%rdx
jmp    1030 <stringFieldInSubmissionSet@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [7 x i8] c"pubUrl\00"
define i8* @genePixPubUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [7 x i8] c"pubUrl\00"
define i8* @genePixPubUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int vfprintf(FILE *stream, const char *format, va_list arg) {
  char buf[1024];
  int i;
  return 10;
}


x86 assembly (clang, -O0):
<vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xa,%eax
add    $0x3b0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1024 x i8]
%8 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 10
}

LLVM IR (-O2):
define i32 @vfprintf(i32* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 10
}
/* Variables and functions */
double pmod(double, double);
double TimeWithinDay(double t) {
  return pmod(t, (((24.0 * 60.0) * 60.0) * 1000.0));
}


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

x86 assembly (clang, -O2):
<TimeWithinDay>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pmod@plt>

LLVM IR (-O0):
define double @TimeWithinDay(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pmod(double %3, double 8.640000e+07)
ret double %4
}

LLVM IR (-O2):
define double @TimeWithinDay(double %0) {
%2 = tail call double @pmod(double %0, double 8.640000e+07)
ret double %2
}
/* Variables and functions */
int socket(int, int, int);
int /*<<< orphan*/ unix_error(char *);
int Socket(int domain, int type, int protocol) {
  int rc;
  if ((rc = socket(domain, type, protocol)) < 0)
    unix_error("Socket error");
  return rc;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1157 <Socket+0x37>
lea    0xeae(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Socket+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Socket error\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
int fun1149() { return 1149; }


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

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

LLVM IR (-O0):
define i32 @fun1149() {
ret i32 1149
}

LLVM IR (-O2):
define i32 @fun1149() {
ret i32 1149
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
unsigned long hash_syscall_context(const pid_t pid) {
  unsigned long h = (unsigned long)pid;
  return h % (1997);
}


x86 assembly (clang, -O0):
<hash_syscall_context>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x7cd,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_syscall_context>:
movabs $0x689adb3574c87e3,%rcx
ad 89 06
mov    %rdi,%rax
mul    %rcx
mov    %rdi,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0xa,%rax
imul   $0x7cd,%rax,%rax
sub    %rax,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @hash_syscall_context(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = urem i64 %5, 1997
ret i64 %6
}

LLVM IR (-O2):
define i64 @hash_syscall_context(i64 %0) {
%2 = urem i64 %0, 1997
ret i64 %2
}
int mad_is_vendor_range2(int mgmt) { return mgmt >= 0x30 && mgmt <= 0x4f; }


x86 assembly (clang, -O0):
<mad_is_vendor_range2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <mad_is_vendor_range2+0x20>
cmpl   $0x4f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mad_is_vendor_range2>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0x20,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @mad_is_vendor_range2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 79
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mad_is_vendor_range2(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 32
%4 = zext i1 %3 to i32
ret i32 %4
}
void regulator_dummy_init(void) {}


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

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

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

LLVM IR (-O2):
define void @regulator_dummy_init() {
ret void
}
void handle_session(int session_fd) {
  char protocol_version = 10;
  char *server_version = "68.0.0";
  int connection_id = 0;
}


x86 assembly (clang, -O0):
<handle_session>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0xa,-0x5(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"68.0.0\00"
define void @handle_session(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %2
store i8 10, i8* %3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %4
store i32 0, i32* %5
ret void
}

LLVM IR (-O2):
define void @handle_session(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ islessgreater(long double, long double);
void uninitvar_islessgreater(void) {
  float f1, f2;
  (void)islessgreater(f1, f2);
  double d1, d2;
  (void)islessgreater(d1, d2);
  long double ld1, ld2;
  (void)islessgreater(ld1, ld2);
}


x86 assembly (clang, -O0):
<uninitvar_islessgreater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
flds   -0x4(%rbp)
flds   -0x8(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <islessgreater@plt>
fldl   -0x10(%rbp)
fldl   -0x18(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <islessgreater@plt>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <islessgreater@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_islessgreater>:
sub    $0x28,%rsp
call   1030 <islessgreater@plt>
call   1030 <islessgreater@plt>
call   1030 <islessgreater@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_islessgreater() {
%1 = alloca float
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = load float, float* %1
%8 = fpext float %7 to x86_fp80
%9 = load float, float* %2
%10 = fpext float %9 to x86_fp80
%11 = call i32 @islessgreater(x86_fp80 %8, x86_fp80 %10)
%12 = load double, double* %3
%13 = fpext double %12 to x86_fp80
%14 = load double, double* %4
%15 = fpext double %14 to x86_fp80
%16 = call i32 @islessgreater(x86_fp80 %13, x86_fp80 %15)
%17 = load x86_fp80, x86_fp80* %5
%18 = load x86_fp80, x86_fp80* %6
%19 = call i32 @islessgreater(x86_fp80 %17, x86_fp80 %18)
ret void
}

LLVM IR (-O2):
define void @uninitvar_islessgreater() {
%1 = tail call i32 @islessgreater(x86_fp80 undef, x86_fp80 undef)
%2 = tail call i32 @islessgreater(x86_fp80 undef, x86_fp80 undef)
%3 = tail call i32 @islessgreater(x86_fp80 undef, x86_fp80 undef)
ret void
}
void g_node_copy_deep() {}


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

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

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

LLVM IR (-O2):
define void @g_node_copy_deep() {
ret void
}
int doubleit(a)
int a;
{ return (a + a); }


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

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

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

LLVM IR (-O2):
define i32 @doubleit(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int main() {
  int a = 3;
  float b = 0.3;
  float c = a / b;
  c /= 3 * (2 - b) + 4;
  return 0 * a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movss  0xef2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xed2(%rip),%xmm1
subss  -0xc(%rbp),%xmm1
movss  0xebd(%rip),%xmm0
mulss  %xmm0,%xmm1
movss  0xeb5(%rip),%xmm0
addss  %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
imul   $0x0,-0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store i32 3, i32* %2
store float 0x3FD3333340000000, float* %3
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to float
%7 = load float, float* %3
%8 = fdiv float %6, %7
store float %8, float* %4
%9 = load float, float* %3
%10 = fsub float 2.000000e+00, %9
%11 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %10, float 4.000000e+00)
%12 = load float, float* %4
%13 = fdiv float %12, %11
store float %13, float* %4
%14 = load i32, i32* %2
%15 = mul nsw i32 0, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef unsigned int uint16_t;

/* Variables and functions */
uint16_t pcg_rotr_16(uint16_t value, unsigned int rot) {
  return (value >> rot) | (value << ((-rot) & 15));
}


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

x86 assembly (clang, -O2):
<pcg_rotr_16>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0xf,%cl
shl    %cl,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @pcg_rotr_16(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 0, %1
%5 = and i32 %4, 15
%6 = shl i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int partitionArray(int, int);
void quickSort(int low, int high) {
  if (low < high) {
    int partitionIndex = partitionArray(low, high);
    quickSort(low, partitionIndex - 1);
    quickSort(partitionIndex + 1, high);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1164 <quickSort+0x44>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <partitionArray@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <quickSort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <quickSort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jge    1150 <quickSort+0x30>
mov    %esi,%r14d
mov    %edi,%ebp
nopl   (%rax)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <partitionArray@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%esi
mov    %ebp,%edi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1130 <quickSort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @quickSort(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @partitionArray(i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %4
br label %19
19: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @quickSort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = tail call i32 @partitionArray(i32 %5, i32 %1)
%7 = add nsw i32 %6, -1
tail call void @quickSort(i32 %5, i32 %7)
%8 = add nsw i32 %6, 1
%9 = icmp slt i32 %8, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int internalStreamerPoll(int);
int streamerPoll(int fd) { return internalStreamerPoll(fd); }


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

x86 assembly (clang, -O2):
<streamerPoll>:
jmp    1030 <internalStreamerPoll@plt>

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

LLVM IR (-O2):
define i32 @streamerPoll(i32 %0) {
%2 = tail call i32 @internalStreamerPoll(i32 %0)
ret i32 %2
}
int test_imm_8Buint32_mem(unsigned int *val) {
  return ((*val) & (0x8B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Buint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 139
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int SDL_imageFilterAbsDiffMMX(unsigned char *Src1, unsigned char *Src2,
                              unsigned char *Dest, int length) {
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @SDL_imageFilterAbsDiffMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int decade = 0;
  printf("enter a decimal number between 0 and 32767:\n");
  scanf("%u", &decade);
  printf("the octal number is: %5.5o\n", decade);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"enter a decimal number between 0 and 32767:\0A\00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [28 x i8] c"the octal number is: %5.5o\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 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* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [28 x i8] c"the octal number is: %5.5o\0A\00"
@str = [44 x i8] c"enter a decimal number between 0 and 32767:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 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
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
long set_mark(long);
long get_marked_ref(long w) { return set_mark(w); }


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

x86 assembly (clang, -O2):
<get_marked_ref>:
jmp    1030 <set_mark@plt>

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

LLVM IR (-O2):
define i64 @get_marked_ref(i64 %0) {
%2 = tail call i64 @set_mark(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
unsigned char *theNshMalloc(int);
unsigned char *theNshCalloc(int givenCount, int givenSize) {
  unsigned char *temp = theNshMalloc((int)(givenCount));
  memset(temp, 0, givenCount * sizeof(unsigned char));
  return temp;
}


x86 assembly (clang, -O0):
<theNshCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <theNshMalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<theNshCalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <theNshMalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @theNshCalloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i8* @theNshMalloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i32 @memset(i8* %8, i32 0, i32 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @theNshCalloc(i32 %0, i32 %1) {
%3 = tail call i8* @theNshMalloc(i32 %0)
%4 = tail call i32 @memset(i8* %3, i32 0, i32 %0)
ret i8* %3
}
int kgsl_pmregs_enabled(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @kgsl_pmregs_enabled() {
ret i32 1
}
int RSHF(int value, int amount, int topbit) {
  int mask;
  mask = 1 << amount;
  mask -= 1;
  mask = mask << (16 - amount);
  return ((value >> amount) & ~mask) | ((topbit) ? (mask) : 0);
}


x86 assembly (clang, -O0):
<RSHF>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115b <RSHF+0x5b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1165 <RSHF+0x65>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    1165 <RSHF+0x65>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSHF>:
mov    $0xffffffff,%eax
mov    %esi,%ecx
shl    %cl,%eax
not    %eax
mov    $0x10,%cl
sub    %sil,%cl
shl    %cl,%eax
mov    %esi,%ecx
sar    %cl,%edi
mov    %eax,%ecx
not    %ecx
and    %edi,%ecx
test   %edx,%edx
cmove  %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @RSHF(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = shl i32 1, %8
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = sub nsw i32 16, %13
%15 = shl i32 %12, %14
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = ashr i32 %16, %17
%19 = load i32, i32* %7
%20 = xor i32 %19, -1
%21 = and i32 %18, %20
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %3
%25 = load i32, i32* %7
br label %27
26: ; preds = %3
br label %27
27: ; preds = %26, %24
%28 = phi i32 [ %25, %24 ], [ 0, %26 ]
%29 = or i32 %21, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @RSHF(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %1
%5 = xor i32 %4, -1
%6 = sub nsw i32 16, %1
%7 = shl i32 %5, %6
%8 = ashr i32 %0, %1
%9 = xor i32 %7, -1
%10 = and i32 %8, %9
%11 = icmp eq i32 %2, 0
%12 = select i1 %11, i32 0, i32 %7
%13 = or i32 %10, %12
ret i32 %13
}
/* Variables and functions */
int mg_strncasecmp(char const *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int mg_strcasecmp(const char *str1, const char *str2) {
  return (mg_strncasecmp(str1, str2, strlen(str1)));
}


x86 assembly (clang, -O0):
<mg_strcasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <mg_strncasecmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_strcasecmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mg_strncasecmp@plt>

LLVM IR (-O0):
define i32 @mg_strcasecmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @mg_strncasecmp(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @mg_strcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @mg_strncasecmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ circular_queue_init();
void keyboard_init(void) { circular_queue_init(); }


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

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

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

LLVM IR (-O2):
define void @keyboard_init() {
%1 = tail call i32 (...) @circular_queue_init()
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
scalar_t__ S_ISFIFO(int /*<<< orphan*/);
scalar_t__ fstat(int /*<<< orphan*/, struct stat *);
int _stdin(int fd) {
  struct stat st;
  if (fstat(STDIN_FILENO, &st) == 0 && S_ISFIFO(st.st_mode)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
jne    1165 <_stdin+0x45>
mov    -0x10(%rbp),%edi
call   1030 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     1165 <_stdin+0x45>
movl   $0x1,-0x4(%rbp)
jmp    116c <_stdin+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stdin>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <fstat@plt>
test   %rax,%rax
jne    114e <_stdin+0x2e>
mov    (%rsp),%edi
call   1030 <S_ISFIFO@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     114e <_stdin+0x2e>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@STDIN_FILENO = global i32 0
define i32 @_stdin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* @STDIN_FILENO
%6 = call i64 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISFIFO(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %15
14: ; preds = %8, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@STDIN_FILENO = global i32 0
define i32 @_stdin(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = load i32, i32* @STDIN_FILENO
%5 = call i64 @fstat(i32 %4, %struct.stat* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i64 @S_ISFIFO(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7, %1
br label %13
13: ; preds = %7, %12
%14 = phi i32 [ 0, %12 ], [ 1, %7 ]
ret i32 %14
}
int hash(int val, int maxval) {
  return ((val >> 20) * 32 + (val & 0b1111111111)) % maxval;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x14,%eax
shl    $0x5,%eax
mov    -0x4(%rbp),%ecx
and    $0x3ff,%ecx
add    %ecx,%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
sar    $0xf,%eax
and    $0xffffffe0,%eax
and    $0x3ff,%edi
add    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash(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 = ashr i32 %5, 20
%7 = mul nsw i32 %6, 32
%8 = load i32, i32* %3
%9 = and i32 %8, 1023
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @hash(i32 %0, i32 %1) {
%3 = ashr i32 %0, 15
%4 = and i32 %3, -32
%5 = and i32 %0, 1023
%6 = add nsw i32 %4, %5
%7 = srem i32 %6, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ load_cpu_nsec(int);
int load_cpu_nsec_(int *sec) {
  load_cpu_nsec(*sec);
  return 0;
}


x86 assembly (clang, -O0):
<load_cpu_nsec_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <load_cpu_nsec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @load_cpu_nsec_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @load_cpu_nsec(i32 %2)
ret i32 0
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
scalar_t__ strncmp(int /*<<< orphan*/, char *, int);
int filter(const struct dirent *entry) {
  return strncmp(entry->d_name, "core", 4) == 0;
}


x86 assembly (clang, -O0):
<filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter>:
push   %rax
mov    (%rdi),%edi
lea    0xee6(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [5 x i8] c"core\00"
define i32 @filter(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i64 @strncmp(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [5 x i8] c"core\00"
define i32 @filter(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i64 @strncmp(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void Link() {}


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

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

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

LLVM IR (-O2):
define void @Link() {
ret void
}
void test19() {
  *(int *)0 = 0;
  *(volatile int *)0 = 0;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @test19() {
store i32 0, i32* null
store volatile i32 0, i32* null
ret void
}

LLVM IR (-O2):
float divd(float a, float b) {
  if (b == 0)
    return -1;
  return (a / b);
}


x86 assembly (clang, -O0):
<divd>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1137 <divd+0x37>
jp     1137 <divd+0x37>
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1146 <divd+0x46>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divd>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jne    1113 <divd+0x13>
jp     1113 <divd+0x13>
movss  0xeee(%rip),%xmm0
ret
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @divd(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store float -1.000000e+00, float* %3
br label %13
9: ; preds = %2
%10 = load float, float* %4
%11 = load float, float* %5
%12 = fdiv float %10, %11
store float %12, float* %3
br label %13
13: ; preds = %9, %8
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @divd(float %0, float %1) {
%3 = fcmp oeq float %1, 0.000000e+00
%4 = fdiv float %0, %1
%5 = select i1 %3, float -1.000000e+00, float %4
ret float %5
}
/* Variables and functions */
unsigned long PRCMHIBRegRead(int);
int /*<<< orphan*/ PRCMHIBRegWrite(int, unsigned long);
void PRCMIntDisable(unsigned long ulIntFlags) {
  unsigned long ulRegValue;
  if (ulIntFlags & 0x00004000) {
    (*((volatile unsigned long *)(0x44025000 + 0x00000124))) &= ~0x4;
    ulRegValue = PRCMHIBRegRead(0x4402F800 + 0x00000054);
    ulRegValue &= ~0x1;
    PRCMHIBRegWrite(0x4402F800 + 0x00000054, ulRegValue);
  }
}


x86 assembly (clang, -O0):
<PRCMIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     117c <PRCMIntDisable+0x5c>
mov    $0x44025124,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffb,%rcx
mov    $0x44025124,%eax
mov    %rcx,(%rax)
mov    $0x4402f854,%edi
call   1040 <PRCMHIBRegRead@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x4402f854,%edi
call   1030 <PRCMHIBRegWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMIntDisable>:
test   $0x4000,%edi
jne    1129 <PRCMIntDisable+0x9>
ret
push   %rax
andq   $0xfffffffffffffffb,0x44025124
44 fb
mov    $0x4402f854,%edi
call   1040 <PRCMHIBRegRead@plt>
and    $0xfffffffffffffffe,%rax
mov    $0x4402f854,%edi
mov    %rax,%rsi
pop    %rax
jmp    1030 <PRCMHIBRegWrite@plt>

LLVM IR (-O0):
define void @PRCMIntDisable(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 1141002532 to i64*)
%9 = and i64 %8, -5
store volatile i64 %9, i64* inttoptr (i64 1141002532 to i64*)
%10 = call i64 @PRCMHIBRegRead(i32 1141045332)
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = and i64 %11, -2
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = call i32 @PRCMHIBRegWrite(i32 1141045332, i64 %13)
br label %15
15: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @PRCMIntDisable(i64 %0) {
%2 = and i64 %0, 16384
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = load volatile i64, i64* inttoptr (i64 1141002532 to i64*)
%6 = and i64 %5, -5
store volatile i64 %6, i64* inttoptr (i64 1141002532 to i64*)
%7 = tail call i64 @PRCMHIBRegRead(i32 1141045332)
%8 = and i64 %7, -2
%9 = tail call i32 @PRCMHIBRegWrite(i32 1141045332, i64 %8)
br label %10
10: ; preds = %4, %1
ret void
}
/* Type definitions */
struct rpc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eval_rpc(double *, struct rpc *, double, double, double);
void lonlat_from_ijh(double ll[2], struct rpc *r, double i, double j,
                     double h) {
  eval_rpc(ll, r, i, j, h);
}


x86 assembly (clang, -O0):
<lonlat_from_ijh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <eval_rpc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lonlat_from_ijh>:
jmp    1030 <eval_rpc@plt>

LLVM IR (-O0):
%struct.rpc = type { i32 }
define void @lonlat_from_ijh(double* %0, %struct.rpc* %1, double %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca %struct.rpc*
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %6
store %struct.rpc* %1, %struct.rpc** %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double*, double** %6
%12 = load %struct.rpc*, %struct.rpc** %7
%13 = load double, double* %8
%14 = load double, double* %9
%15 = load double, double* %10
%16 = call i32 @eval_rpc(double* %11, %struct.rpc* %12, double %13, double %14, double %15)
ret void
}

LLVM IR (-O2):
%struct.rpc = type { i32 }
define void @lonlat_from_ijh(double* %0, %struct.rpc* %1, double %2, double %3, double %4) {
%6 = tail call i32 @eval_rpc(double* %0, %struct.rpc* %1, double %2, double %3, double %4)
ret void
}
int StandardKeyCompare(key, line)
char *key;
char *line;
{
  int cmpResult, fieldLen;
  char saveChar;
  fieldLen = strcspn(line, " \t\r\n\v\f");
  saveChar = line[fieldLen];
  line[fieldLen] = 0;
  cmpResult = strcmp(key, line);
  line[fieldLen] = saveChar;
  return cmpResult;
}


x86 assembly (clang, -O0):
<StandardKeyCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcspn@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x19(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StandardKeyCompare>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcspn@plt>
movslq %eax,%r15
mov    (%rbx,%r15,1),%bpl
movb   $0x0,(%rbx,%r15,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %bpl,(%rbx,%r15,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c" \09\0D\0A\0B\0C\00"
define i32 @StandardKeyCompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = call i64 @strcspn(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
store i8 %15, i8* %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %3
%21 = load i8*, i8** %4
%22 = call i32 @strcmp(i8* %20, i8* %21)
store i32 %22, i32* %5
%23 = load i8, i8* %7
%24 = load i8*, i8** %4
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 %23, i8* %27
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
@.str = [7 x i8] c" \09\0D\0A\0B\0C\00"
define i32 @StandardKeyCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcspn(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
store i8 0, i8* %6
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
store i8 %7, i8* %6
ret i32 %8
}