xunge/DecIR huggingface dataset:
void EPINonBlockingReadStop(unsigned long ulBase, unsigned long ulChannel) {
  unsigned long ulOffset;
  ;
  ;
  ulOffset = ulChannel * (0x00000038 - 0x00000028);
  (*((volatile unsigned long *)(ulBase + 0x00000028 + ulOffset))) = 0;
}


x86 assembly (clang, -O0):
<EPINonBlockingReadStop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x28,%rax
add    -0x18(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadStop>:
shl    $0x4,%rsi
movq   $0x0,0x28(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @EPINonBlockingReadStop(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = mul i64 %6, 16
store i64 %7, i64* %5
%8 = load i64, i64* %3
%9 = add i64 %8, 40
%10 = load i64, i64* %5
%11 = add i64 %9, %10
%12 = inttoptr i64 %11 to i64*
store volatile i64 0, i64* %12
ret void
}

LLVM IR (-O2):
define void @EPINonBlockingReadStop(i64 %0, i64 %1) {
%3 = shl i64 %1, 4
%4 = add i64 %0, 40
%5 = add i64 %4, %3
%6 = inttoptr i64 %5 to i64*
store volatile i64 0, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void memcpy5() {
  char src[] = {1, 2, 3, 4};
  char dst[3];
  memcpy(dst + 2, src + 2, 2);
}


x86 assembly (clang, -O0):
<memcpy5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x7(%rbp),%rdi
add    $0x2,%rdi
lea    -0x4(%rbp),%rsi
add    $0x2,%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy5>:
push   %rax
movl   $0x4030201,(%rsp)
lea    0x7(%rsp),%rdi
lea    0x2(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.memcpy5.src = [4 x i8] c"\01\02\03\04"
define void @memcpy5() {
%1 = alloca [4 x i8]
%2 = alloca [3 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = call i32 @memcpy(i8* %5, i8* %7, i32 2)
ret void
}

LLVM IR (-O2):
define void @memcpy5() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%6 = getelementptr inbounds i8, i8* %3, i64 2
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 2)
ret void
}
void myth_log_reset_body(void) {}


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

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

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

LLVM IR (-O2):
define void @myth_log_reset_body() {
ret void
}
unsigned int hweight8(unsigned char w) {
  w = (w & 0x55) + ((w >> 1) & 0x55);
  w = (w & 0x33) + ((w >> 2) & 0x33);
  w = (w & 0x0F) + ((w >> 4) & 0x0F);
  return w;
}


x86 assembly (clang, -O0):
<hweight8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x55,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55,%ecx
add    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x33,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33,%ecx
add    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf,%ecx
add    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight8>:
mov    %edi,%eax
and    $0x55,%al
shr    %dil
and    $0x55,%dil
add    %al,%dil
mov    %edi,%eax
and    $0x33,%al
shr    $0x2,%dil
and    $0x33,%dil
add    %al,%dil
mov    %edi,%eax
and    $0x7,%al
shr    $0x4,%dil
add    %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @hweight8(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, 85
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = ashr i32 %7, 1
%9 = and i32 %8, 85
%10 = add nsw i32 %5, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = and i32 %13, 51
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = ashr i32 %16, 2
%18 = and i32 %17, 51
%19 = add nsw i32 %14, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
%21 = load i8, i8* %2
%22 = zext i8 %21 to i32
%23 = and i32 %22, 15
%24 = load i8, i8* %2
%25 = zext i8 %24 to i32
%26 = ashr i32 %25, 4
%27 = and i32 %26, 15
%28 = add nsw i32 %23, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %2
%30 = load i8, i8* %2
%31 = zext i8 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @hweight8(i8 zeroext %0) {
%2 = and i8 %0, 85
%3 = lshr i8 %0, 1
%4 = and i8 %3, 85
%5 = add nuw i8 %4, %2
%6 = and i8 %5, 51
%7 = lshr i8 %5, 2
%8 = and i8 %7, 51
%9 = add nuw nsw i8 %8, %6
%10 = and i8 %9, 7
%11 = lshr i8 %9, 4
%12 = add nuw nsw i8 %10, %11
%13 = zext i8 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(0))) void hp4(void) { printf("hello, world!\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define void @hp4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ traverse(struct TreeNode *, int *);
int findSecondMinimumValue(struct TreeNode *root) {
  int min[2] = {-1, -1};
  traverse(root, min);
  if (min[0] != min[1]) {
    return min[1];
  }
  return -1;
}


x86 assembly (clang, -O0):
<findSecondMinimumValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <traverse@plt>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     114b <findSecondMinimumValue+0x3b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <findSecondMinimumValue+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findSecondMinimumValue>:
push   %rax
movq   $0xffffffffffffffff,(%rsp)
ff
mov    %rsp,%rsi
call   1030 <traverse@plt>
mov    0x4(%rsp),%ecx
cmp    %ecx,(%rsp)
mov    $0xffffffff,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
@__const.findSecondMinimumValue.min = [2 x i32] [i32 -1, i32 -1]
define i32 @findSecondMinimumValue(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = alloca %struct.TreeNode*
%4 = alloca [2 x i32]
store %struct.TreeNode* %0, %struct.TreeNode** %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = load %struct.TreeNode*, %struct.TreeNode** %3
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%8 = call i32 @traverse(%struct.TreeNode* %6, i32* %7)
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%12 = load i32, i32* %11
%13 = icmp ne i32 %10, %12
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%16 = load i32, i32* %15
store i32 %16, i32* %2
br label %18
17: ; preds = %1
store i32 -1, i32* %2
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @findSecondMinimumValue(%struct.TreeNode* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to [2 x i32]*
%4 = bitcast i64* %2 to i8*
store i64 -1, i64* %2
%5 = bitcast i64* %2 to i32*
%6 = call i32 @traverse(%struct.TreeNode* %0, i32* %5)
%7 = load i32, i32* %5
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%9 = load i32, i32* %8
%10 = icmp eq i32 %7, %9
%11 = select i1 %10, i32 -1, i32 %9
ret i32 %11
}
int test2() {
a:
  goto a;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <test2+0x9>
jmp    1109 <test2+0x9>

x86 assembly (clang, -O2):
<test2>:
jmp    1100 <test2>

LLVM IR (-O0):
define i32 @test2() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define i32 @test2() {
br label %1
1: ; preds = %1, %0
br label %1
}
int test_imm_9Duint16_reg(unsigned short val) {
  return ((val) & (0x9D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Duint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Duint16_reg>:
test   $0x9d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Duint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 157
%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_9Duint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 157
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int get_us_dist();
int /*<<< orphan*/ set_motors(int /*<<< orphan*/, int /*<<< orphan*/);
void stopFront() {
  if (get_us_dist() < 20) {
    set_motors(0, 0);
  }
}


x86 assembly (clang, -O0):
<stopFront>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_us_dist@plt>
cmp    $0x14,%eax
jge    113d <stopFront+0x1d>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <set_motors@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopFront>:
push   %rax
xor    %eax,%eax
call   1030 <get_us_dist@plt>
cmp    $0x13,%eax
jg     1137 <stopFront+0x17>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <set_motors@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @stopFront() {
%1 = call i32 (...) @get_us_dist()
%2 = icmp slt i32 %1, 20
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @set_motors(i32 0, i32 0)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @stopFront() {
%1 = tail call i32 (...) @get_us_dist()
%2 = icmp slt i32 %1, 20
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @set_motors(i32 0, i32 0)
br label %5
5: ; preds = %3, %0
ret void
}
void *test_anti_range_75(short n) {
  extern void *alloc_anti_range_75(short) __attribute__((alloc_size(1)));
  if (1 <= n && n <= 1)
    n = 1 - 1;
  return alloc_anti_range_75(n);
}


x86 assembly (clang, -O0):
<test_anti_range_75>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_75+0x33>
movswl -0x2(%rbp),%eax
cmp    $0x1,%eax
jg     1143 <test_anti_range_75+0x33>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_75@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_75>:
xor    %eax,%eax
cmp    $0x1,%di
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_75@plt>

LLVM IR (-O0):
define i8* @test_anti_range_75(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 1, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 0, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_75(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_75(i16 signext %0) {
%2 = icmp eq i16 %0, 1
%3 = select i1 %2, i16 0, i16 %0
%4 = tail call i8* @alloc_anti_range_75(i16 signext %3)
ret i8* %4
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
void tempConvert(int16_t rawObjTemp, int16_t rawAmbTemp, float *tObj,
                 float *tAmb) {
  const float SCALE_LSB = 0.03125;
  float t;
  t = rawObjTemp >> 2;
  *tObj = t * SCALE_LSB;
  t = rawAmbTemp >> 2;
  *tAmb = t * SCALE_LSB;
}


x86 assembly (clang, -O0):
<tempConvert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movss  0xee6(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xeca(%rip),%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xea6(%rip),%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempConvert>:
sar    $0x2,%edi
cvtsi2ss %edi,%xmm0
movss  0xef1(%rip),%xmm1
sar    $0x2,%esi
cvtsi2ss %esi,%xmm2
mulss  %xmm1,%xmm0
movss  %xmm0,(%rdx)
mulss  %xmm1,%xmm2
movss  %xmm2,(%rcx)
ret

LLVM IR (-O0):
define void @tempConvert(i32 %0, i32 %1, float* %2, float* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca float
%10 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store float* %2, float** %7
store float* %3, float** %8
store float 3.125000e-02, float* %9
%11 = load i32, i32* %5
%12 = ashr i32 %11, 2
%13 = sitofp i32 %12 to float
store float %13, float* %10
%14 = load float, float* %10
%15 = fmul float %14, 3.125000e-02
%16 = load float*, float** %7
store float %15, float* %16
%17 = load i32, i32* %6
%18 = ashr i32 %17, 2
%19 = sitofp i32 %18 to float
store float %19, float* %10
%20 = load float, float* %10
%21 = fmul float %20, 3.125000e-02
%22 = load float*, float** %8
store float %21, float* %22
ret void
}

LLVM IR (-O2):
define void @tempConvert(i32 %0, i32 %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = ashr i32 %0, 2
%6 = sitofp i32 %5 to float
%7 = fmul float %6, 3.125000e-02
store float %7, float* %2
%8 = ashr i32 %1, 2
%9 = sitofp i32 %8 to float
%10 = fmul float %9, 3.125000e-02
store float %10, float* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int isSupported(char *type) {
  if (!strcasecmp(type, "PALETTE"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1141 <isSupported+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isSupported+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"PALETTE\00"
define i32 @isSupported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcasecmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"PALETTE\00"
define i32 @isSupported(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srai_epi32(int /*<<< orphan*/, int);
__m128i test_mm_srai_epi32(__m128i A) { return _mm_srai_epi32(A, 1); }


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

x86 assembly (clang, -O2):
<test_mm_srai_epi32>:
mov    $0x1,%esi
jmp    1030 <_mm_srai_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srai_epi32(i32 %0) {
%2 = tail call i32 @_mm_srai_epi32(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int decode32(unsigned char **);
int decode(char **data) { return decode32((unsigned char **)data); }


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

x86 assembly (clang, -O2):
<decode>:
jmp    1030 <decode32@plt>

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

LLVM IR (-O2):
define i32 @decode(i8** %0) {
%2 = tail call i32 @decode32(i8** %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int bnrand(int, int /*<<< orphan*/ *, int, int, int);
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom) {
  return bnrand(1, rnd, bits, top, bottom);
}


x86 assembly (clang, -O0):
<BN_pseudo_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x1,%edi
call   1030 <bnrand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_pseudo_rand>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <bnrand@plt>

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

LLVM IR (-O2):
define i32 @BN_pseudo_rand(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @bnrand(i32 1, i32* %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int f2(int limite) {
  int i;
  for (i = 1; i < limite; i++)
    f1(i);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1144 <f2+0x34>
mov    -0xc(%rbp),%edi
call   1030 <f1@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <f2+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     112e <f2+0x1e>
mov    %edi,%ebx
mov    $0x1,%ebp
nop
mov    %ebp,%edi
call   1030 <f1@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <f2+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 @f1(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 undef
}
/* Type definitions */
struct bstree {
  int dummy;
};

/* Variables and functions */
bool bempty(const struct bstree *root) { return (NULL == root); }


x86 assembly (clang, -O0):
<bempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bempty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.bstree = type { i32 }
define i32 @bempty(%struct.bstree* %0) {
%2 = alloca %struct.bstree*
store %struct.bstree* %0, %struct.bstree** %2
%3 = load %struct.bstree*, %struct.bstree** %2
%4 = icmp eq %struct.bstree* null, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.bstree = type { i32 }
define i32 @bempty(%struct.bstree* readnone %0) {
%2 = icmp eq %struct.bstree* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
_Noreturn void halt(void) {
  asm volatile("_halt: hlt\njmp _halt");
  __builtin_unreachable();
}


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

x86 assembly (clang, -O2):
<halt>:
hlt
jmp    1100 <halt>

LLVM IR (-O0):
define void @halt() {
unreachable
}

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "_halt: hlt\0Ajmp _halt", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
void tcp_vegas_get_info(struct tcp_sock *sk, unsigned long ext,
                        struct sk_buff *skb) {}


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

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

LLVM IR (-O0):
%struct.tcp_sock = type opaque
%struct.sk_buff = type opaque
define void @tcp_vegas_get_info(%struct.tcp_sock* %0, i64 %1, %struct.sk_buff* %2) {
%4 = alloca %struct.tcp_sock*
%5 = alloca i64
%6 = alloca %struct.sk_buff*
store %struct.tcp_sock* %0, %struct.tcp_sock** %4
store i64 %1, i64* %5
store %struct.sk_buff* %2, %struct.sk_buff** %6
ret void
}

LLVM IR (-O2):
%struct.tcp_sock = type opaque
%struct.sk_buff = type opaque
define void @tcp_vegas_get_info(%struct.tcp_sock* nocapture %0, i64 %1, %struct.sk_buff* nocapture %2) {
ret void
}
void notify_m12mo_atomisp_dead(void) { return; }


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

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

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

LLVM IR (-O2):
define void @notify_m12mo_atomisp_dead() {
ret void
}
void gtk_entry_get_completion() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_get_completion() {
ret void
}
/* Variables and functions */
int inb(int);
int serial_proc_data(void) {
  if (!(inb(0x3F8 + 5) & 0x01))
    return -1;
  return inb(0x3F8 + 0);
}


x86 assembly (clang, -O0):
<serial_proc_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3fd,%edi
call   1030 <inb@plt>
and    $0x1,%eax
cmp    $0x0,%eax
jne    113a <serial_proc_data+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <serial_proc_data+0x37>
mov    $0x3f8,%edi
call   1030 <inb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_proc_data>:
push   %rax
mov    $0x3fd,%edi
call   1030 <inb@plt>
test   $0x1,%al
jne    1126 <serial_proc_data+0x16>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    $0x3f8,%edi
pop    %rax
jmp    1030 <inb@plt>

LLVM IR (-O0):
define i32 @serial_proc_data() {
%1 = alloca i32
%2 = call i32 @inb(i32 1021)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 -1, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 @inb(i32 1016)
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @serial_proc_data() {
%1 = tail call i32 @inb(i32 1021)
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @inb(i32 1016)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ %5, %4 ], [ -1, %0 ]
ret i32 %7
}
int loop2(int m) {
  int i = 0;
  while (i < m) {
    (*&i)++;
  }
  return i;
}


x86 assembly (clang, -O0):
<loop2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <loop2+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <loop2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop2>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @loop2(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* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @loop2(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ asm1();
int /*<<< orphan*/ asm2();
int main() {
  asm1();
  asm2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @asm1()
%2 = tail call i32 (...) @asm2()
ret i32 0
}
void ble_evt_system_boot(const struct ble_msg_system_boot_evt_t *msg) {}


x86 assembly (clang, -O0):
<ble_evt_system_boot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ble_msg_system_boot_evt_t = type opaque
define void @ble_evt_system_boot(%struct.ble_msg_system_boot_evt_t* %0) {
%2 = alloca %struct.ble_msg_system_boot_evt_t*
store %struct.ble_msg_system_boot_evt_t* %0, %struct.ble_msg_system_boot_evt_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_system_boot_evt_t = type opaque
define void @ble_evt_system_boot(%struct.ble_msg_system_boot_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_token(char *);
char *strtok(char *, char *);
void process_line(char *thisline) {
  char *next_token;
  next_token = strtok(thisline, " ");
  do {
    process_token(next_token);
  } while ((next_token = strtok(NULL, " ")) != NULL);
}


x86 assembly (clang, -O0):
<process_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <process_token@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xeac(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1140 <process_line+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_line>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rsi
call   1040 <strtok@plt>
mov    %rax,%rdi
call   1030 <process_token@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <strtok@plt>
test   %rax,%rax
jne    1130 <process_line+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @process_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
br label %6
6: ; preds = %9, %1
%7 = load i8*, i8** %3
%8 = call i32 @process_token(i8* %7)
br label %9
9: ; preds = %6
%10 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %6, label %12
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @process_line(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %6, %3 ]
%5 = tail call i32 @process_token(i8* %4)
%6 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
int returns_23() { return 23; }


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

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

LLVM IR (-O0):
define i32 @returns_23() {
ret i32 23
}

LLVM IR (-O2):
define i32 @returns_23() {
ret i32 23
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void beckerg17(void) { printf("beckerg17 like pizza\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"beckerg17 like pizza\0A\00"
define void @beckerg17() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"beckerg17 like pizza\00"
define void @beckerg17() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
void BLK(n) int n;
{
  int i = 1;
  while (i <= n) {
    printf(" ");
    i++;
  }
}


x86 assembly (clang, -O0):
<BLK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114a <BLK+0x3a>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <BLK+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BLK>:
push   %rbx
test   %edi,%edi
jle    112f <BLK+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <BLK+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @BLK(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @BLK(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct set {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ replace(struct set *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void use_replace_function(struct set *set, uint64_t tag, uint64_t index) {
  replace(set, tag, index);
}


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

x86 assembly (clang, -O2):
<use_replace_function>:
jmp    1030 <replace@plt>

LLVM IR (-O0):
%struct.set = type { i32 }
define void @use_replace_function(%struct.set* %0, i32 %1, i32 %2) {
%4 = alloca %struct.set*
%5 = alloca i32
%6 = alloca i32
store %struct.set* %0, %struct.set** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.set*, %struct.set** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @replace(%struct.set* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.set = type { i32 }
define void @use_replace_function(%struct.set* %0, i32 %1, i32 %2) {
%4 = tail call i32 @replace(%struct.set* %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int16_t rotateR_fun_int16_t(int16_t x, int32_t i) {
  if ((i %= 16) == 0)
    return x;
  return (x << (16 - i)) | ((0x7fff >> (i - 1)) & (x >> i));
}


x86 assembly (clang, -O0):
<rotateR_fun_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmp    $0x0,%edx
jne    112c <rotateR_fun_int16_t+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <rotateR_fun_int16_t+0x5b>
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x7fff,%edx
sar    %cl,%edx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    -0x10(%rbp),%ecx
and    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateR_fun_int16_t>:
mov    %edi,%eax
lea    0xf(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xfffffff0,%ecx
sub    %ecx,%esi
je     112c <rotateR_fun_int16_t+0x2c>
mov    $0x10,%cl
sub    %sil,%cl
mov    %eax,%edx
shl    %cl,%edx
lea    -0x1(%rsi),%ecx
mov    $0x7fff,%edi
shr    %cl,%edi
mov    %esi,%ecx
sar    %cl,%eax
and    %edi,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @rotateR_fun_int16_t(i32 %0, i32 %1) {
%3 = srem i32 %1, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = sub nsw i32 16, %3
%7 = shl i32 %0, %6
%8 = add nsw i32 %3, -1
%9 = lshr i32 32767, %8
%10 = ashr i32 %0, %3
%11 = and i32 %9, %10
%12 = or i32 %11, %7
br label %13
13: ; preds = %2, %5
%14 = phi i32 [ %12, %5 ], [ %0, %2 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SHA1Block(unsigned char const *, int /*<<< orphan*/ const);
void HMACBlock(const unsigned char *data, const uint8_t len) {
  SHA1Block(data, len);
}


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

x86 assembly (clang, -O2):
<HMACBlock>:
jmp    1030 <SHA1Block@plt>

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

LLVM IR (-O2):
define void @HMACBlock(i8* %0, i32 %1) {
%3 = tail call i32 @SHA1Block(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void mov_reg32_imm32(int reg32, unsigned long imm32) {
  put8(0xB8 + reg32);
  put32(imm32);
}


x86 assembly (clang, -O0):
<mov_reg32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0xb8,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg32_imm32>:
push   %rbx
mov    %rsi,%rbx
add    $0xb8,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_reg32_imm32(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = add nsw i32 184, %5
%7 = call i32 @put8(i32 %6)
%8 = load i64, i64* %4
%9 = call i32 @put32(i64 %8)
ret void
}

LLVM IR (-O2):
define void @mov_reg32_imm32(i32 %0, i64 %1) {
%3 = add nsw i32 %0, 184
%4 = tail call i32 @put8(i32 %3)
%5 = tail call i32 @put32(i64 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void AESInvalidateKey(uint32_t keyStoreArea) {

  ;
  (*((volatile unsigned long *)(0x40024000 + 0x00000404))) =
      (0x00000001 << keyStoreArea);
}


x86 assembly (clang, -O0):
<AESInvalidateKey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x40024404,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESInvalidateKey>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x40024404
40
ret

LLVM IR (-O0):
define void @AESInvalidateKey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = sext i32 %4 to i64
store volatile i64 %5, i64* inttoptr (i64 1073890308 to i64*)
ret void
}

LLVM IR (-O2):
define void @AESInvalidateKey(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = sext i32 %2 to i64
store volatile i64 %3, i64* inttoptr (i64 1073890308 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int main(void) {
  printf("Starting BAF Tests...\n");
  test1();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Starting BAF Tests...\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test1()
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"Starting BAF Tests...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test1()
ret i32 0
}
long int longint_ignoring_unsignedlong(long int x, unsigned long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longint_ignoring_unsignedlong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @longint_ignoring_unsignedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
off_t fileLength(int hFile) {
  off_t length;
  off_t currentPosition;
  currentPosition = lseek(hFile, (off_t)0, SEEK_CUR);
  length = lseek(hFile, (off_t)0, SEEK_END);
  lseek(hFile, currentPosition, SEEK_SET);
  return (length);
}


x86 assembly (clang, -O0):
<fileLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileLength>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,%r14d
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,%ebp
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <lseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_CUR = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @fileLength(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @SEEK_CUR
%7 = call i32 @lseek(i32 %5, i32 0, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* @SEEK_END
%10 = call i32 @lseek(i32 %8, i32 0, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* @SEEK_SET
%14 = call i32 @lseek(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @fileLength(i32 %0) {
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i32 @lseek(i32 %0, i32 0, i32 %2)
%4 = load i32, i32* @SEEK_END
%5 = tail call i32 @lseek(i32 %0, i32 0, i32 %4)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @lseek(i32 %0, i32 %3, i32 %6)
ret i32 %5
}
/* Variables and functions */
int my_string_to_int(char *, int);
int my_getnbr(char *str) {
  int nb;
  int begin;
  if (str[0] == '-')
    begin = 1;
  else
    begin = 0;
  nb = my_string_to_int(str, begin);
  if (str[0] == '-')
    nb *= -1;
  return (nb);
}


x86 assembly (clang, -O0):
<my_getnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1138 <my_getnbr+0x28>
movl   $0x1,-0x10(%rbp)
jmp    113f <my_getnbr+0x2f>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <my_string_to_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1165 <my_getnbr+0x55>
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getnbr>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
cmpb   $0x2d,(%rdi)
sete   %sil
call   1030 <my_string_to_int@plt>
mov    %eax,%ecx
neg    %ecx
cmpb   $0x2d,(%rbx)
cmove  %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @my_getnbr(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
%4 = zext i1 %3 to i32
%5 = tail call i32 @my_string_to_int(i8* %0, i32 %4)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 45
%8 = sub nsw i32 0, %5
%9 = select i1 %7, i32 %8, i32 %5
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(unsigned long);
void add_reg32_m32(unsigned long reg32, void *_m32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0x03);
  put8((reg32 << 3) | 5);
  put32((unsigned long)(m32));
}


x86 assembly (clang, -O0):
<add_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x3,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
or     $0x5,%rdi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rdi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x3,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%rdi
call   1030 <put8@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @add_reg32_m32(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = call i32 @put8(i64 3)
%9 = load i64, i64* %3
%10 = shl i64 %9, 3
%11 = or i64 %10, 5
%12 = call i32 @put8(i64 %11)
%13 = load i64*, i64** %5
%14 = ptrtoint i64* %13 to i64
%15 = call i32 @put32(i64 %14)
ret void
}

LLVM IR (-O2):
define void @add_reg32_m32(i64 %0, i8* %1) {
%3 = tail call i32 @put8(i64 3)
%4 = shl i64 %0, 3
%5 = or i64 %4, 5
%6 = tail call i32 @put8(i64 %5)
%7 = ptrtoint i8* %1 to i64
%8 = tail call i32 @put32(i64 %7)
ret void
}
/* Variables and functions */
double bits_to_double(int);
int double_to_bits(double);
double fabs(double n) {
  return bits_to_double(double_to_bits(n) & 0x7ffffffffffffffful);
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <double_to_bits@plt>
cltq
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rcx,%rax
mov    %eax,%edi
call   1040 <bits_to_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
push   %rax
call   1030 <double_to_bits@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <bits_to_double@plt>

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @double_to_bits(double %3)
%5 = sext i32 %4 to i64
%6 = and i64 %5, 9223372036854775807
%7 = trunc i64 %6 to i32
%8 = call double @bits_to_double(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = tail call i32 @double_to_bits(double %0)
%3 = tail call double @bits_to_double(i32 %2)
ret double %3
}