xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ GPS_Math_LatLonH_To_XYZ(double, double, double, double *,
                                           double *, double *, double, double);
void GPS_Math_WGS84LatLonH_To_XYZ(double phi, double lambda, double H,
                                  double *x, double *y, double *z) {
  double a = 6378137.000;
  double b = 6356752.3141;
  GPS_Math_LatLonH_To_XYZ(phi, lambda, H, x, y, z, a, b);
  return;
}


x86 assembly (clang, -O0):
<GPS_Math_WGS84LatLonH_To_XYZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
movsd  -0x38(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
call   1030 <GPS_Math_LatLonH_To_XYZ@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPS_Math_WGS84LatLonH_To_XYZ>:
movsd  0xee8(%rip),%xmm3
movsd  0xee8(%rip),%xmm4
jmp    1030 <GPS_Math_LatLonH_To_XYZ@plt>

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

LLVM IR (-O2):
define void @GPS_Math_WGS84LatLonH_To_XYZ(double %0, double %1, double %2, double* %3, double* %4, double* %5) {
%7 = tail call i32 @GPS_Math_LatLonH_To_XYZ(double %0, double %1, double %2, double* %3, double* %4, double* %5, double 0x415854A640000000, double 0x41583FC4141A36E3)
ret void
}
/* Variables and functions */
char *stimestamp(char *);
char *scurrent_timestamp() { return stimestamp(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @scurrent_timestamp() {
%1 = call i8* @stimestamp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @scurrent_timestamp() {
%1 = tail call i8* @stimestamp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
float degrees(float x) { return x * (180.0 / 3.1415926535897932); }


x86 assembly (clang, -O0):
<degrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degrees>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @degrees(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x404CA5DC1A63C1F8
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @degrees(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x404CA5DC1A63C1F8
%4 = fptrunc double %3 to float
ret float %4
}
int signbitf(x)
float x;
{
  union {
    float f;
    short s[4];
    int i;
  } u;
  u.f = x;
  if (sizeof(int) == 4) {
    return (u.i < 0);
  } else {
    return (u.s[0] < 0);
  }
}


x86 assembly (clang, -O0):
<signbitf>:
push   %rbp
mov    %rsp,%rbp
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signbitf>:
movmskpd %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
%union.anon = type { float, [4 x i8] }
define i32 @signbitf(double %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = fptrunc double %0 to float
store float %4, float* %2
%5 = load float, float* %2
%6 = bitcast %union.anon* %3 to float*
store float %5, float* %6
%7 = bitcast %union.anon* %3 to i32*
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @signbitf(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *__BASENAME__(const char *_str_) {
  const char *_s_ = strrchr(_str_, '/');
  return (_s_ ? _s_ : _str_ - 1) + 1;
}


x86 assembly (clang, -O0):
<__BASENAME__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <__BASENAME__+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <__BASENAME__+0x42>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__BASENAME__>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
cmove  %rbx,%rax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__BASENAME__(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
br label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 -1
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ %9, %8 ], [ %12, %10 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
ret i8* %15
}

LLVM IR (-O2):
define i8* @__BASENAME__(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %0, i64 -1
%5 = select i1 %3, i8* %4, i8* %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
ret i8* %6
}
void in_error(const char **pp_err, void *p_user) {
  *pp_err = "Example error message.";
}


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

x86 assembly (clang, -O2):
<in_error>:
lea    0xef9(%rip),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Example error message.\00"
define void @in_error(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
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %5
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Example error message.\00"
define void @in_error(i8** nocapture writeonly %0, i8* nocapture readnone %1) {
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %0
ret void
}
/* Variables and functions */
scalar_t__ ceil(int /*<<< orphan*/);
int /*<<< orphan*/ log10(double);
size_t netstring_buffer_size(size_t data_length) {
  if (data_length == 0)
    return 3;
  return (size_t)ceil(log10((double)data_length + 1)) + data_length + 2;
}


x86 assembly (clang, -O0):
<netstring_buffer_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <netstring_buffer_size+0x24>
movq   $0x3,-0x8(%rbp)
jmp    118f <netstring_buffer_size+0x6f>
movaps 0xec5(%rip),%xmm1
movq   -0x10(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xec4(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8d(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <log10@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
add    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netstring_buffer_size>:
test   %rdi,%rdi
je     1167 <netstring_buffer_size+0x47>
push   %rbx
mov    %rdi,%rbx
movq   %rdi,%xmm1
punpckldq 0xeca(%rip),%xmm1
subpd  0xed2(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  0xece(%rip),%xmm0
call   1040 <log10@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
add    %rbx,%rax
add    $0x2,%rax
pop    %rbx
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i64 @netstring_buffer_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 3, i64* %2
br label %16
7: ; preds = %1
%8 = load i64, i64* %3
%9 = uitofp i64 %8 to double
%10 = fadd double %9, 1.000000e+00
%11 = call i32 @log10(double %10)
%12 = call i64 @ceil(i32 %11)
%13 = load i64, i64* %3
%14 = add i64 %12, %13
%15 = add i64 %14, 2
store i64 %15, i64* %2
br label %16
16: ; preds = %7, %6
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
define i64 @netstring_buffer_size(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = uitofp i64 %0 to double
%5 = fadd double %4, 1.000000e+00
%6 = tail call i32 @log10(double %5)
%7 = tail call i64 @ceil(i32 %6)
%8 = add i64 %0, 2
%9 = add i64 %8, %7
br label %10
10: ; preds = %1, %3
%11 = phi i64 [ %9, %3 ], [ 3, %1 ]
ret i64 %11
}
/* Variables and functions */
int main(int argc, char **argv) {}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void g_propagate_error() {}


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

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

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

LLVM IR (-O2):
define void @g_propagate_error() {
ret void
}
void integrator_leapfrog_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @integrator_leapfrog_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int f1(int *one) {
  int tmp = *one;
  int rez = 0;
  printf("For the even smalles sence of existing of this function i have to "
         "make any operations inside it.\n");
  printf("And now f1 powers getted value %d. tmp = %d;\n", *one, tmp);
  rez = tmp * tmp;
  return rez;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    0xf18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%ebp
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%esi
lea    0xec3(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
imul   %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [98 x i8] c"For the even smalles sence of existing of this function i have to make any operations inside it.\0A\00"
@.str.1 = [46 x i8] c"And now f1 powers getted value %d. tmp = %d;\0A\00"
define i32 @f1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %3
store i32 0, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
@.str.1 = [46 x i8] c"And now f1 powers getted value %d. tmp = %d;\0A\00"
@str = [97 x i8] c"For the even smalles sence of existing of this function i have to make any operations inside it.\00"
define i32 @f1(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* %0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %2)
%6 = mul nsw i32 %2, %2
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SMUSDX(uint32_t x, uint32_t y) {
  return ((uint32_t)(((((int32_t)x << 16) >> 16) * (((int32_t)y) >> 16)) -
                     ((((int32_t)x) >> 16) * (((int32_t)y << 16) >> 16))));
}


x86 assembly (clang, -O0):
<__SMUSDX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rdx
shl    $0x10,%edx
sar    $0x10,%edx
imul   %edx,%ecx
sub    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SMUSDX>:
movswl %di,%eax
movswl %si,%ecx
mov    %esi,%edx
sar    $0x10,%edx
imul   %eax,%edx
sar    $0x10,%edi
imul   %edi,%ecx
sub    %ecx,%edx
movslq %edx,%rax
ret

LLVM IR (-O0):
define i64 @__SMUSDX(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 16
%8 = ashr i32 %7, 16
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
%11 = ashr i32 %10, 16
%12 = mul nsw i32 %8, %11
%13 = load i64, i64* %3
%14 = trunc i64 %13 to i32
%15 = ashr i32 %14, 16
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 16
%19 = ashr i32 %18, 16
%20 = mul nsw i32 %15, %19
%21 = sub nsw i32 %12, %20
%22 = sext i32 %21 to i64
ret i64 %22
}

LLVM IR (-O2):
define i64 @__SMUSDX(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 16
%5 = ashr exact i32 %4, 16
%6 = trunc i64 %1 to i32
%7 = ashr i32 %6, 16
%8 = mul nsw i32 %5, %7
%9 = ashr i32 %3, 16
%10 = shl i32 %6, 16
%11 = ashr exact i32 %10, 16
%12 = mul nsw i32 %11, %9
%13 = sub nsw i32 %8, %12
%14 = sext i32 %13 to i64
ret i64 %14
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int stat(char *, struct stat *);
isadir(char *f) {
  struct stat info;
  return (stat(f, &info) != -1 && S_ISDIR(info.st_mode));
}


x86 assembly (clang, -O0):
<isadir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x11(%rbp)
je     115b <isadir+0x3b>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isadir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1143 <isadir+0x23>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isadir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isadir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
int tls_error_to_orconn_end_reason(int e) {
  switch (e) {
  case -8:
    return 7;
  case -7:
    return 2;
  case -6:
    return 4;
  case -5:
    return 6;
  case -4:
    return 5;
  case -2:
  case -1:
  case -3:
  case 0:
    return 1;
  default:
    return 9;
  }
}


x86 assembly (clang, -O0):
<tls_error_to_orconn_end_reason>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x8,%eax
ja     1178 <tls_error_to_orconn_end_reason+0x78>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x7,-0x4(%rbp)
jmp    117f <tls_error_to_orconn_end_reason+0x7f>
movl   $0x2,-0x4(%rbp)
jmp    117f <tls_error_to_orconn_end_reason+0x7f>
movl   $0x4,-0x4(%rbp)
jmp    117f <tls_error_to_orconn_end_reason+0x7f>
movl   $0x6,-0x4(%rbp)
jmp    117f <tls_error_to_orconn_end_reason+0x7f>
movl   $0x5,-0x4(%rbp)
jmp    117f <tls_error_to_orconn_end_reason+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    117f <tls_error_to_orconn_end_reason+0x7f>
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tls_error_to_orconn_end_reason>:
add    $0x8,%edi
mov    $0x9,%eax
cmp    $0x8,%edi
ja     111a <tls_error_to_orconn_end_reason+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @tls_error_to_orconn_end_reason(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 -8, label %5
i32 -7, label %6
i32 -6, label %7
i32 -5, label %8
i32 -4, label %9
i32 -2, label %10
i32 -1, label %10
i32 -3, label %10
i32 0, label %10
]
5: ; preds = %1
store i32 7, i32* %2
br label %12
6: ; preds = %1
store i32 2, i32* %2
br label %12
7: ; preds = %1
store i32 4, i32* %2
br label %12
8: ; preds = %1
store i32 6, i32* %2
br label %12
9: ; preds = %1
store i32 5, i32* %2
br label %12
10: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 9, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.tls_error_to_orconn_end_reason = [9 x i32] [i32 7, i32 2, i32 4, i32 6, i32 5, i32 1, i32 1, i32 1, i32 1]
define i32 @tls_error_to_orconn_end_reason(i32 %0) {
%2 = add i32 %0, 8
%3 = icmp ult i32 %2, 9
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [9 x i32], [9 x i32]* @switch.table.tls_error_to_orconn_end_reason, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 9, %1 ]
ret i32 %9
}
void lcm_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @lcm_resume() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ARCH_GET_CPUID;
int arch_prctl(int /*<<< orphan*/, unsigned long *);
int main(void) {
  unsigned long setting;
  return arch_prctl(ARCH_GET_CPUID, &setting);
}


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

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

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

LLVM IR (-O2):
@ARCH_GET_CPUID = global i32 0
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i32, i32* @ARCH_GET_CPUID
%4 = call i32 @arch_prctl(i32 %3, i64* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *start_thread(void *arg) { pthread_exit(NULL); }


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

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

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

LLVM IR (-O2):
define noalias i8* @start_thread(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
void dummyaudio_VolumeDown(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dummyaudio_VolumeDown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
int DeleteFile(char *filename) {
  unlink(filename);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @DeleteFile(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR49_get(void) { return U_WMRCORENONE_get("U_WMR49"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR49\00"
define i32 @U_WMR49_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR49\00"
define i32 @U_WMR49_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int tegra2_statmon_start(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @tegra2_statmon_start() {
ret i32 0
}

LLVM IR (-O2):
define i32 @tegra2_statmon_start() {
ret i32 0
}
__attribute__((no, noclone)) unsigned __int128 t161_5sub(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, (unsigned __int128)(-1), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t161_5sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
sub    $0xffffffffffffffff,%rdx
sbb    $0xffffffffffffffff,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t161_5sub+0x48>
jmp    115f <t161_5sub+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t161_5sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
sub    $0xffffffffffffffff,%rbx
sbb    $0xffffffffffffffff,%r14
jae    112b <t161_5sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t161_5sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %11, i128 -1)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t161_5sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %6, i128 -1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *,
                                          int /*<<< orphan*/,
                                          struct wl_resource *);
void wl_data_device_send_data_offer(struct wl_resource *resource_,
                                    struct wl_resource *id) {
  wl_resource_post_event(resource_, 0, id);
}


x86 assembly (clang, -O0):
<wl_data_device_send_data_offer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <wl_resource_post_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_data_device_send_data_offer>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_data_device_send_data_offer(%struct.wl_resource* %0, %struct.wl_resource* %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca %struct.wl_resource*
store %struct.wl_resource* %0, %struct.wl_resource** %3
store %struct.wl_resource* %1, %struct.wl_resource** %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load %struct.wl_resource*, %struct.wl_resource** %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 0, %struct.wl_resource* %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_data_device_send_data_offer(%struct.wl_resource* %0, %struct.wl_resource* %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 0, %struct.wl_resource* %1)
ret void
}
void memDumpMainMem() {}


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

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

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

LLVM IR (-O2):
define void @memDumpMainMem() {
ret void
}
void delay(int count) {
  volatile int i = count;
  while (i--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1126 <delay+0x26>
jmp    110d <delay+0xd>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    %edi,-0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
subl   $0x1,-0x4(%rsp)
jae    1110 <delay+0x10>
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 %0, i32* %2
br label %4
4: ; preds = %4, %1
%5 = load volatile i32, i32* %2
%6 = add nsw i32 %5, -1
store volatile i32 %6, i32* %2
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %4
8: ; preds = %4
ret void
}
int remove_from_string(char *string, int start, int end) {
  int i;
  for (i = 0; string[end + i] != '\0'; i++) {
    string[start + i] = string[end + i];
  }
  return end - start;
}


x86 assembly (clang, -O0):
<remove_from_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115d <remove_from_string+0x5d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <remove_from_string+0x15>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_from_string>:
mov    %edx,%eax
movslq %edx,%r8
mov    (%rdi,%r8,1),%dl
test   %dl,%dl
je     1121 <remove_from_string+0x21>
movslq %esi,%rcx
mov    %dl,(%rdi,%rcx,1)
movzbl 0x1(%rdi,%r8,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1110 <remove_from_string+0x10>
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @remove_from_string(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %32, %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %10, %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %9, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %8
%19 = load i8*, i8** %4
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = add nsw i32 %20, %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %19, i64 %23
%25 = load i8, i8* %24
%26 = load i8*, i8** %4
%27 = load i32, i32* %5
%28 = load i32, i32* %7
%29 = add nsw i32 %27, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %26, i64 %30
store i8 %25, i8* %31
br label %32
32: ; preds = %18
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %8
35: ; preds = %8
%36 = load i32, i32* %6
%37 = load i32, i32* %5
%38 = sub nsw i32 %36, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @remove_from_string(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %20, label %8
8: ; preds = %3
%9 = sext i32 %1 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %15, %10 ]
%12 = phi i8 [ %6, %8 ], [ %18, %10 ]
%13 = add nsw i64 %11, %9
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 %12, i8* %14
%15 = add nuw nsw i64 %11, 1
%16 = add nsw i64 %15, %4
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %10
20: ; preds = %10, %3
%21 = sub nsw i32 %2, %1
ret i32 %21
}
int test_imm_77int8_mem(signed char *val) {
  return ((*val) & (0x77 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_77int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 119
%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_77int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 119
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_hashmap_new() {
  printf("NOT IMPLEMENTED:"
         "pa_hashmap_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_hashmap_new\0A\00"
define i32 @pa_hashmap_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_hashmap_new\00"
define i32 @pa_hashmap_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ isAlpha(int const);
scalar_t__ isDigit(int const);
int isAlnum(const int c) { return isAlpha(c) || isDigit(c); }


x86 assembly (clang, -O0):
<isAlnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isAlpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isAlnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isDigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <isAlpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isAlnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isDigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isAlnum(i32 %0) {
%2 = tail call i64 @isAlpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isDigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct sembuf {
  int sem_op;
  int sem_num;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void P(int semid, int semaphore) {
  struct sembuf psembuf;
  psembuf.sem_op = -1;
  psembuf.sem_flg = 0;
  psembuf.sem_num = semaphore;
  semop(semid, &psembuf, 1);
  return;
}


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
sub    $0x18,%rsp
movl   $0xffffffff,0x8(%rsp)
ff
movq   $0x0,0x10(%rsp)
mov    %esi,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define void @P(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 -1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i64 0, i64* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = call i32 @semop(i32 %10, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define void @P(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 -1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 %1, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
/* Variables and functions */
char **string_array_insert_lines(char **, int *, char **, int, int);
char **string_array_insert_line(char **array, int *linecount, char *ins,
                                int ins_pos) {
  return string_array_insert_lines(array, linecount, &ins, 1, ins_pos);
}


x86 assembly (clang, -O0):
<string_array_insert_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%r8d
lea    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <string_array_insert_lines@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_insert_line>:
push   %rax
mov    %ecx,%r8d
mov    %rdx,(%rsp)
mov    %rsp,%rdx
mov    $0x1,%ecx
call   1030 <string_array_insert_lines@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i8** @string_array_insert_line(i8** %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca i8*
store i8* %2, i8** %5
%6 = call i8** @string_array_insert_lines(i8** %0, i32* %1, i8** %5, i32 1, i32 %3)
ret i8** %6
}
float add(float a, float b) { return (a + b); }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @add(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @add(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
long cb_free(void *ptr) {
  free(ptr);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @cb_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printMonth(int const, int);
void printYear(int const year) {
  for (int i = 1; i <= 12; i++) {
    printMonth(year, i);
  }
}


x86 assembly (clang, -O0):
<printYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jg     1145 <printYear+0x35>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <printMonth@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printYear+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printYear>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0x4,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0x6,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0x7,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0x9,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0xa,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0xb,%esi
call   1030 <printMonth@plt>
mov    %ebx,%edi
mov    $0xc,%esi
pop    %rbx
jmp    1030 <printMonth@plt>

LLVM IR (-O0):
define void @printYear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 12
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printMonth(i32 %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @printYear(i32 %0) {
%2 = tail call i32 @printMonth(i32 %0, i32 1)
%3 = tail call i32 @printMonth(i32 %0, i32 2)
%4 = tail call i32 @printMonth(i32 %0, i32 3)
%5 = tail call i32 @printMonth(i32 %0, i32 4)
%6 = tail call i32 @printMonth(i32 %0, i32 5)
%7 = tail call i32 @printMonth(i32 %0, i32 6)
%8 = tail call i32 @printMonth(i32 %0, i32 7)
%9 = tail call i32 @printMonth(i32 %0, i32 8)
%10 = tail call i32 @printMonth(i32 %0, i32 9)
%11 = tail call i32 @printMonth(i32 %0, i32 10)
%12 = tail call i32 @printMonth(i32 %0, i32 11)
%13 = tail call i32 @printMonth(i32 %0, i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ seteuid(int /*<<< orphan*/);
void create() { seteuid(0); }


x86 assembly (clang, -O0):
<create>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <seteuid@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @create() {
%1 = call i32 @seteuid(i32 0)
ret void
}

LLVM IR (-O2):
define void @create() {
%1 = tail call i32 @seteuid(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dpiDebug__print(char *, char *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ sprintf(char *, char *, void *);
void dpiOci__freeMem(void *unused, void *ptr) {
  char message[40];
  (void)sprintf(message, "OCI freed ptr at %p", ptr);
  free(ptr);
  dpiDebug__print("%s\n", message);
}


x86 assembly (clang, -O0):
<dpiOci__freeMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    -0x40(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <dpiDebug__print@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpiOci__freeMem>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xeb6(%rip),%rdi
mov    %r14,%rsi
call   1040 <dpiDebug__print@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"OCI freed ptr at %p\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @dpiOci__freeMem(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [40 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%12 = call i32 @dpiDebug__print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"OCI freed ptr at %p\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @dpiOci__freeMem(i8* nocapture readnone %0, i8* %1) {
%3 = alloca [40 x i8]
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @free(i8* %1)
%7 = call i32 @dpiDebug__print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
char *btp_strndup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *btp_strdup(const char *s) { return btp_strndup(s, strlen(s)); }


x86 assembly (clang, -O0):
<btp_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <btp_strndup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btp_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <btp_strndup@plt>

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

LLVM IR (-O2):
define i8* @btp_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @btp_strndup(i8* %0, i32 %2)
ret i8* %3
}