xunge/DecIR huggingface dataset:
int test_imm_46uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x46 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_46uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 300647710720
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
long long strtol(char const *, char **, int);
long long strtoll(const char *nptr, char **endptr, int base) {
  return strtol(nptr, endptr, base);
}


x86 assembly (clang, -O0):
<strtoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoll>:
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i64 @strtoll(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtol(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
int FileString_GetExtension(char *str) {
  int dotPos = -1;
  char *strSrc = str;
  while (*strSrc) {
    if (*strSrc == '.')
      dotPos = (int)(strSrc - str);
    strSrc++;
  }
  return dotPos;
}


x86 assembly (clang, -O0):
<FileString_GetExtension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <FileString_GetExtension+0x53>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1142 <FileString_GetExtension+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <FileString_GetExtension+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileString_GetExtension>:
mov    $0xffffffff,%eax
xor    %ecx,%ecx
jmp    1116 <FileString_GetExtension+0x16>
nopl   0x0(%rax)
mov    %ecx,%eax
add    $0x1,%rcx
movzbl (%rdi,%rcx,1),%edx
cmp    $0x2e,%dl
je     1110 <FileString_GetExtension+0x10>
test   %dl,%dl
jne    1112 <FileString_GetExtension+0x12>
ret

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

LLVM IR (-O2):
define i32 @FileString_GetExtension(i8* %0) {
%2 = ptrtoint i8* %0 to i64
br label %3
3: ; preds = %11, %1
%4 = phi i32 [ -1, %1 ], [ %12, %11 ]
%5 = phi i8* [ %0, %1 ], [ %13, %11 ]
%6 = load i8, i8* %5
switch i8 %6, label %11 [
i8 0, label %14
i8 46, label %7
]
7: ; preds = %3
%8 = ptrtoint i8* %5 to i64
%9 = sub i64 %8, %2
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %10, %7 ], [ %4, %3 ]
%13 = getelementptr inbounds i8, i8* %5, i64 1
br label %3
14: ; preds = %3
ret i32 %4
}
void Interp2(unsigned char *pc, int c1, int c2, int c3) {
  c1 &= 0xfcfcfc;
  c2 &= 0xfcfcfc;
  c3 &= 0xfcfcfc;
  *((int *)pc) = (c1 * 2 + c2 + c3) >> 2;
}


x86 assembly (clang, -O0):
<Interp2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfcfcfc,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xfcfcfc,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
and    $0xfcfcfc,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
sar    $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp2>:
and    $0xfcfcfc,%edx
and    $0xfcfcfc,%ecx
and    $0xfcfcfc,%esi
lea    (%rdx,%rsi,2),%eax
add    %ecx,%eax
shr    $0x2,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @Interp2(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = and i32 %9, 16579836
store i32 %10, i32* %6
%11 = load i32, i32* %7
%12 = and i32 %11, 16579836
store i32 %12, i32* %7
%13 = load i32, i32* %8
%14 = and i32 %13, 16579836
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = mul nsw i32 %15, 2
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %8
%20 = add nsw i32 %18, %19
%21 = ashr i32 %20, 2
%22 = load i8*, i8** %5
%23 = bitcast i8* %22 to i32*
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @Interp2(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %2, 16579836
%6 = and i32 %3, 16579836
%7 = shl i32 %1, 1
%8 = and i32 %7, 33159672
%9 = add nuw nsw i32 %8, %5
%10 = add nuw nsw i32 %9, %6
%11 = lshr exact i32 %10, 2
%12 = bitcast i8* %0 to i32*
store i32 %11, i32* %12
ret void
}
/* Variables and functions */
scalar_t__ gpsisdigit(char const);
long gpsatol(const char *str) {
  long ret = 0;
  while (gpsisdigit(*str))
    ret = 10 * ret + *str++ - '0';
  return ret;
}


x86 assembly (clang, -O0):
<gpsatol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <gpsisdigit@plt>
cmp    $0x0,%rax
je     1162 <gpsatol+0x52>
imul   $0xa,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <gpsatol+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpsatol>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <gpsisdigit@plt>
test   %rax,%rax
je     1154 <gpsatol+0x44>
add    $0x1,%rbx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    (%r14,%r14,4),%rax
movsbq -0x1(%rbx),%rcx
lea    (%rcx,%rax,2),%r14
add    $0xffffffffffffffd0,%r14
movsbl (%rbx),%edi
call   1030 <gpsisdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <gpsatol+0x20>
jmp    1157 <gpsatol+0x47>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @gpsatol(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = call i64 @gpsisdigit(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i64, i64* %3
%11 = mul nsw i64 10, %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = sext i8 %14 to i64
%16 = add nsw i64 %11, %15
%17 = sub nsw i64 %16, 48
store i64 %17, i64* %3
br label %4
18: ; preds = %4
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @gpsatol(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @gpsisdigit(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %13, %5 ], [ 0, %1 ]
%7 = phi i8* [ %9, %5 ], [ %0, %1 ]
%8 = mul nsw i64 %6, 10
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i64
%12 = add i64 %8, -48
%13 = add i64 %12, %11
%14 = load i8, i8* %9
%15 = tail call i64 @gpsisdigit(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i64 [ 0, %1 ], [ %13, %5 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M34_f(char *s) {
  debug("M34_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M34_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M34_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M34_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M34_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M34_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M34_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ writes(char *);
void trm_xstr(char *str) { writes(str); }


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

x86 assembly (clang, -O2):
<trm_xstr>:
jmp    1030 <writes@plt>

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

LLVM IR (-O2):
define void @trm_xstr(i8* %0) {
%2 = tail call i32 @writes(i8* %0)
ret void
}
/* Variables and functions */
int Section3Hours(int *);
int Section3Minutes(int *);
int Section3Seconds(int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int Section3(int seconds) {
  printf("\n3.- %d hours, %d minutes and %d seconds", Section3Hours(&seconds),
         Section3Minutes(&seconds), Section3Seconds(&seconds));
  return 0;
}


x86 assembly (clang, -O0):
<Section3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <Section3Hours@plt>
mov    %eax,-0xc(%rbp)
lea    -0x4(%rbp),%rdi
call   1060 <Section3Minutes@plt>
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
call   1050 <Section3Seconds@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    %eax,%ecx
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section3>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <Section3Hours@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1060 <Section3Minutes@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <Section3Seconds@plt>
lea    0xe8b(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\0A3.- %d hours, %d minutes and %d seconds\00"
define i32 @Section3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Section3Hours(i32* %2)
%4 = call i32 @Section3Minutes(i32* %2)
%5 = call i32 @Section3Seconds(i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"\0A3.- %d hours, %d minutes and %d seconds\00"
define i32 @Section3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Section3Hours(i32* %2)
%4 = call i32 @Section3Minutes(i32* %2)
%5 = call i32 @Section3Seconds(i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret i32 0
}
double ppei(x, y, p)
double x, y;
double *p;
{ return (x + (p[1] * fpei(x, y, p))); }


x86 assembly (clang, -O0):
<ppei>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rdi
mov    $0x2,%al
call   1030 <fpei@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppei>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rdi),%xmm2
movsd  %xmm2,0x10(%rsp)
mov    $0x2,%al
call   1030 <fpei@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ppei(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = load double*, double** %6
%9 = getelementptr inbounds double, double* %8, i64 1
%10 = load double, double* %9
%11 = load double, double* %4
%12 = load double, double* %5
%13 = load double*, double** %6
%14 = call i32 (double, double, double*, ...) bitcast (i32 (...)* @fpei to i32 (double, double, double*, ...)*)(double %11, double %12, double* %13)
%15 = sitofp i32 %14 to double
%16 = call double @llvm.fmuladd.f64(double %10, double %15, double %7)
ret double %16
}

LLVM IR (-O2):
define double @ppei(double %0, double %1, double* %2) {
%4 = getelementptr inbounds double, double* %2, i64 1
%5 = load double, double* %4
%6 = tail call i32 (double, double, double*, ...) bitcast (i32 (...)* @fpei to i32 (double, double, double*, ...)*)(double %0, double %1, double* %2)
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %0)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char *);
void usage(unsigned char *name) {
  printf("Usage: %s [-hd] [-p <pidfile>] [-c <config dir>]\n"
         "  -h : print this help\n"
         "  -v : print version\n"
         "  -d : detach (run as daemon)\n"
         "  -r : automatically restart hub if it shuts down\n"
         "  -p : specify pidfile\n"
         "  -c : specify config directory\n",
         name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [229 x i8] c"Usage: %s [-hd] [-p <pidfile>] [-c <config dir>]\0A -h : print this help\0A -v : print version\0A -d : detach (run as daemon)\0A -r : automatically restart hub if it shuts down\0A -p : specify pidfile\0A -c : specify config directory\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [229 x i8] c"Usage: %s [-hd] [-p <pidfile>] [-c <config dir>]\0A -h : print this help\0A -v : print version\0A -d : detach (run as daemon)\0A -r : automatically restart hub if it shuts down\0A -p : specify pidfile\0A -c : specify config directory\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
long bar();
int foo(void) {
  long int b = bar();
  if ((unsigned long)b < -4095L)
    return b;
  if (-b != 38)
    b = -2;
  return b + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xfffffffffffff001,-0x10(%rbp)
ff
jae    113d <foo+0x2d>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1160 <foo+0x50>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
cmp    $0x26,%rax
je     1155 <foo+0x45>
movq   $0xfffffffffffffffe,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
cmp    $0xffffffffffffffda,%rax
mov    $0xffffffdb,%ecx
mov    $0xffffffff,%edx
cmove  %ecx,%edx
cmp    $0xfffffffffffff001,%rax
cmovae %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 (...) @bar()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp ult i64 %4, -4095
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
store i32 %8, i32* %1
br label %18
9: ; preds = %0
%10 = load i64, i64* %2
%11 = sub nsw i64 0, %10
%12 = icmp ne i64 %11, 38
br i1 %12, label %13, label %14
13: ; preds = %9
store i64 -2, i64* %2
br label %14
14: ; preds = %13, %9
%15 = load i64, i64* %2
%16 = add nsw i64 %15, 1
%17 = trunc i64 %16 to i32
store i32 %17, i32* %1
br label %18
18: ; preds = %14, %6
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i64 (...) @bar()
%2 = icmp ult i64 %1, -4095
%3 = trunc i64 %1 to i32
%4 = icmp eq i64 %1, -38
%5 = select i1 %4, i32 -37, i32 -1
%6 = select i1 %2, i32 %3, i32 %5
ret i32 %6
}
/* Variables and functions */
int f329(int *);
int f330(int *p) { return f329(p); }


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

x86 assembly (clang, -O2):
<f330>:
jmp    1030 <f329@plt>

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

LLVM IR (-O2):
define i32 @f330(i32* %0) {
%2 = tail call i32 @f329(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char const *, char const *);
int tiny_hash_string_tester_caseless(const void *s1, const void *s2) {
  return !strcasecmp((const char *)s1, (const char *)s2);
}


x86 assembly (clang, -O0):
<tiny_hash_string_tester_caseless>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tiny_hash_string_tester_caseless(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 = call i32 @strcasecmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @tiny_hash_string_tester_caseless(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ C(int *);
void B(int *p) { C(p); }


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

x86 assembly (clang, -O2):
<B>:
jmp    1030 <C@plt>

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

LLVM IR (-O2):
define void @B(i32* %0) {
%2 = tail call i32 @C(i32* %0)
ret void
}
unsigned addval_245(unsigned x) { return x + 3232028297U; }


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

x86 assembly (clang, -O2):
<addval_245>:
lea    -0x3f5b2977(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_245(i32 %0) {
%2 = add i32 %0, -1062938999
ret i32 %2
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t ret = 0;
  if (s)
    for (; s[ret]; ret++)
      ;
  return ret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114d <strlen+0x4d>
jmp    1120 <strlen+0x20>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1148 <strlen+0x48>
jmp    1137 <strlen+0x37>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <strlen+0x20>
jmp    114d <strlen+0x4d>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
test   %rdi,%rdi
je     111f <strlen+0x1f>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %4, %3 ]
ret i64 %10
}
void fn07A4() { return; }


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

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

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

LLVM IR (-O2):
define void @fn07A4() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
pid_t get_pid_max() { return 32768; }


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

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

LLVM IR (-O0):
define i32 @get_pid_max() {
ret i32 32768
}

LLVM IR (-O2):
define i32 @get_pid_max() {
ret i32 32768
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
pid_t gettid() { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @gettid() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @gettid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
int f(int b, int c) {
  int a = (short)b * (c >> 16);
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cwtl
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movswl %di,%eax
sar    $0x10,%esi
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(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 = trunc i32 %6 to i16
%8 = sext i16 %7 to i32
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = mul nsw i32 %8, %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = ashr i32 %1, 16
%6 = mul nsw i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
char *ctime(int *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int time(int /*<<< orphan*/ *);
int main(void) {
  time_t now;
  now = time(NULL);
  printf("It is now %d.\n", now);
  printf("It is really %s.\n", ctime(&now));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0x4(%rsp)
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xea2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"It is now %d.\0A\00"
@.str.1 = [18 x i8] c"It is really %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i8* @ctime(i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"It is now %d.\0A\00"
@.str.1 = [18 x i8] c"It is really %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i8* @ctime(i32* %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (...) @getchar()
ret i32 0
}
unsigned int GPMCPrefetchFifoPtrValGet(unsigned int baseAddr) {
  unsigned int fifoPtrVal;
  fifoPtrVal =
      (((*((volatile unsigned int *)(baseAddr + (0x1F0)))) & (0x7F000000u)) >>
       (0x00000018u));
  return (fifoPtrVal);
}


x86 assembly (clang, -O0):
<GPMCPrefetchFifoPtrValGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f0,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x7f000000,%eax
shr    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchFifoPtrValGet>:
add    $0x1f0,%edi
mov    (%rdi),%eax
shr    $0x18,%eax
and    $0x7f,%eax
ret

LLVM IR (-O0):
define i32 @GPMCPrefetchFifoPtrValGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 496
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 2130706432
%10 = lshr i32 %9, 24
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @GPMCPrefetchFifoPtrValGet(i32 %0) {
%2 = add i32 %0, 496
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = lshr i32 %5, 24
%7 = and i32 %6, 127
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ child_pids_kill_all_and_wait();
int /*<<< orphan*/ logging(char *, int);
int /*<<< orphan*/ set_restart(int);
void sh_restart(int signum, siginfo_t *siginfo, void *ucontext) {
  (void)siginfo;
  (void)ucontext;
  logging("signal restart handler called - signal received [%d]", signum);
  set_restart(1);
  child_pids_kill_all_and_wait();
}


x86 assembly (clang, -O0):
<sh_restart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1050 <logging@plt>
mov    $0x1,%edi
call   1040 <set_restart@plt>
mov    $0x0,%al
call   1030 <child_pids_kill_all_and_wait@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh_restart>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1050 <logging@plt>
mov    $0x1,%edi
call   1040 <set_restart@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <child_pids_kill_all_and_wait@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"signal restart handler called - signal received [%d]\00"
define void @sh_restart(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %5
%8 = load i8*, i8** %6
%9 = load i32, i32* %4
%10 = call i32 @logging(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @set_restart(i32 1)
%12 = call i32 (...) @child_pids_kill_all_and_wait()
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"signal restart handler called - signal received [%d]\00"
define void @sh_restart(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @logging(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @set_restart(i32 1)
%6 = tail call i32 (...) @child_pids_kill_all_and_wait()
ret void
}
float AngleDiff(float ang1, float ang2) {
  float diff;
  diff = ang1 - ang2;
  if (ang1 > ang2) {
    if (diff > 180.0) {
      diff -= 360.0;
    }
  } else {
    if (diff < -180.0) {
      diff += 360.0;
    }
  }
  return diff;
}


x86 assembly (clang, -O0):
<AngleDiff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    116a <AngleDiff+0x6a>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1165 <AngleDiff+0x65>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11a8 <AngleDiff+0xa8>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe85(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a3 <AngleDiff+0xa3>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe72(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11a8 <AngleDiff+0xa8>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleDiff>:
ucomiss %xmm1,%xmm0
subss  %xmm1,%xmm0
jbe    111b <AngleDiff+0x1b>
ucomiss 0xef8(%rip),%xmm0
jbe    1130 <AngleDiff+0x30>
addss  0xef2(%rip),%xmm0
ret
movss  0xedd(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1130 <AngleDiff+0x30>
addss  0xed4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @AngleDiff(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
store float %8, float* %5
%9 = load float, float* %3
%10 = load float, float* %4
%11 = fcmp ogt float %9, %10
br i1 %11, label %12, label %22
12: ; preds = %2
%13 = load float, float* %5
%14 = fpext float %13 to double
%15 = fcmp ogt double %14, 1.800000e+02
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load float, float* %5
%18 = fpext float %17 to double
%19 = fsub double %18, 3.600000e+02
%20 = fptrunc double %19 to float
store float %20, float* %5
br label %21
21: ; preds = %16, %12
br label %32
22: ; preds = %2
%23 = load float, float* %5
%24 = fpext float %23 to double
%25 = fcmp olt double %24, -1.800000e+02
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = load float, float* %5
%28 = fpext float %27 to double
%29 = fadd double %28, 3.600000e+02
%30 = fptrunc double %29 to float
store float %30, float* %5
br label %31
31: ; preds = %26, %22
br label %32
32: ; preds = %31, %21
%33 = load float, float* %5
ret float %33
}

LLVM IR (-O2):
define float @AngleDiff(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp ogt float %0, %1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = fcmp ogt float %3, 1.800000e+02
br i1 %6, label %7, label %13
7: ; preds = %5
%8 = fadd float %3, -3.600000e+02
br label %13
9: ; preds = %2
%10 = fcmp olt float %3, -1.800000e+02
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = fadd float %3, 3.600000e+02
br label %13
13: ; preds = %9, %11, %5, %7
%14 = phi float [ %8, %7 ], [ %3, %5 ], [ %12, %11 ], [ %3, %9 ]
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr_fd(char const *, int);
int /*<<< orphan*/ write(int, char *, int);
void ft_putendl_fd(char const *s, int fd) {
  ft_putstr_fd(s, fd);
  write(fd, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <ft_putstr_fd@plt>
mov    -0xc(%rbp),%edi
lea    0xebb(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
push   %rbx
mov    %esi,%ebx
call   1040 <ft_putstr_fd@plt>
lea    0xed1(%rip),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @ft_putstr_fd(i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @write(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = tail call i32 @ft_putstr_fd(i8* %0, i32 %1)
%4 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ slice(int *, int, int);
int /*<<< orphan*/ slice2(char *, int, int);
int main(void) {
  int myarray[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
  char charray[] = "Mary had a little lamb";
  slice(myarray, 3, 6);
  slice2(charray, 2, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
mov    0xed5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xed0(%rip),%eax
mov    %eax,-0x40(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0x3c(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x3a(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1030 <slice@plt>
lea    -0x50(%rbp),%rdi
mov    $0x2,%esi
mov    $0x7,%edx
call   1050 <slice2@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x626d616c20656c,%rax
mov    %rax,0xf(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1030 <slice@plt>
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x7,%edx
call   1040 <slice2@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.myarray = [10 x i32] [i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29]
@__const.main.charray = [23 x i8] c"Mary had a little lamb\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [23 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = bitcast [23 x i8]* %3 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @slice(i32* %6, i32 3, i32 6)
%8 = getelementptr inbounds [23 x i8], [23 x i8]* %3, i64 0, i64 0
%9 = call i32 @slice2(i8* %8, i32 2, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.myarray = [10 x i32] [i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29]
@__const.main.charray = [23 x i8] c"Mary had a little lamb\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [23 x i8]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @slice(i32* %5, i32 3, i32 6)
%7 = call i32 @slice2(i8* %4, i32 2, i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(int argc, const char *argv[]) {
  float number1 = 3.14;
  float number2 = 42.0;
  double number3 = number1 + number2;
  printf("%f\n", number3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x40091EB860000000, float* %6
store float 4.200000e+01, float* %7
%9 = load float, float* %6
%10 = load float, float* %7
%11 = fadd float %9, %10
%12 = fpext float %11 to double
store double %12, double* %8
%13 = load double, double* %8
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x404691EB80000000)
ret i32 0
}
int test_imm_32uint16_mem(unsigned short *val) {
  return ((*val) & (0x32 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_32uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 50
%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_32uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 50
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, char *, int);
void fun() {
  char str[50];
  syscall(3, 0, str, 10);
  puts(str);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdx
mov    $0x3,%edi
xor    %esi,%esi
mov    $0xa,%ecx
call   1040 <syscall@plt>
lea    -0x40(%rbp),%rdi
call   1030 <puts@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    $0x3,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
call   1040 <syscall@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fun() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @syscall(i32 3, i32 0, i8* %2, i32 10)
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
define void @fun() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @syscall(i32 3, i32 0, i8* %2, i32 10)
%4 = call i32 @puts(i8* %2)
ret void
}
int pathconN_nm2_f0(const double **arg, double **res, int *iw, double *w,
                    int mem) {
  return 0;
}


x86 assembly (clang, -O0):
<pathconN_nm2_f0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pathconN_nm2_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @pathconN_nm2_f0(double** nocapture readnone %0, double** nocapture readnone %1, i32* nocapture readnone %2, double* nocapture readnone %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
long double fmodl(long double, long double);
void __sulong_fp80_mod(long double *out, long double *x, long double *y) {
  *out = fmodl(*x, *y);
}


x86 assembly (clang, -O0):
<__sulong_fp80_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
fldt   (%rax)
mov    -0x18(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmodl@plt>
mov    -0x8(%rbp),%rax
fstpt  (%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_fp80_mod>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
fldt   (%rsi)
fldt   (%rdx)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <fmodl@plt>
fstpt  (%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @__sulong_fp80_mod(x86_fp80* %0, x86_fp80* %1, x86_fp80* %2) {
%4 = alloca x86_fp80*
%5 = alloca x86_fp80*
%6 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %4
store x86_fp80* %1, x86_fp80** %5
store x86_fp80* %2, x86_fp80** %6
%7 = load x86_fp80*, x86_fp80** %5
%8 = load x86_fp80, x86_fp80* %7
%9 = load x86_fp80*, x86_fp80** %6
%10 = load x86_fp80, x86_fp80* %9
%11 = call x86_fp80 @fmodl(x86_fp80 %8, x86_fp80 %10)
%12 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %11, x86_fp80* %12
ret void
}

LLVM IR (-O2):
define void @__sulong_fp80_mod(x86_fp80* nocapture writeonly %0, x86_fp80* nocapture %1, x86_fp80* nocapture %2) {
%4 = load x86_fp80, x86_fp80* %1
%5 = load x86_fp80, x86_fp80* %2
%6 = tail call x86_fp80 @fmodl(x86_fp80 %4, x86_fp80 %5)
store x86_fp80 %6, x86_fp80* %0
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_byteafunc2(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_byteafunc2() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_byteafunc2() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ eventfd_t;

/* Variables and functions */
int read(int, int /*<<< orphan*/ *, int);
int eventfd_read(int fd, eventfd_t *value) {
  return read(fd, value, sizeof(*value)) == sizeof(*value) ? 0 : -1;
}


x86 assembly (clang, -O0):
<eventfd_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
movslq %eax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x4,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eventfd_read>:
push   %rax
mov    $0x4,%edx
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eventfd_read(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 @read(i32 %5, i32* %6, i32 4)
%8 = sext i32 %7 to i64
%9 = icmp eq i64 %8, 4
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
ret i32 %11
}

LLVM IR (-O2):
define i32 @eventfd_read(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i32* %1, i32 4)
%4 = icmp ne i32 %3, 4
%5 = sext i1 %4 to i32
ret i32 %5
}
void hardware(void) {}


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

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

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

LLVM IR (-O2):
define void @hardware() {
ret void
}
/* Type definitions */
struct RNApdist_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int RNApdist_cmdline_parser_required(struct RNApdist_args_info *args_info,
                                     const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<RNApdist_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.RNApdist_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNApdist_cmdline_parser_required(%struct.RNApdist_args_info* %0, i8* %1) {
%3 = alloca %struct.RNApdist_args_info*
%4 = alloca i8*
store %struct.RNApdist_args_info* %0, %struct.RNApdist_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.RNApdist_args_info*, %struct.RNApdist_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.RNApdist_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNApdist_cmdline_parser_required(%struct.RNApdist_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}