xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_srl_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_srl_pi16(__m64 a, __m64 b) { return _mm_srl_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_srl_pi16>:
jmp    1030 <_mm_srl_pi16@plt>

LLVM IR (-O0):
define i32 @test_mm_srl_pi16(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 @_mm_srl_pi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_srl_pi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srl_pi16(i32 %0, i32 %1)
ret i32 %3
}
int IsValidContextFlags(unsigned char ucContextFlags) {
  ;
  return ((ucContextFlags & ~0xFE) == 0);
}


x86 assembly (clang, -O0):
<IsValidContextFlags>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xffffff01,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsValidContextFlags>:
not    %dil
and    $0x1,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @IsValidContextFlags(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -255
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @IsValidContextFlags(i8 zeroext %0) {
%2 = and i8 %0, 1
%3 = xor i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
double dot_c(double a1, double a2, double b1, double b2) {
  return a1 * b1 + b2 * a2;
}


x86 assembly (clang, -O0):
<dot_c>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_c>:
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot_c(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = load double, double* %8
%12 = load double, double* %6
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
ret double %14
}

LLVM IR (-O2):
define double @dot_c(double %0, double %1, double %2, double %3) {
%5 = fmul double %1, %3
%6 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %5)
ret double %6
}
void swapDoubleElements(double array[], int p1, int p2) {
  double tmp;
  tmp = array[p1];
  array[p1] = array[p2];
  array[p2] = tmp;
}


x86 assembly (clang, -O0):
<swapDoubleElements>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapDoubleElements>:
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm0
movslq %edx,%rcx
movsd  (%rdi,%rcx,8),%xmm1
movsd  %xmm1,(%rdi,%rax,8)
movsd  %xmm0,(%rdi,%rcx,8)
ret

LLVM IR (-O0):
define void @swapDoubleElements(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load double*, double** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %8, i64 %10
%12 = load double, double* %11
store double %12, double* %7
%13 = load double*, double** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %13, i64 %15
%17 = load double, double* %16
%18 = load double*, double** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
store double %17, double* %21
%22 = load double, double* %7
%23 = load double*, double** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
store double %22, double* %26
ret void
}

LLVM IR (-O2):
define void @swapDoubleElements(double* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
store double %9, double* %5
store double %6, double* %8
ret void
}
int cairo_code_draw_powerButton_get_width() { return 160; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_powerButton_get_width() {
ret i32 160
}

LLVM IR (-O2):
define i32 @cairo_code_draw_powerButton_get_width() {
ret i32 160
}
int handle_gez(int ret) {
  if (ret >= 0) {
    return 0;
  }
  if (ret == -1) {
    return -1;
  }
  return -2;
}


x86 assembly (clang, -O0):
<handle_gez>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111d <handle_gez+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113a <handle_gez+0x3a>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1133 <handle_gez+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <handle_gez+0x3a>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_gez>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
or     $0xfffffffe,%eax
sar    $0x1f,%edi
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @handle_gez(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = select i1 %2, i32 -1, i32 -2
%4 = icmp slt i32 %0, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
__attribute__((always_)) void outl(unsigned int value, unsigned short port) {
  asm volatile("out"
               "l"
               " %"
               "0,%"
               "w"
               "1"
               :
               : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outl(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
ret void
}
int int_len(int num) {
  int s = num < 0 ? 1 : 0;
  int len = 0;
  do {
    num = num / 10;
    len++;
  } while (num != 0);
  return s + len;
}


x86 assembly (clang, -O0):
<int_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1121 <int_len+0x21>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_len>:
mov    %edi,%eax
shr    $0x1f,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
add    $0x1,%eax
cmp    $0x12,%ecx
ja     1110 <int_len+0x10>
ret

LLVM IR (-O0):
define i32 @int_len(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
store i32 %8, i32* %3
store i32 0, i32* %4
br label %9
9: ; preds = %14, %1
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 10
store i32 %11, i32* %2
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
br label %14
14: ; preds = %9
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %9, label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @int_len(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = phi i32 [ 0, %1 ], [ %6, %2 ]
%5 = sdiv i32 %3, 10
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = lshr i32 %0, 31
%11 = add nuw nsw i32 %6, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr,
          "Usage: gpdifflabs [-diff1] [-op d/s] [-silent] [-v] [-l/-h]\n");
  fprintf(stderr, "                   [-f] groupname fsaname.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xef4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefe(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"Usage: gpdifflabs [-diff1] [-op d/s] [-silent] [-v] [-l/-h]\0A\00"
@.str.1 = [44 x i8] c" [-f] groupname fsaname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"Usage: gpdifflabs [-diff1] [-op d/s] [-silent] [-v] [-l/-h]\0A\00"
@.str.1 = [44 x i8] c" [-f] groupname fsaname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int do_499() { return 499; }


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

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

LLVM IR (-O0):
define i32 @do_499() {
ret i32 499
}

LLVM IR (-O2):
define i32 @do_499() {
ret i32 499
}
/* Variables and functions */
int pipe(int *);
int main(void) {
  int filedes[2];
  int status;
  status = pipe(filedes);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%5 = call i32 @pipe(i32* %4)
store i32 %5, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
ret i32 0
}
void XMaskEvent() {}


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

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

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

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

/* Variables and functions */
float __VERIFIER_nondet_float() {
  float initialValue;
  int byteOffset = 0;
  uint8_t *initialValueAsByte = (uint8_t *)&initialValue;
  for (; byteOffset < sizeof(float); ++byteOffset) {
    initialValueAsByte[byteOffset] = 0;
  }
  return initialValue;
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_float>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
jae    113f <__VERIFIER_nondet_float+0x3f>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1113 <__VERIFIER_nondet_float+0x13>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @__VERIFIER_nondet_float() {
%1 = alloca float
%2 = alloca i32
%3 = alloca i64*
store i32 0, i32* %2
%4 = bitcast float* %1 to i64*
store i64* %4, i64** %3
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 4
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i64*, i64** %3
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %10, i64 %12
store i64 0, i64* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %5
17: ; preds = %5
%18 = load float, float* %1
ret float %18
}

LLVM IR (-O2):
define float @__VERIFIER_nondet_float() {
ret float undef
}
/* Variables and functions */
scalar_t__ strstr(char const *, char const *);
char *dl_strstr(const char *a, const char *b) { return (char *)strstr(a, b); }


x86 assembly (clang, -O0):
<dl_strstr>:
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 <strstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl_strstr>:
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define i8* @dl_strstr(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 i64 @strstr(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @dl_strstr(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ s2pt(int, float *, float *, float *, int);
void s2pt1(float ix, float iy, float iz, int isymbol) {
  s2pt(1, &ix, &iy, &iz, isymbol);
}


x86 assembly (clang, -O0):
<s2pt1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    -0x10(%rbp),%r8d
mov    $0x1,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1030 <s2pt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2pt1>:
sub    $0x18,%rsp
mov    %edi,%r8d
movss  %xmm0,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm2,0xc(%rsp)
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    $0x1,%edi
call   1030 <s2pt@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @s2pt1(float %0, float %1, float %2, i32 %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = call i32 @s2pt(i32 1, float* %5, float* %6, float* %7, i32 %9)
ret void
}

LLVM IR (-O2):
define void @s2pt1(float %0, float %1, float %2, i32 %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = call i32 @s2pt(i32 1, float* %5, float* %6, float* %7, i32 %3)
ret void
}
void rop3_201_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | *D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_201_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_201_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%eax
or     %dl,%al
mov    %eax,%ecx
xor    %sil,%cl
and    %sil,%al
or     %dl,%cl
not    %cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_201_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_201_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = xor i8 %5, %1
%7 = and i8 %5, %1
%8 = or i8 %6, %2
%9 = xor i8 %8, -1
%10 = xor i8 %1, -1
%11 = and i8 %10, %2
%12 = and i8 %11, %4
%13 = or i8 %7, %12
%14 = or i8 %13, %9
store i8 %14, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseek(int /*<<< orphan*/ *, long, int);
int c_fseek(void *stream, long offset, int whence) {
  return fseek((FILE *)stream, offset, whence);
}


x86 assembly (clang, -O0):
<c_fseek>:
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 <fseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fseek>:
jmp    1030 <fseek@plt>

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

LLVM IR (-O2):
define i32 @c_fseek(i8* nocapture %0, i64 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fseek(i32* %4, i64 %1, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ hd44780_ll_instruction_write(int);
int8_t hd44780_display_on_off_control(uint8_t ctrlword) {
  uint8_t data = 0x08 | (ctrlword & 0x07);
  return (hd44780_ll_instruction_write(data));
}


x86 assembly (clang, -O0):
<hd44780_display_on_off_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
or     $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <hd44780_ll_instruction_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd44780_display_on_off_control>:
and    $0x7,%edi
or     $0x8,%edi
jmp    1030 <hd44780_ll_instruction_write@plt>

LLVM IR (-O0):
define i32 @hd44780_display_on_off_control(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 7
%6 = or i32 8, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @hd44780_ll_instruction_write(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @hd44780_display_on_off_control(i32 %0) {
%2 = and i32 %0, 7
%3 = or i32 %2, 8
%4 = tail call i32 @hd44780_ll_instruction_write(i32 %3)
ret i32 %4
}
/* Variables and functions */
int read(int, char *, int);
int __gnat_read_signalling_fd(int rsig) {
  char c;
  return read(rsig, &c, 1);
}


x86 assembly (clang, -O0):
<__gnat_read_signalling_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gnat_read_signalling_fd>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__gnat_read_signalling_fd(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
ret i32 %3
}
/* Variables and functions */
long strtol(char const *, char **, int);
long atol(const char *s) { return (strtol(s, (char **)0, 10)); }


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

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
ret i64 %2
}
/* Variables and functions */
char *is_another_param(char **argv) {
  return (*(argv + 1) && *(argv + 1)[0] != '-') ? *(argv + 1) : NULL;
}


x86 assembly (clang, -O0):
<is_another_param>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     113c <is_another_param+0x3c>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     113c <is_another_param+0x3c>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <is_another_param+0x47>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1147 <is_another_param+0x47>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_another_param>:
mov    0x8(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1112 <is_another_param+0x12>
cmpb   $0x2d,(%rcx)
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @is_another_param(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 45
%8 = select i1 %7, i8* null, i8* %3
br label %9
9: ; preds = %5, %1
%10 = phi i8* [ null, %1 ], [ %8, %5 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *f;
  f = fopen("test.dat", "w");
  fprintf(f, "Hello world\n");
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
int f(int n) {
  int s = 0;
  while (n--)
    s += 1 + f(n);
  return s;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     114c <f+0x3c>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
add    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <f+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1135 <f+0x25>
mov    %edi,%ebx
add    $0xffffffff,%ebx
xor    %r14d,%r14d
mov    %ebx,%edi
call   1030 <f@plt>
add    %eax,%r14d
add    $0x1,%r14d
add    $0xffffffff,%ebx
jb     1120 <f+0x10>
jmp    1138 <f+0x28>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @f(i32 %6)
%8 = add i32 %5, 1
%9 = add i32 %8, %7
%10 = icmp eq i32 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %12
}
/* Variables and functions */
double log(double);
double tor_mathlog(double d) { return log(d); }


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

x86 assembly (clang, -O2):
<tor_mathlog>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @tor_mathlog(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
const char *machine_format_memory(struct sysinfo *si) {
  (void)si;
  return "abc??";
}


x86 assembly (clang, -O0):
<machine_format_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sysinfo = type opaque
@.str = [6 x i8] c"abc??\00"
define i8* @machine_format_memory(%struct.sysinfo* %0) {
%2 = alloca %struct.sysinfo*
store %struct.sysinfo* %0, %struct.sysinfo** %2
%3 = load %struct.sysinfo*, %struct.sysinfo** %2
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.sysinfo = type opaque
@.str = [6 x i8] c"abc??\00"
define i8* @machine_format_memory(%struct.sysinfo* nocapture readnone %0) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int test_imm_7Fuint32_mem(unsigned int *val) {
  return ((*val) & (0x7F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Fuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 127
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, unsigned long, unsigned long);
int shim_pkey_alloc(unsigned long flags, unsigned long access_rights) {
  return (int)shim_enosys(0, flags, access_rights);
}


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

x86 assembly (clang, -O2):
<shim_pkey_alloc>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_pkey_alloc(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 = load i64, i64* %4
%7 = call i64 @shim_enosys(i32 0, i64 %5, i64 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @shim_pkey_alloc(i64 %0, i64 %1) {
%3 = tail call i64 @shim_enosys(i32 0, i64 %0, i64 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int getchar();
int my_getchar() { return getchar(); }


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

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

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

LLVM IR (-O2):
define i32 @my_getchar() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
/* Type definitions */
struct imap4_message {
  int dummy;
};

/* Variables and functions */
unsigned long _storage_message_count();
struct imap4_message *_storage_message_number(unsigned long);
struct imap4_message *valid_message(unsigned long int index) {
  struct imap4_message *message;
  if (index < 1 || index > _storage_message_count()) {
    return NULL;
  }
  message = _storage_message_number(index);
  return message;
}


x86 assembly (clang, -O0):
<valid_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jb     1156 <valid_message+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <_storage_message_count@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jbe    1163 <valid_message+0x43>
movq   $0x0,-0x8(%rbp)
jmp    1178 <valid_message+0x58>
mov    -0x10(%rbp),%rdi
call   1040 <_storage_message_number@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_message>:
push   %rbx
test   %rdi,%rdi
je     1135 <valid_message+0x15>
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <_storage_message_count@plt>
cmp    %rbx,%rax
jae    1139 <valid_message+0x19>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <_storage_message_number@plt>

LLVM IR (-O0):
%struct.imap4_message = type { i32 }
define %struct.imap4_message* @valid_message(i64 %0) {
%2 = alloca %struct.imap4_message*
%3 = alloca i64
%4 = alloca %struct.imap4_message*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 1
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i64 (...) @_storage_message_count()
%10 = icmp ugt i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store %struct.imap4_message* null, %struct.imap4_message** %2
br label %16
12: ; preds = %7
%13 = load i64, i64* %3
%14 = call %struct.imap4_message* @_storage_message_number(i64 %13)
store %struct.imap4_message* %14, %struct.imap4_message** %4
%15 = load %struct.imap4_message*, %struct.imap4_message** %4
store %struct.imap4_message* %15, %struct.imap4_message** %2
br label %16
16: ; preds = %12, %11
%17 = load %struct.imap4_message*, %struct.imap4_message** %2
ret %struct.imap4_message* %17
}

LLVM IR (-O2):
%struct.imap4_message = type { i32 }
define %struct.imap4_message* @valid_message(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 (...) @_storage_message_count()
%5 = icmp ult i64 %4, %0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call %struct.imap4_message* @_storage_message_number(i64 %0)
br label %8
8: ; preds = %1, %3, %6
%9 = phi %struct.imap4_message* [ %7, %6 ], [ null, %3 ], [ null, %1 ]
ret %struct.imap4_message* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int WCONTINUED;
int WNOHANG;
int WUNTRACED;
scalar_t__ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int nothing_to_report(pid_t pid) {
  return (waitpid(pid, NULL, WCONTINUED | WUNTRACED | WNOHANG) == 0);
}


x86 assembly (clang, -O0):
<nothing_to_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
mov    0x2eaa(%rip),%rax
or     (%rax),%edx
mov    0x2eb1(%rip),%rax
or     (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nothing_to_report>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2ebe(%rip),%rax
or     (%rax),%edx
xor    %esi,%esi
call   1030 <waitpid@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@WCONTINUED = global i32 0
@WUNTRACED = global i32 0
@WNOHANG = global i32 0
define i32 @nothing_to_report(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @WCONTINUED
%5 = load i32, i32* @WUNTRACED
%6 = or i32 %4, %5
%7 = load i32, i32* @WNOHANG
%8 = or i32 %6, %7
%9 = call i64 @waitpid(i32 %3, i32* null, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@WCONTINUED = global i32 0
@WUNTRACED = global i32 0
@WNOHANG = global i32 0
define i32 @nothing_to_report(i32 %0) {
%2 = load i32, i32* @WCONTINUED
%3 = load i32, i32* @WUNTRACED
%4 = or i32 %3, %2
%5 = load i32, i32* @WNOHANG
%6 = or i32 %4, %5
%7 = tail call i64 @waitpid(i32 %0, i32* null, i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
size_t bitcount(size_t num) {
  size_t c;
  for (c = 0; num; ++c)
    num >>= 1;
  return c;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <bitcount+0x38>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <bitcount+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %rdi,%rdi
je     1120 <bitcount+0x20>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%rax
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <bitcount+0x10>
ret

LLVM IR (-O0):
define i64 @bitcount(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i64, i64* %2
%9 = lshr i64 %8, 1
store i64 %9, i64* %2
br label %10
10: ; preds = %7
%11 = load i64, i64* %3
%12 = add i64 %11, 1
store i64 %12, i64* %3
br label %4
13: ; preds = %4
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @bitcount(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i64 %4, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void POMDP_SOLVE_OPTS_showUsageBrief(FILE *file, char *exec_name) {
  fprintf(file, "Usage: %s [opts...] [args...]\n", exec_name);
  fprintf(file, "Use '-h' for help.\n");
}


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

x86 assembly (clang, -O2):
<POMDP_SOLVE_OPTS_showUsageBrief>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xee3(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: %s [opts...] [args...]\0A\00"
@.str.1 = [20 x i8] c"Use '-h' for help.\0A\00"
define void @POMDP_SOLVE_OPTS_showUsageBrief(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Usage: %s [opts...] [args...]\0A\00"
@.str.1 = [20 x i8] c"Use '-h' for help.\0A\00"
define void @POMDP_SOLVE_OPTS_showUsageBrief(i32* nocapture %0, i8* %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 19, i64 1, i32* %0)
ret void
}
int max3(int a, int b, int c) {
  if (a >= b)
    ;
  else
    a = b;
  if (a >= c)
    ;
  else
    a = c;
  return a;
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     111e <max3+0x1e>
jmp    1124 <max3+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1135 <max3+0x35>
jmp    113b <max3+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %3
br label %13
11: ; preds = %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %13
13: ; preds = %11, %10
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
br label %20
18: ; preds = %13
%19 = load i32, i32* %6
store i32 %19, i32* %4
br label %20
20: ; preds = %18, %17
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
int __child_right(const int idx) { return idx * 2 + 2; }


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

x86 assembly (clang, -O2):
<__child_right>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @__child_right(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x68() {
  Assert_real((isbdigit(104) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              525, ("isbdigit should be 0 for h"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x68>:
push   %rax
mov    $0x68,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x20d,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for h\00"
define void @t_isbdigit_0x68() {
%1 = tail call i64 @isbdigit(i32 104)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 525, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int iso_libjte_forward_msgs(void *libjte_handle, int imgid, int errcode,
                            int flag) {
  return 1;
}


x86 assembly (clang, -O0):
<iso_libjte_forward_msgs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iso_libjte_forward_msgs(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
ret i32 1
}

LLVM IR (-O2):
define i32 @iso_libjte_forward_msgs(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i32 1
}
void f() {
  void *addr;
  addr = (void *)(((long int)addr + 7L));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = ptrtoint i8* %2 to i64
%4 = add nsw i64 %3, 7
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
double tan(double);
double _tan(double x) { return tan(x); }


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

x86 assembly (clang, -O2):
<_tan>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define double @_tan(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}