xunge/DecIR huggingface dataset:
/* Type definitions */
struct Cosmos {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Cosmos *);
void CosmosDestroy(struct Cosmos *this) { free(this); }


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

x86 assembly (clang, -O2):
<CosmosDestroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Cosmos = type { i32 }
define void @CosmosDestroy(%struct.Cosmos* %0) {
%2 = alloca %struct.Cosmos*
store %struct.Cosmos* %0, %struct.Cosmos** %2
%3 = load %struct.Cosmos*, %struct.Cosmos** %2
%4 = call i32 @free(%struct.Cosmos* %3)
ret void
}

LLVM IR (-O2):
%struct.Cosmos = type { i32 }
define void @CosmosDestroy(%struct.Cosmos* nocapture %0) {
%2 = tail call i32 @free(%struct.Cosmos* %0)
ret void
}
int _shr2(int src1, unsigned int src2) {
  short s1[2], result[2];
  *((int *)s1) = src1;
  src2 = src2 & 31;
  result[0] = (int)s1[0] >> src2;
  result[1] = (int)s1[1] >> src2;
  return *(int *)result;
}


x86 assembly (clang, -O0):
<_shr2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x8(%rbp)
movswl -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %ax,-0x10(%rbp)
movswl -0xa(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %ax,-0xe(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_shr2>:
mov    %esi,%ecx
movswl %di,%eax
sar    %cl,%eax
sar    $0x10,%edi
sar    %cl,%edi
shl    $0x10,%edi
movzwl %ax,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_shr2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i16]
%6 = alloca [2 x i16]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%9 = bitcast i16* %8 to i32*
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 31
store i32 %11, i32* %4
%12 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%13 = load i16, i16* %12
%14 = sext i16 %13 to i32
%15 = load i32, i32* %4
%16 = ashr i32 %14, %15
%17 = trunc i32 %16 to i16
%18 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
store i16 %17, i16* %18
%19 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 1
%20 = load i16, i16* %19
%21 = sext i16 %20 to i32
%22 = load i32, i32* %4
%23 = ashr i32 %21, %22
%24 = trunc i32 %23 to i16
%25 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 1
store i16 %24, i16* %25
%26 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%27 = bitcast i16* %26 to i32*
%28 = load i32, i32* %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @_shr2(i32 %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl i32 %0, 16
%5 = ashr exact i32 %4, 16
%6 = ashr i32 %5, %3
%7 = ashr i32 %0, 16
%8 = ashr i32 %7, %3
%9 = shl nsw i32 %8, 16
%10 = and i32 %6, 65535
%11 = or i32 %9, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_setregid;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int _setregid(uid_t rgid, uid_t egid) {
  return syscall(SYS_setregid, rgid, egid);
}


x86 assembly (clang, -O0):
<_setregid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_setregid>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_setregid = global i32 0
define i32 @_setregid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_setregid
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @syscall(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SYS_setregid = global i32 0
define i32 @_setregid(i32 %0, i32 %1) {
%3 = load i32, i32* @SYS_setregid
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_type_of_mixture(int *r, int *mix) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(84, r, mix, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_type_of_mixture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x54,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_type_of_mixture>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x54,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @celcon_type_of_mixture(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = load double*, double** %6
%10 = call i32 @_ada_use_c2phc(i32 84, i32* %7, i32* %8, double* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @celcon_type_of_mixture(i32* %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc(i32 84, i32* %0, i32* %1, double* undef)
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
char *returnme(char *);
char *f(void) {
  char *s = (char *)malloc(sizeof(char));
  *s = 'a';
  if (3 > 4) {
    return s;
  } else {
    return returnme(s);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <returnme@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
movb   $0x61,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <returnme@plt>

LLVM IR (-O0):
define i8* @f() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 1)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
store i8 97, i8* %4
%5 = load i8*, i8** %1
%6 = call i8* @returnme(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @f() {
%1 = tail call i64 @malloc(i32 1)
%2 = inttoptr i64 %1 to i8*
store i8 97, i8* %2
%3 = tail call i8* @returnme(i8* %2)
ret i8* %3
}
float ft_invsqrt(float x) {
  int i;
  float xhalf;
  xhalf = 0.5f * x;
  i = *(int *)&x;
  i = 0x5f3759df - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  x = x * (1.5f - (xhalf * x * x));
  return (x);
}


x86 assembly (clang, -O0):
<ft_invsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe5e(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_invsqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
movaps %xmm0,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
movss  0xed8(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm3,%xmm0
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @ft_invsqrt(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %4
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463007, %10
store i32 %11, i32* %3
%12 = bitcast i32* %3 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %4
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
%23 = load float, float* %4
%24 = load float, float* %2
%25 = fmul float %23, %24
%26 = load float, float* %2
%27 = fneg float %25
%28 = call float @llvm.fmuladd.f32(float %27, float %26, float 1.500000e+00)
%29 = fmul float %22, %28
store float %29, float* %2
%30 = load float, float* %2
ret float %30
}

LLVM IR (-O2):
define float @ft_invsqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
%10 = fmul float %6, %9
%11 = tail call float @llvm.fmuladd.f32(float %10, float %9, float 1.500000e+00)
%12 = fmul float %9, %11
ret float %12
}
char CharToUpper(char inStr) {
  if (inStr < 'a' || inStr > 'z') {
    return inStr;
  }
  return inStr - 32;
}


x86 assembly (clang, -O0):
<CharToUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <CharToUpper+0x24>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jle    112f <CharToUpper+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1139 <CharToUpper+0x39>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharToUpper>:
lea    -0x7b(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0xe6,%al
movzbl %cl,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @CharToUpper(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 97
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 122
br i1 %10, label %11, label %13
11: ; preds = %7, %1
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %18
13: ; preds = %7
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 32
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %18
18: ; preds = %13, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @CharToUpper(i8 signext %0) {
%2 = add i8 %0, -123
%3 = icmp ult i8 %2, -26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printids(char *);
void *thr_fn(void *arg) {
  printids("new thread:");
  return ((void *)0);
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"new thread:\00"
define i8* @thr_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printids(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [12 x i8] c"new thread:\00"
define noalias i8* @thr_fn(i8* nocapture readnone %0) {
%2 = tail call i32 @printids(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
int g(void) { return 0x7ff00000; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 2146435072
}

LLVM IR (-O2):
define i32 @g() {
ret i32 2146435072
}
/* Variables and functions */
int /*<<< orphan*/ jet_sleep(int);
int write_block(int, int, int, int, int, int /*<<< orphan*/);
int dynamixelSetTurnSpeed(int servo, int direction, int speed) {
  int speed0 = speed & 255;
  int speed1 = speed >> 8;
  int ret = write_block(105, servo, direction, speed0, speed1, 0);
  jet_sleep(50);
  return ret;
}


x86 assembly (clang, -O0):
<dynamixelSetTurnSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x69,%edi
xor    %r9d,%r9d
call   1030 <write_block@plt>
mov    %eax,-0x18(%rbp)
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamixelSetTurnSpeed>:
push   %rbx
mov    %edx,%r8d
mov    %esi,%edx
mov    %edi,%esi
movzbl %r8b,%ecx
sar    $0x8,%r8d
mov    $0x69,%edi
xor    %r9d,%r9d
call   1030 <write_block@plt>
mov    %eax,%ebx
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dynamixelSetTurnSpeed(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
%11 = and i32 %10, 255
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = ashr i32 %12, 8
store i32 %13, i32* %8
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @write_block(i32 105, i32 %14, i32 %15, i32 %16, i32 %17, i32 0)
store i32 %18, i32* %9
%19 = call i32 @jet_sleep(i32 50)
%20 = load i32, i32* %9
ret i32 %20
}

LLVM IR (-O2):
define i32 @dynamixelSetTurnSpeed(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, 255
%5 = ashr i32 %2, 8
%6 = tail call i32 @write_block(i32 105, i32 %0, i32 %1, i32 %4, i32 %5, i32 0)
%7 = tail call i32 @jet_sleep(i32 50)
ret i32 %6
}
char *strcpy(char *dest, char const *src) {
  char *result = dest;
  while ((*dest++ = *src++))
    ;
  return result;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void av_hmac_final() {}


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

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

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

LLVM IR (-O2):
define void @av_hmac_final() {
ret void
}
/* Variables and functions */
void *contract_equal(void const *, void const *, char const *, char const *,
                     char const *, int, char const *, char *);
void *_contract_requires_equal(const void *a, const void *b, const char *a_s,
                               const char *b_s, const char *file, int line,
                               const char *func) {
  return contract_equal(a, b, a_s, b_s, file, line, func,
                        "%s:%d: %s: Requires `%s' == `%s' failed.\n");
}


x86 assembly (clang, -O0):
<_contract_requires_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    0x10(%rbp),%r10
lea    0xea9(%rip),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <contract_equal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_contract_requires_equal>:
push   %rax
lea    0xee8(%rip),%rax
push   %rax
push   0x18(%rsp)
call   1030 <contract_equal@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"%s:%d: %s: Requires `%s' == `%s' failed.\0A\00"
define i8* @_contract_requires_equal(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i8* %6, i8** %14
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = load i32, i32* %13
%21 = load i8*, i8** %14
%22 = call i8* @contract_equal(i8* %15, i8* %16, i8* %17, i8* %18, i8* %19, i32 %20, i8* %21, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i8* %22
}

LLVM IR (-O2):
@.str = [42 x i8] c"%s:%d: %s: Requires `%s' == `%s' failed.\0A\00"
define i8* @_contract_requires_equal(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5, i8* %6) {
%8 = tail call i8* @contract_equal(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5, i8* %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int do_state_45_49_57_60_64_70_72(char c, int *state, char *word, int *length) {
  if (c == '=') {
    word[(*length)++] = c;
    ++*state;
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<do_state_45_49_57_60_64_70_72>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x3d,%eax
jne    1154 <do_state_45_49_57_60_64_70_72+0x54>
mov    -0x5(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    115b <do_state_45_49_57_60_64_70_72+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_state_45_49_57_60_64_70_72>:
mov    $0x1,%eax
cmp    $0x3d,%dil
jne    111c <do_state_45_49_57_60_64_70_72+0x1c>
movslq (%rcx),%rax
lea    0x1(%rax),%edi
mov    %edi,(%rcx)
movb   $0x3d,(%rdx,%rax,1)
addl   $0x1,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @do_state_45_49_57_60_64_70_72(i8 signext %0, i32* nocapture %1, i8* nocapture writeonly %2, i32* nocapture %3) {
%5 = icmp eq i8 %0, 61
br i1 %5, label %6, label %13
6: ; preds = %4
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %2, i64 %9
store i8 61, i8* %10
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %13
13: ; preds = %4, %6
%14 = phi i32 [ 0, %6 ], [ 1, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fz_free_default(void *opaque, void *p) { free(p); }


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

x86 assembly (clang, -O2):
<fz_free_default>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @fz_free_default(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @fz_free_default(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exception_init();
int /*<<< orphan*/ gdt_init();
int /*<<< orphan*/ idt_init();
int /*<<< orphan*/ irq_init();
int /*<<< orphan*/ page_init();
int /*<<< orphan*/ syscall_init();
int /*<<< orphan*/ ts_init();
void arch_init() {
  page_init();
  gdt_init();
  idt_init();
  ts_init();
  exception_init();
  irq_init();
  syscall_init();
}


x86 assembly (clang, -O0):
<arch_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <page_init@plt>
mov    $0x0,%al
call   1090 <gdt_init@plt>
mov    $0x0,%al
call   1060 <idt_init@plt>
mov    $0x0,%al
call   1070 <ts_init@plt>
mov    $0x0,%al
call   1050 <exception_init@plt>
mov    $0x0,%al
call   1040 <irq_init@plt>
mov    $0x0,%al
call   1080 <syscall_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_init>:
push   %rax
xor    %eax,%eax
call   1030 <page_init@plt>
xor    %eax,%eax
call   1090 <gdt_init@plt>
xor    %eax,%eax
call   1060 <idt_init@plt>
xor    %eax,%eax
call   1070 <ts_init@plt>
xor    %eax,%eax
call   1050 <exception_init@plt>
xor    %eax,%eax
call   1040 <irq_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <syscall_init@plt>

LLVM IR (-O0):
define void @arch_init() {
%1 = call i32 (...) @page_init()
%2 = call i32 (...) @gdt_init()
%3 = call i32 (...) @idt_init()
%4 = call i32 (...) @ts_init()
%5 = call i32 (...) @exception_init()
%6 = call i32 (...) @irq_init()
%7 = call i32 (...) @syscall_init()
ret void
}

LLVM IR (-O2):
define void @arch_init() {
%1 = tail call i32 (...) @page_init()
%2 = tail call i32 (...) @gdt_init()
%3 = tail call i32 (...) @idt_init()
%4 = tail call i32 (...) @ts_init()
%5 = tail call i32 (...) @exception_init()
%6 = tail call i32 (...) @irq_init()
%7 = tail call i32 (...) @syscall_init()
ret void
}
/* Variables and functions */
unsigned int read(int, char *, unsigned int);
unsigned int tun_get_packet(int fd, char *buf, unsigned int bufsize) {
  return read(fd, buf, bufsize);
}


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

x86 assembly (clang, -O2):
<tun_get_packet>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @tun_get_packet(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
unsigned short _marshall_get16(const void *pBuf) {
  unsigned short i;
  ((char *)(&i))[0] = ((char *)(pBuf))[1],
         ((char *)(&i))[1] = ((char *)(pBuf))[0];
  return i;
}


x86 assembly (clang, -O0):
<_marshall_get16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_marshall_get16>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @_marshall_get16(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = bitcast i16* %3 to i8*
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = bitcast i16* %3 to i8*
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i16, i16* %3
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @_marshall_get16(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = load i8, i8* %0
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %3 to i16
%8 = or i16 %6, %7
ret i16 %8
}
double f7(double x) { return __builtin_tan(x); }


x86 assembly (clang, -O0):
<f7>:
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):
<f7>:
jmp    1030 <tan@plt>

LLVM IR (-O0):
define double @f7(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 @f7(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ acc_i2c_abort_data(unsigned char);
int /*<<< orphan*/ acc_i2c_reset_bus(unsigned char);
void acc_i2c_bus_recovery(unsigned char busnum) {
  acc_i2c_abort_data(busnum);
  acc_i2c_reset_bus(busnum);
}


x86 assembly (clang, -O0):
<acc_i2c_bus_recovery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <acc_i2c_abort_data@plt>
movzbl -0x1(%rbp),%edi
call   1030 <acc_i2c_reset_bus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acc_i2c_bus_recovery>:
push   %rbx
mov    %edi,%ebx
call   1040 <acc_i2c_abort_data@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <acc_i2c_reset_bus@plt>

LLVM IR (-O0):
define void @acc_i2c_bus_recovery(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @acc_i2c_abort_data(i8 zeroext %3)
%5 = load i8, i8* %2
%6 = call i32 @acc_i2c_reset_bus(i8 zeroext %5)
ret void
}

LLVM IR (-O2):
define void @acc_i2c_bus_recovery(i8 zeroext %0) {
%2 = tail call i32 @acc_i2c_abort_data(i8 zeroext %0)
%3 = tail call i32 @acc_i2c_reset_bus(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ realloc(char **, int);
char **remem_tt(char **x, int i) {
  char **aux0;
  aux0 = (char **)realloc(x, i * sizeof(char *));
  if (aux0 == NULL) {
    printf("Erreur d'allocation de memoire'\n");
    exit(-1);
  }
  x = aux0;
  return x;
}


x86 assembly (clang, -O0):
<remem_tt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1177 <remem_tt+0x47>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remem_tt>:
push   %rax
shl    $0x3,%esi
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <remem_tt+0x10>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Erreur d'allocation de memoire'\0A\00"
define i8** @remem_tt(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i8**
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 8
%10 = trunc i64 %9 to i32
%11 = call i64 @realloc(i8** %6, i32 %10)
%12 = inttoptr i64 %11 to i8**
store i8** %12, i8*** %5
%13 = load i8**, i8*** %5
%14 = icmp eq i8** %13, null
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
store i8** %19, i8*** %3
%20 = load i8**, i8*** %3
ret i8** %20
}

LLVM IR (-O2):
@str = [32 x i8] c"Erreur d'allocation de memoire'\00"
define i8** @remem_tt(i8** %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = tail call i64 @realloc(i8** %0, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
%10 = inttoptr i64 %4 to i8**
ret i8** %10
}
long labs(long i) {
  if (i < 0)
    return -i;
  else
    return i;
}


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <labs+0x2a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %3
%8 = sub nsw i64 0, %7
store i64 %8, i64* %2
br label %11
9: ; preds = %1
%10 = load i64, i64* %3
store i64 %10, i64* %2
br label %11
11: ; preds = %9, %6
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int hash1(char const *);
int hash(char const *input) { return (hash1(input) % 100); }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash1@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %rax
call   1030 <hash1@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @hash1(i8* %3)
%5 = srem i32 %4, 100
ret i32 %5
}

LLVM IR (-O2):
define i32 @hash(i8* %0) {
%2 = tail call i32 @hash1(i8* %0)
%3 = srem i32 %2, 100
ret i32 %3
}
/* Variables and functions */
int func3();
int func4() { return func3() + 1; }


x86 assembly (clang, -O0):
<func4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func3@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func4>:
push   %rax
xor    %eax,%eax
call   1030 <func3@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func4() {
%1 = call i32 (...) @func3()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func4() {
%1 = tail call i32 (...) @func3()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
void fm_set_bit(uint8_t *bmap, const uint64_t bit, const int new_value) {
  if (new_value)
    bmap[bit >> 3] |= (1 << (bit & 7));
  else
    bmap[bit >> 3] &= ~(1 << (bit & 7));
}


x86 assembly (clang, -O0):
<fm_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     113d <fm_set_bit+0x3d>
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
jmp    1160 <fm_set_bit+0x60>
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fm_set_bit>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
test   %edx,%edx
je     111a <fm_set_bit+0x1a>
sar    $0x3,%esi
movslq %esi,%rcx
or     %eax,(%rdi,%rcx,4)
ret
not    %eax
sar    $0x3,%esi
movslq %esi,%rcx
and    %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @fm_set_bit(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* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %3
%10 = load i32, i32* %5
%11 = and i32 %10, 7
%12 = shl i32 1, %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = ashr i32 %14, 3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
%18 = load i32, i32* %17
%19 = or i32 %18, %12
store i32 %19, i32* %17
br label %32
20: ; preds = %3
%21 = load i32, i32* %5
%22 = and i32 %21, 7
%23 = shl i32 1, %22
%24 = xor i32 %23, -1
%25 = load i32*, i32** %4
%26 = load i32, i32* %5
%27 = ashr i32 %26, 3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %25, i64 %28
%30 = load i32, i32* %29
%31 = and i32 %30, %24
store i32 %31, i32* %29
br label %32
32: ; preds = %20, %9
ret void
}

LLVM IR (-O2):
define void @fm_set_bit(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = and i32 %1, 7
%6 = shl nuw nsw i32 1, %5
br i1 %4, label %13, label %7
7: ; preds = %3
%8 = ashr i32 %1, 3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = or i32 %11, %6
store i32 %12, i32* %10
br label %20
13: ; preds = %3
%14 = xor i32 %6, -1
%15 = ashr i32 %1, 3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = and i32 %18, %14
store i32 %19, i32* %17
br label %20
20: ; preds = %13, %7
ret void
}
/* Variables and functions */
scalar_t__ fact(int);
int /*<<< orphan*/ usleep(int);
void run(void) {
  unsigned sum = 0;
  while (42) {
    for (int i = 0; i < 100; i++) {
      sum += fact(i);
    }
    usleep(10);
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1162 <run+0x42>
mov    -0x8(%rbp),%edi
call   1030 <fact@plt>
mov    %rax,%rcx
mov    -0x4(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <run+0x16>
mov    $0xa,%edi
call   1040 <usleep@plt>
jmp    112f <run+0xf>

x86 assembly (clang, -O2):
<run>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %ebx,%ebx
mov    %ebx,%edi
call   1030 <fact@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1132 <run+0x12>
mov    $0xa,%edi
call   1040 <usleep@plt>
jmp    1130 <run+0x10>

LLVM IR (-O0):
define void @run() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %17
store i32 0, i32* %2
br label %4
4: ; preds = %14, %3
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i64 @fact(i32 %8)
%10 = load i32, i32* %1
%11 = zext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %7
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
%18 = call i32 @usleep(i32 10)
br label %3
}

LLVM IR (-O2):
define void @run() {
br label %3
1: ; preds = %3
%2 = tail call i32 @usleep(i32 10)
br label %8
3: ; preds = %8, %0
%4 = phi i32 [ 0, %0 ], [ %9, %8 ]
%5 = tail call i64 @fact(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 100
br i1 %7, label %1, label %8
8: ; preds = %3, %1
%9 = phi i32 [ %6, %3 ], [ 0, %1 ]
br label %3
}
int dn_up_lim(int minval, int maxval, int val) {
  val = val < minval ? minval : val;
  val = val > maxval ? maxval : val;
  return val;
}


x86 assembly (clang, -O0):
<dn_up_lim>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1124 <dn_up_lim+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112a <dn_up_lim+0x2a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1147 <dn_up_lim+0x47>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114d <dn_up_lim+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dn_up_lim(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* %6
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %4
br label %14
12: ; preds = %3
%13 = load i32, i32* %6
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i32, i32* %5
br label %23
21: ; preds = %14
%22 = load i32, i32* %6
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
store i32 %24, i32* %6
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
define i32 @dn_up_lim(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %0
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %1, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_credits() {
  printf("cPige %s by Laurent Coustet (c) 2005\n", "1.5");
  return;
}


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

x86 assembly (clang, -O2):
<print_credits>:
lea    0xee9(%rip),%rdi
lea    0xf08(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"cPige %s by Laurent Coustet (c) 2005\0A\00"
@.str.1 = [4 x i8] c"1.5\00"
define void @print_credits() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"cPige %s by Laurent Coustet (c) 2005\0A\00"
@.str.1 = [4 x i8] c"1.5\00"
define void @print_credits() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int main(void) {
  test1();
  test2();
  test3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_haskell_comment_entities();
int /*<<< orphan*/ test_haskell_comments();
void all_haskell_tests() {
  test_haskell_comments();
  test_haskell_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_haskell_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_haskell_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_haskell_comment_entities@plt>

LLVM IR (-O0):
define void @all_haskell_tests() {
%1 = call i32 (...) @test_haskell_comments()
%2 = call i32 (...) @test_haskell_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_haskell_tests() {
%1 = tail call i32 (...) @test_haskell_comments()
%2 = tail call i32 (...) @test_haskell_comment_entities()
ret void
}
/* Variables and functions */
int bitcount(unsigned int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  if (argv[1])
    printf("%d\n", bitcount((unsigned int)strtoul(argv[1], NULL, 10)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1180 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %eax,%edi
call   1040 <bitcount@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     115b <main+0x2b>
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %eax,%edi
call   1040 <bitcount@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i64 @strtoul(i8* nocapture %4, i32* null, i32 10)
%8 = trunc i64 %7 to i32
%9 = tail call i32 @bitcount(i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %6, %2
ret i32 0
}
int test_imm_C4int64_highword_reg(long long val) {
  return ((val >> 32) & (0xC4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C4int64_highword_reg(i64 %0) {
%2 = and i64 %0, 841813590016
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void m_signal(int signal) { exit(signal); }


x86 assembly (clang, -O0):
<m_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<m_signal>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @m_signal(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
int nested_loop() {
  int k = 0;
  for (int i = 0; i < 5; i++) {
  A:
    k = 0;
    for (int j = 0; j < 100; j++) {
      k = 3;
    }
  }
  return k;
}


x86 assembly (clang, -O0):
<nested_loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1161 <nested_loop+0x61>
jmp    1121 <nested_loop+0x21>
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    114e <nested_loop+0x4e>
movl   $0x3,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <nested_loop+0x2f>
jmp    1153 <nested_loop+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <nested_loop+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @nested_loop() {
ret i32 3
}