xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bnInit_16();
void bnInit(void) { bnInit_16(); }


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

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

LLVM IR (-O0):
define void @bnInit() {
%1 = call i32 (...) @bnInit_16()
ret void
}

LLVM IR (-O2):
define void @bnInit() {
%1 = tail call i32 (...) @bnInit_16()
ret void
}
/* Variables and functions */
int *A();
int *D() { return A(); }


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

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

LLVM IR (-O0):
define i32* @D() {
%1 = call i32* (...) @A()
ret i32* %1
}

LLVM IR (-O2):
define i32* @D() {
%1 = tail call i32* (...) @A()
ret i32* %1
}
int s_ifsock(unsigned int m) { return (0); }


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

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

LLVM IR (-O0):
define i32 @s_ifsock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @s_ifsock(i32 %0) {
ret i32 0
}
unsigned int precomputed16_bitcountLocal(char *bits_in_16bitsLocal,
                                         unsigned int n) {
  return bits_in_16bitsLocal[n & 0xffffu] +
         bits_in_16bitsLocal[(n >> 16) & 0xffffu];
}


x86 assembly (clang, -O0):
<precomputed16_bitcountLocal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0xffff,%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
shr    $0x10,%edx
and    $0xffff,%edx
mov    %edx,%edx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precomputed16_bitcountLocal>:
mov    %esi,%eax
movzwl %ax,%ecx
movsbl (%rdi,%rcx,1),%ecx
shr    $0x10,%rax
movsbl (%rdi,%rax,1),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @precomputed16_bitcountLocal(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 = and i32 %6, 65535
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = lshr i32 %13, 16
%15 = and i32 %14, 65535
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %12, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = add nsw i32 %11, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @precomputed16_bitcountLocal(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 65535
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = lshr i32 %1, 16
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, %7
ret i32 %13
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void uint32_to_b4_LE(uint32_t data, uint8_t *b) {
  b[3] = (data >> 24) & 0xFF;
  b[2] = (data >> 16) & 0xFF;
  b[1] = (data >> 8) & 0xFF;
  b[0] = data & 0xFF;
}


x86 assembly (clang, -O0):
<uint32_to_b4_LE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_to_b4_LE>:
mov    %edi,%eax
mov    %edi,%ecx
movzbl %ah,%edx
movzbl %al,%edi
shr    $0x18,%eax
mov    %eax,0xc(%rsi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x8(%rsi)
mov    %edx,0x4(%rsi)
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @uint32_to_b4_LE(i32 %0, i32* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %3, i32* %4
%5 = lshr i32 %0, 16
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %6, i32* %7
%8 = lshr i32 %0, 8
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %9, i32* %10
%11 = and i32 %0, 255
store i32 %11, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RAND_bytes(void *, int);
void pgp_random(void *dest, size_t length) { RAND_bytes(dest, (int)length); }


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

x86 assembly (clang, -O2):
<pgp_random>:
jmp    1030 <RAND_bytes@plt>

LLVM IR (-O0):
define void @pgp_random(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = call i32 @RAND_bytes(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pgp_random(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @RAND_bytes(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ danger2();
int main(void) {
  danger2();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @danger2()
ret i32 0
}
/* Variables and functions */
int test_if4(void) {
  if (0) {
    return 0;
  } else {
    return 'd';
  }
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @test_if4() {
ret i32 100
}

LLVM IR (-O2):
define i32 @test_if4() {
ret i32 100
}
/* Variables and functions */
float __infer_nondet_float();
float nearbyintf(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<nearbyintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @nearbyintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
const char *C_Str_Definition(void) {
  return "struct C_Str {\n"
         "  char* (*c_str)(var);\n"
         "};\n";
}


x86 assembly (clang, -O0):
<C_Str_Definition>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [42 x i8] c"struct C_Str {\0A char* (*c_str)(var);\0A};\0A\00"
define i8* @C_Str_Definition() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [42 x i8] c"struct C_Str {\0A char* (*c_str)(var);\0A};\0A\00"
define i8* @C_Str_Definition() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long f2(unsigned long x,
                                              unsigned long y) {
  unsigned long r = x + y;
  if (r <= x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
ja     1141 <f2+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %rsi,%rbx
add    %rdi,%rbx
cmp    %rdi,%rbx
ja     1123 <f2+0x13>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @f2(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* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %3
%11 = icmp ule i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @foo(i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @f2(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ugt i64 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
int params__char_value(char c) {
  int value = 0;
  if (c >= '0' && c <= '9') {
    value = (int)(c - '0');
  }
  return value;
}


x86 assembly (clang, -O0):
<params__char_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1135 <params__char_value+0x35>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1135 <params__char_value+0x35>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<params__char_value>:
lea    -0x30(%rdi),%ecx
lea    -0x30(%rdi),%edx
xor    %eax,%eax
cmp    $0xa,%cl
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @params__char_value(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %7, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @params__char_value(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 0
ret i32 %6
}
void free_matrix(int **matrix, int N, int M) {
  int i;
  for (i = 0; i < N; i++) {
    free(matrix[i]);
  }
  free(matrix);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <free_matrix+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <free_matrix+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32*, i32** %0, i64 %8
%10 = bitcast i32** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = bitcast i32** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Type definitions */
struct ptr_list {
  int dummy;
};
struct basic_block_list {
  int dummy;
};
struct basic_block {
  int dummy;
};

/* Variables and functions */
struct basic_block *delete_ptr_list_last(struct ptr_list **);
struct basic_block *delete_last_basic_block(struct basic_block_list **head) {
  return delete_ptr_list_last((struct ptr_list **)head);
}


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

x86 assembly (clang, -O2):
<delete_last_basic_block>:
jmp    1030 <delete_ptr_list_last@plt>

LLVM IR (-O0):
%struct.basic_block = type { i32 }
%struct.basic_block_list = type { i32 }
%struct.ptr_list = type { i32 }
define %struct.basic_block* @delete_last_basic_block(%struct.basic_block_list** %0) {
%2 = alloca %struct.basic_block_list**
store %struct.basic_block_list** %0, %struct.basic_block_list*** %2
%3 = load %struct.basic_block_list**, %struct.basic_block_list*** %2
%4 = bitcast %struct.basic_block_list** %3 to %struct.ptr_list**
%5 = call %struct.basic_block* @delete_ptr_list_last(%struct.ptr_list** %4)
ret %struct.basic_block* %5
}

LLVM IR (-O2):
%struct.basic_block = type { i32 }
%struct.basic_block_list = type { i32 }
%struct.ptr_list = type { i32 }
define %struct.basic_block* @delete_last_basic_block(%struct.basic_block_list** %0) {
%2 = bitcast %struct.basic_block_list** %0 to %struct.ptr_list**
%3 = tail call %struct.basic_block* @delete_ptr_list_last(%struct.ptr_list** %2)
ret %struct.basic_block* %3
}
void test_address_of_label(void) {
label:
  __emit_expression_range(0, &&label);
}


x86 assembly (clang, -O0):
<test_address_of_label>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <test_address_of_label+0x9>
xor    %eax,%eax
xor    %edi,%edi
mov    %dil,%al
lea    -0xe(%rip),%rsi
call   1030 <__emit_expression_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_address_of_label>:
lea    -0x7(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_address_of_label() {
br label %1
1: ; preds = %3, %0
%2 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i8*, ...)*)(i32 0, i8* blockaddress(@test_address_of_label, %1))
ret void
3: ; No predecessors!
indirectbr i8* undef, [label %1]
}

LLVM IR (-O2):
define void @test_address_of_label() {
br label %1
1: ; preds = %0
%2 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i8*, ...)*)(i32 0, i8* blockaddress(@test_address_of_label, %1))
ret void
}
void L3GD20_DeInit(void) {}


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

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

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

LLVM IR (-O2):
define void @L3GD20_DeInit() {
ret void
}
/* Variables and functions */
int baz();
int bar() { return baz(); }


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

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

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

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @baz()
ret i32 %1
}
/* Variables and functions */
void *calloc(int, size_t);
void *kr_calloc(size_t size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<kr_calloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @kr_calloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
void gtk_text_buffer_create_mark() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_create_mark() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int lseek(int, int, int /*<<< orphan*/);
int FileLength(int fh) {
  int curpos, size;
  curpos = lseek(fh, 0, SEEK_CUR);
  size = lseek(fh, 0, SEEK_END);
  lseek(fh, curpos, SEEK_SET);
  return (size);
}


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,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    -0xc(%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* %3
%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* %4
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* @SEEK_SET
%14 = call i32 @lseek(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %4
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
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_input(const char *fname, FILE *f) {
  if (fname)
    fclose(f);
}


x86 assembly (clang, -O0):
<close_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <close_input+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_input>:
test   %rdi,%rdi
je     111d <close_input+0xd>
mov    %rsi,%rdi
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
define void @close_input(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = call i32 @fclose(i32* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @close_input(i8* readnone %0, i32* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int wait(int /*<<< orphan*/ *);
void parent_code(int childPid) {
  int wait_rv;
  wait_rv = wait(NULL);
  printf("done waiting for %d. Wait return: %d\n", childPid, wait_rv);
}


x86 assembly (clang, -O0):
<parent_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent_code>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <wait@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"done waiting for %d. Wait return: %d\0A\00"
define void @parent_code(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @wait(i32* null)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"done waiting for %d. Wait return: %d\0A\00"
define void @parent_code(i32 %0) {
%2 = tail call i32 @wait(i32* null)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
int Mini(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<Mini>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <Mini+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <Mini+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Mini(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct poption {
  int dummy;
};
struct packet {
  int dummy;
};

/* Variables and functions */
struct poption *get_curr_option();
struct packet *get_curr_packet();
int /*<<< orphan*/ option_add_name(struct packet *, struct poption *, char *);
void cb_op_name(char *name) {
  struct packet *p = get_curr_packet();
  struct poption *o = get_curr_option();
  option_add_name(p, o, name);
}


x86 assembly (clang, -O0):
<cb_op_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_curr_packet@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_curr_option@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <option_add_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_op_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <get_curr_packet@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <get_curr_option@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <option_add_name@plt>

LLVM IR (-O0):
%struct.packet = type { i32 }
%struct.poption = type { i32 }
define void @cb_op_name(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.packet*
%4 = alloca %struct.poption*
store i8* %0, i8** %2
%5 = call %struct.packet* (...) @get_curr_packet()
store %struct.packet* %5, %struct.packet** %3
%6 = call %struct.poption* (...) @get_curr_option()
store %struct.poption* %6, %struct.poption** %4
%7 = load %struct.packet*, %struct.packet** %3
%8 = load %struct.poption*, %struct.poption** %4
%9 = load i8*, i8** %2
%10 = call i32 @option_add_name(%struct.packet* %7, %struct.poption* %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.packet = type { i32 }
%struct.poption = type { i32 }
define void @cb_op_name(i8* %0) {
%2 = tail call %struct.packet* (...) @get_curr_packet()
%3 = tail call %struct.poption* (...) @get_curr_option()
%4 = tail call i32 @option_add_name(%struct.packet* %2, %struct.poption* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XGrabPointer() {
  printf("XGrabPointer called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"XGrabPointer called\00"
define i32 @XGrabPointer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__attribute__((no)) __attribute__((always_)) int fn1(int r) { return r & 4; }


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

x86 assembly (clang, -O2):
<fn1>:
mov    %edi,%eax
and    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
%2 = and i32 %0, 4
ret i32 %2
}
void prepare(int sock) {}


x86 assembly (clang, -O0):
<prepare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @prepare(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @prepare(i32 %0) {
ret void
}
double funcb(void) { return 0; }


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

x86 assembly (clang, -O2):
<funcb>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @funcb() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @funcb() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void err_exit(void) {
  fprintf(stderr, "'bc430' takes the asteroid number and desired epoch as\n"
                  "command line arguments,  and outputs the elements.\n"
                  "Example usage (for (449) Hamburga,  JD 2451545) :\n"
                  "\n./bc430 449 2451545\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [178 x i8] c"'bc430' takes the asteroid number and desired epoch as\0Acommand line arguments, and outputs the elements.\0AExample usage (for (449) Hamburga, JD 2451545) :\0A\0A./bc430 449 2451545\0A\00"
define void @err_exit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [178 x i8] c"'bc430' takes the asteroid number and desired epoch as\0Acommand line arguments, and outputs the elements.\0AExample usage (for (449) Hamburga, JD 2451545) :\0A\0A./bc430 449 2451545\0A\00"
define void @err_exit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ insl(unsigned int, void *, unsigned long);
void nsp32_multi_read4(unsigned int BaseAddr, unsigned int Register, void *buf,
                       unsigned long count) {
  insl(BaseAddr + Register, buf, count);
}


x86 assembly (clang, -O0):
<nsp32_multi_read4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <insl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsp32_multi_read4>:
add    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <insl@plt>

LLVM IR (-O0):
define void @nsp32_multi_read4(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %9, %10
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @insl(i32 %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
define void @nsp32_multi_read4(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = add i32 %1, %0
%6 = tail call i32 @insl(i32 %5, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ScoreConnection_create();
int /*<<< orphan*/ ScoreConnection_safePoint();
int main() {
  ScoreConnection_create();
  while (1) {
    ScoreConnection_safePoint();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ScoreConnection_create@plt>
mov    $0x0,%al
call   1030 <ScoreConnection_safePoint@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <ScoreConnection_create@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ScoreConnection_safePoint@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ScoreConnection_create()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @ScoreConnection_safePoint()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ScoreConnection_create()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @ScoreConnection_safePoint()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void about(void) {
  printf("CCExample %s. Created by: %s\n", "v0.4.0", "Matthew Maynes");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"CCExample %s. Created by: %s\0A\00"
@.str.1 = [7 x i8] c"v0.4.0\00"
@.str.2 = [15 x i8] c"Matthew Maynes\00"
define void @about() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"CCExample %s. Created by: %s\0A\00"
@.str.1 = [7 x i8] c"v0.4.0\00"
@.str.2 = [15 x i8] c"Matthew Maynes\00"
define void @about() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int nvram_commit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nvram_commit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ signal_handlers_clear(int /*<<< orphan*/);
void signal_handler_reset(void) { signal_handlers_clear(SIG_DFL); }


x86 assembly (clang, -O0):
<signal_handler_reset>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <signal_handlers_clear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler_reset>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <signal_handlers_clear@plt>

LLVM IR (-O0):
@SIG_DFL = global i32 0
define void @signal_handler_reset() {
%1 = load i32, i32* @SIG_DFL
%2 = call i32 @signal_handlers_clear(i32 %1)
ret void
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
define void @signal_handler_reset() {
%1 = load i32, i32* @SIG_DFL
%2 = tail call i32 @signal_handlers_clear(i32 %1)
ret void
}
int test_imm_DCuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xDC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DCuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 220
%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_DCuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 220
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t instruction_extension_extract_bs(uint16_t instruction) {
  return (instruction >> 0x07) & 0x01;
}


x86 assembly (clang, -O0):
<instruction_extension_extract_bs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x7,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instruction_extension_extract_bs>:
mov    %edi,%eax
shr    $0x7,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @instruction_extension_extract_bs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 7
%5 = and i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @instruction_extension_extract_bs(i32 %0) {
%2 = lshr i32 %0, 7
%3 = and i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void bit_array_right_shift_one(int len, uint64_t *bits) {
  unsigned char bit = 1;
  uint64_t lastbit = 1;
  for (int i = 0; i < len; i++) {
    bit = bits[i] & 1;
    bits[i] >>= 1;
    bits[i] |= lastbit << 63;
    lastbit = bit;
  }
}


x86 assembly (clang, -O0):
<bit_array_right_shift_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x1,-0x11(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1178 <bit_array_right_shift_one+0x78>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
and    $0x1,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
sar    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%edx
mov    $0x3f,%ecx
shl    %cl,%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
movzbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111d <bit_array_right_shift_one+0x1d>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bit_array_right_shift_one(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int generate(int ceiling) { return rand() % (ceiling + 1); }


x86 assembly (clang, -O0):
<generate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @generate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = srem i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @generate(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = add nsw i32 %0, 1
%4 = srem i32 %2, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
long long wcstoll(const wchar_t *nptr, wchar_t **endptr, int base) {
  assert(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @wcstoll(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 = call i32 @assert(i32 0)
ret i64 0
}

LLVM IR (-O2):
define i64 @wcstoll(i32* nocapture readnone %0, i32** nocapture readnone %1, i32 %2) {
%4 = tail call i32 @assert(i32 0)
ret i64 0
}
void glUniform3fv(void) { return; }


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

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

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

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

/* Variables and functions */
char *somePath(struct sqlConnection *, int, char *);
char *genePixScreenSizePath(struct sqlConnection *conn, int id) {
  return somePath(conn, id, "screenLocation");
}


x86 assembly (clang, -O0):
<genePixScreenSizePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <somePath@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genePixScreenSizePath>:
lea    0xee9(%rip),%rdx
jmp    1030 <somePath@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [15 x i8] c"screenLocation\00"
define i8* @genePixScreenSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @somePath(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [15 x i8] c"screenLocation\00"
define i8* @genePixScreenSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @somePath(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
int dwc_otg_pcd_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dwc_otg_pcd_init() {
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
scalar_t__ __is_big_endian();
int __swab16(int);
extern int le16_to_native(uint16_t i) {
  if (__is_big_endian()) {
    return __swab16(i);
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<le16_to_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__is_big_endian@plt>
cmp    $0x0,%rax
je     114c <le16_to_native+0x2c>
mov    -0x8(%rbp),%edi
call   1040 <__swab16@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <le16_to_native+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le16_to_native>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__is_big_endian@plt>
test   %rax,%rax
je     1137 <le16_to_native+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <__swab16@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @le16_to_native(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @__is_big_endian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @__swab16(i32 %7)
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @le16_to_native(i32 %0) {
%2 = tail call i64 (...) @__is_big_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__swab16(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ioctl_tst_ring_dbl(int, int);
void tst_ring_dbl(int file_desc) {
  ioctl_tst_ring_dbl(file_desc, 1);
  ioctl_tst_ring_dbl(file_desc, 10);
  ioctl_tst_ring_dbl(file_desc, 5);
  ioctl_tst_ring_dbl(file_desc, 0);
}


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

x86 assembly (clang, -O2):
<tst_ring_dbl>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
call   1030 <ioctl_tst_ring_dbl@plt>
mov    %ebx,%edi
mov    $0xa,%esi
call   1030 <ioctl_tst_ring_dbl@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <ioctl_tst_ring_dbl@plt>
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <ioctl_tst_ring_dbl@plt>

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

LLVM IR (-O2):
define void @tst_ring_dbl(i32 %0) {
%2 = tail call i32 @ioctl_tst_ring_dbl(i32 %0, i32 1)
%3 = tail call i32 @ioctl_tst_ring_dbl(i32 %0, i32 10)
%4 = tail call i32 @ioctl_tst_ring_dbl(i32 %0, i32 5)
%5 = tail call i32 @ioctl_tst_ring_dbl(i32 %0, i32 0)
ret void
}