xunge/DecIR huggingface dataset:
unsigned int reverse(unsigned int num) {
  unsigned int result = 0;
  unsigned int n;
  unsigned int bit;
  for (n = 0; n < 32; n++) {
    bit = ((num >> n) & 0x00000001);
    result = result ^ (bit << n);
  }
  return result;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jae    114d <reverse+0x4d>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <reverse+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
xor    %r8d,%r8d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%edx
mov    %r8d,%ecx
shr    %cl,%edx
and    $0x1,%edx
shl    %cl,%edx
xor    %eax,%edx
lea    0x1(%r8),%ecx
mov    %edi,%esi
shr    %cl,%esi
and    $0x1,%esi
shl    %cl,%esi
xor    %edx,%esi
lea    0x2(%r8),%ecx
mov    %edi,%edx
shr    %cl,%edx
and    $0x1,%edx
shl    %cl,%edx
lea    0x3(%r8),%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
shl    %cl,%eax
xor    %edx,%eax
xor    %esi,%eax
add    $0x4,%r8d
cmp    $0x20,%r8d
jne    1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %23, %2 ]
%4 = phi i32 [ 0, %1 ], [ %24, %2 ]
%5 = lshr i32 %0, %4
%6 = and i32 %5, 1
%7 = shl nuw i32 %6, %4
%8 = xor i32 %7, %3
%9 = or i32 %4, 1
%10 = lshr i32 %0, %9
%11 = and i32 %10, 1
%12 = shl nuw i32 %11, %9
%13 = xor i32 %12, %8
%14 = or i32 %4, 2
%15 = lshr i32 %0, %14
%16 = and i32 %15, 1
%17 = shl nuw i32 %16, %14
%18 = xor i32 %17, %13
%19 = or i32 %4, 3
%20 = lshr i32 %0, %19
%21 = and i32 %20, 1
%22 = shl nuw i32 %21, %19
%23 = xor i32 %22, %18
%24 = add nuw nsw i32 %4, 4
%25 = icmp eq i32 %24, 32
br i1 %25, label %26, label %2
26: ; preds = %2
ret i32 %23
}
void contar_nodos(int data, void *extra) { *((int *)extra) += 1; }


x86 assembly (clang, -O0):
<contar_nodos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<contar_nodos>:
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @contar_nodos(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @contar_nodos(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
ret void
}
/* Variables and functions */
int errno;
int syscall(int, int, int, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/);
int getpriority(int which, int id) {
  int ret = syscall(115, which, id, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<getpriority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x73,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115e <getpriority+0x4e>
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    0x2e90(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <getpriority+0x54>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpriority>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
mov    $0x73,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     112d <getpriority+0x1d>
pop    %rcx
ret
neg    %eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @getpriority(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 115, i32 %0, i32 %1, i32 0, i32 0, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = sub nsw i32 0, %3
store i32 %6, i32* @errno
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ %3, %2 ]
ret i32 %8
}
int test_imm_EBint64_lowword_mem(long long *val) {
  return ((*val) & (0xEB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EBint64_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, 235
%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_EBint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 235
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ above;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
unsigned long get_XConfigureEvent_above(void *_p) {
  return (unsigned long)((XConfigureEvent *)_p)->above;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XConfigureEvent_above(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XConfigureEvent_above(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ p(unsigned char);
int /*<<< orphan*/ printf(char *, unsigned char);
int main() {
  unsigned char t;
  t = 5;
  printf("c: %c\n", t);
  printf("d: %d\n", t);
  printf("u: %u\n", t);
  t = 0x80;
  p(t);
  t = 0x7F;
  p(t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x5,-0x5(%rbp)
lea    0xec6(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1040 <printf@plt>
movb   $0x80,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <p@plt>
movb   $0x7f,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <p@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    $0x80,%edi
call   1030 <p@plt>
mov    $0x7f,%edi
call   1030 <p@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"c: %c\0A\00"
@.str.1 = [7 x i8] c"d: %d\0A\00"
@.str.2 = [7 x i8] c"u: %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 5, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %5)
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %7)
store i8 -128, i8* %2
%9 = load i8, i8* %2
%10 = call i32 @p(i8 zeroext %9)
store i8 127, i8* %2
%11 = load i8, i8* %2
%12 = call i32 @p(i8 zeroext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"c: %c\0A\00"
@.str.1 = [7 x i8] c"d: %d\0A\00"
@.str.2 = [7 x i8] c"u: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 zeroext 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8 zeroext 5)
%4 = tail call i32 @p(i8 zeroext -128)
%5 = tail call i32 @p(i8 zeroext 127)
ret i32 0
}
/* Type definitions */
struct bgpq_request {
  int dummy;
};
struct bgpq_expander {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bgpq_expander_add_as(struct bgpq_expander *, char *);
int bgpq_expanded_macro(char *as, struct bgpq_expander *ex,
                        struct bgpq_request *req) {
  bgpq_expander_add_as(ex, as);
  return 1;
}


x86 assembly (clang, -O0):
<bgpq_expanded_macro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <bgpq_expander_add_as@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgpq_expanded_macro>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <bgpq_expander_add_as@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bgpq_expander = type { i32 }
%struct.bgpq_request = type { i32 }
define i32 @bgpq_expanded_macro(i8* %0, %struct.bgpq_expander* %1, %struct.bgpq_request* %2) {
%4 = alloca i8*
%5 = alloca %struct.bgpq_expander*
%6 = alloca %struct.bgpq_request*
store i8* %0, i8** %4
store %struct.bgpq_expander* %1, %struct.bgpq_expander** %5
store %struct.bgpq_request* %2, %struct.bgpq_request** %6
%7 = load %struct.bgpq_expander*, %struct.bgpq_expander** %5
%8 = load i8*, i8** %4
%9 = call i32 @bgpq_expander_add_as(%struct.bgpq_expander* %7, i8* %8)
ret i32 1
}

LLVM IR (-O2):
%struct.bgpq_expander = type { i32 }
%struct.bgpq_request = type { i32 }
define i32 @bgpq_expanded_macro(i8* %0, %struct.bgpq_expander* %1, %struct.bgpq_request* nocapture readnone %2) {
%4 = tail call i32 @bgpq_expander_add_as(%struct.bgpq_expander* %1, i8* %0)
ret i32 1
}
void g_object_class_install_property() {}


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

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

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

LLVM IR (-O2):
define void @g_object_class_install_property() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void delete_string(char *str) {
  if (!str)
    return;
  free(str);
}


x86 assembly (clang, -O0):
<delete_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <delete_string+0x1c>
jmp    1135 <delete_string+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_string>:
test   %rdi,%rdi
je     111a <delete_string+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @delete_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @delete_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
const char *sblib_get_module_name() { return "example"; }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"example\00"
define i8* @sblib_get_module_name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"example\00"
define i8* @sblib_get_module_name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void _delay_ms(int ms) { usleep(ms * 1000); }


x86 assembly (clang, -O0):
<_delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_delay_ms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @_delay_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @_delay_ms(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Type definitions */
struct VectorBase {
  int dummy;
};
struct MixSegment {
  int dummy;
};

/* Variables and functions */
struct VectorBase *GetSegmentVector(struct MixSegment *, char const *);
struct VectorBase *vector_result(struct MixSegment *handle, const char *code) {
  return GetSegmentVector(handle, code);
}


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

x86 assembly (clang, -O2):
<vector_result>:
jmp    1030 <GetSegmentVector@plt>

LLVM IR (-O0):
%struct.VectorBase = type { i32 }
%struct.MixSegment = type { i32 }
define %struct.VectorBase* @vector_result(%struct.MixSegment* %0, i8* %1) {
%3 = alloca %struct.MixSegment*
%4 = alloca i8*
store %struct.MixSegment* %0, %struct.MixSegment** %3
store i8* %1, i8** %4
%5 = load %struct.MixSegment*, %struct.MixSegment** %3
%6 = load i8*, i8** %4
%7 = call %struct.VectorBase* @GetSegmentVector(%struct.MixSegment* %5, i8* %6)
ret %struct.VectorBase* %7
}

LLVM IR (-O2):
%struct.VectorBase = type { i32 }
%struct.MixSegment = type { i32 }
define %struct.VectorBase* @vector_result(%struct.MixSegment* %0, i8* %1) {
%3 = tail call %struct.VectorBase* @GetSegmentVector(%struct.MixSegment* %0, i8* %1)
ret %struct.VectorBase* %3
}
void X509_REVOKED_get_ext_d2i(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REVOKED_get_ext_d2i() {
ret void
}
/* Variables and functions */
char *filename_to_print(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, unsigned int,
                           char const *, char const *);
int /*<<< orphan*/ stderr;
void lace_log_warning_(const char *file, const char *func, unsigned line,
                       const char *msg) {
  fprintf(stderr, "WARNING %s(%u) in %s: %s\n", filename_to_print(file), line,
          func, msg);
}


x86 assembly (clang, -O0):
<lace_log_warning_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <filename_to_print@plt>
mov    -0x24(%rbp),%edi
mov    %rax,%rdx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lace_log_warning_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r15
mov    0x2eaa(%rip),%rax
mov    (%rax),%ebx
call   1040 <filename_to_print@plt>
lea    0xebc(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
mov    %ebp,%ecx
mov    %r15,%r8
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"WARNING %s(%u) in %s: %s\0A\00"
define void @lace_log_warning_(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = call i8* @filename_to_print(i8* %10)
%12 = load i32, i32* %7
%13 = load i8*, i8** %6
%14 = load i8*, i8** %8
%15 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"WARNING %s(%u) in %s: %s\0A\00"
define void @lace_log_warning_(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i8* @filename_to_print(i8* %0)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %2, i8* %1, i8* %3)
ret void
}
int t1(int X) { return __builtin_clz(X); }


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

x86 assembly (clang, -O2):
<t1>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @t1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @t1(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
union bpf_attr {
  int map_fd;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_FREEZE;
int /*<<< orphan*/ memset(union bpf_attr *, int /*<<< orphan*/, int);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_map_freeze(int fd) {
  union bpf_attr attr;
  memset(&attr, 0, sizeof(attr));
  attr.map_fd = fd;
  return sys_bpf(BPF_MAP_FREEZE, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_map_freeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_map_freeze>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %ebx,(%rsp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_MAP_FREEZE = global i32 0
define i32 @bpf_map_freeze(i32 %0) {
%2 = alloca i32
%3 = alloca %union.bpf_attr
store i32 %0, i32* %2
%4 = call i32 @memset(%union.bpf_attr* %3, i32 0, i32 4)
%5 = load i32, i32* %2
%6 = bitcast %union.bpf_attr* %3 to i32*
store i32 %5, i32* %6
%7 = load i32, i32* @BPF_MAP_FREEZE
%8 = call i32 @sys_bpf(i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_MAP_FREEZE = global i32 0
define i32 @bpf_map_freeze(i32 %0) {
%2 = alloca %union.bpf_attr
%3 = bitcast %union.bpf_attr* %2 to i8*
%4 = call i32 @memset(%union.bpf_attr* %2, i32 0, i32 4)
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %2, i64 0, i32 0
store i32 %0, i32* %5
%6 = load i32, i32* @BPF_MAP_FREEZE
%7 = call i32 @sys_bpf(i32 %6, %union.bpf_attr* %2, i32 4)
ret i32 %7
}
unsigned int I2CMasterIntRawStatusEx(unsigned int baseAdd,
                                     unsigned int intFlag) {
  return (((*((volatile unsigned int *)(baseAdd + (0x24))))) & (intFlag));
}


x86 assembly (clang, -O0):
<I2CMasterIntRawStatusEx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntRawStatusEx>:
mov    %esi,%eax
add    $0x24,%edi
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @I2CMasterIntRawStatusEx(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 = add i32 %5, 36
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = load i32, i32* %4
%11 = and i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @I2CMasterIntRawStatusEx(i32 %0, i32 %1) {
%3 = add i32 %0, 36
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, %1
ret i32 %7
}
void g_slice_alloc() {}


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

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

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

LLVM IR (-O2):
define void @g_slice_alloc() {
ret void
}
/* Variables and functions */
char *alloc(unsigned int);
int /*<<< orphan*/ alloc_free(char *);
int /*<<< orphan*/ byte_copy(char *, unsigned int, char *);
int alloc_re(char **x, unsigned int m, unsigned int n) {
  char *y = (char *)0;
  y = alloc(n);
  if (!y)
    return 0;
  byte_copy(y, m, *x);
  alloc_free(*x);
  *x = y;
  return 1;
}


x86 assembly (clang, -O0):
<alloc_re>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116d <alloc_re+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    119e <alloc_re+0x6e>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
call   1050 <byte_copy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <alloc_free@plt>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_re>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %edx,%edi
call   1040 <alloc@plt>
test   %rax,%rax
je     1167 <alloc_re+0x37>
mov    %rax,%rbx
mov    (%r14),%rdx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <byte_copy@plt>
mov    (%r14),%rdi
call   1030 <alloc_free@plt>
mov    %rbx,(%r14)
mov    $0x1,%eax
jmp    1169 <alloc_re+0x39>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @alloc_re(i8** %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* null, i8** %8
%9 = load i32, i32* %7
%10 = call i8* @alloc(i32 %9)
store i8* %10, i8** %8
%11 = load i8*, i8** %8
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %3
store i32 0, i32* %4
br label %25
14: ; preds = %3
%15 = load i8*, i8** %8
%16 = load i32, i32* %6
%17 = load i8**, i8*** %5
%18 = load i8*, i8** %17
%19 = call i32 @byte_copy(i8* %15, i32 %16, i8* %18)
%20 = load i8**, i8*** %5
%21 = load i8*, i8** %20
%22 = call i32 @alloc_free(i8* %21)
%23 = load i8*, i8** %8
%24 = load i8**, i8*** %5
store i8* %23, i8** %24
store i32 1, i32* %4
br label %25
25: ; preds = %14, %13
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @alloc_re(i8** nocapture %0, i32 %1, i32 %2) {
%4 = tail call i8* @alloc(i32 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = tail call i32 @byte_copy(i8* %4, i32 %1, i8* %7)
%9 = load i8*, i8** %0
%10 = tail call i32 @alloc_free(i8* %9)
store i8* %4, i8** %0
br label %11
11: ; preds = %3, %6
%12 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *print_xs(void *unuse) {
  while (1) {
    printf("x\n");
    sleep(1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<print_xs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112c <print_xs+0xc>

x86 assembly (clang, -O2):
<print_xs>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <print_xs+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"x\0A\00"
define i8* @print_xs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@str = [2 x i8] c"x\00"
define noalias i8* @print_xs(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 1)
br label %2
}
void g_key_file_set_locale_string_list() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_set_locale_string_list() {
ret void
}
/* Variables and functions */
int exp2(double);
double fpu_f2xm1(double a) {
  double b;
  b = exp2(a) - 1;
  return b;
}


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

x86 assembly (clang, -O2):
<fpu_f2xm1>:
push   %rax
call   1030 <exp2@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fpu_f2xm1(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @exp2(double %4)
%6 = sub nsw i32 %5, 1
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @fpu_f2xm1(double %0) {
%2 = tail call i32 @exp2(double %0)
%3 = add nsw i32 %2, -1
%4 = sitofp i32 %3 to double
ret double %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ MurmurHash3_x64_128(void const *, size_t, int, scalar_t__ *);
size_t strlen(char *);
unsigned int murmur3_simple(const void *keyptr) {
  size_t len = strlen((char *)keyptr);
  uint64_t hash[2];
  MurmurHash3_x64_128(keyptr, len, 0xdeadbeef, hash);
  return (unsigned int)hash[1];
}


x86 assembly (clang, -O0):
<murmur3_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rcx
mov    $0xdeadbeef,%edx
call   1040 <MurmurHash3_x64_128@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<murmur3_simple>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rsp,%rcx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0xdeadbeef,%edx
call   1040 <MurmurHash3_x64_128@plt>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @murmur3_simple(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca [2 x i64]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
%10 = call i32 @MurmurHash3_x64_128(i8* %7, i64 %8, i32 -559038737, i64* %9)
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @murmur3_simple(i8* %0) {
%2 = alloca [2 x i64]
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = bitcast [2 x i64]* %2 to i8*
%5 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%6 = call i32 @MurmurHash3_x64_128(i8* %0, i64 %3, i32 -559038737, i64* %5)
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void AnsiTerm_bg24_set(uint8_t r, uint8_t g, uint8_t b) {
  printf("\x1B[48;2;%d;%d;%dm", r, g, b);
}


x86 assembly (clang, -O0):
<AnsiTerm_bg24_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AnsiTerm_bg24_set>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\1B[48;2;%d;%d;%dm\00"
define void @AnsiTerm_bg24_set(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\1B[48;2;%d;%d;%dm\00"
define void @AnsiTerm_bg24_set(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
pair(n) { return (n / 10 + '0' | (n % 10 + '0') << 8); }


x86 assembly (clang, -O0):
<pair>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
mov    %edx,%ecx
add    $0x30,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%esi
add    $0x30,%esi
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
shl    $0x8,%eax
add    $0x3000,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @pair(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = add nsw i32 %4, 48
%6 = load i32, i32* %2
%7 = srem i32 %6, 10
%8 = add nsw i32 %7, 48
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @pair(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = add nsw i32 %2, 48
%4 = srem i32 %0, 10
%5 = shl nsw i32 %4, 8
%6 = add nsw i32 %5, 12288
%7 = or i32 %6, %3
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ mem_copy_word2word_big(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ const);
uint16_t arch_mem_copy_word2word_big(uint16_t *word_d, const uint16_t word_s) {
  return mem_copy_word2word_big(word_d, word_s);
}


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

x86 assembly (clang, -O2):
<arch_mem_copy_word2word_big>:
jmp    1030 <mem_copy_word2word_big@plt>

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

LLVM IR (-O2):
define i32 @arch_mem_copy_word2word_big(i32* %0, i32 %1) {
%3 = tail call i32 @mem_copy_word2word_big(i32* %0, i32 %1)
ret i32 %3
}
int _max(int x, int y) {
  int result = y;
  if (x > y) {
    result = x;
  }
  return result;
}


x86 assembly (clang, -O0):
<_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1122 <_max+0x22>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t const);
void *Malloc(const size_t size) {
  return malloc(size);
  return malloc((size + 3) & (~0x3));
}


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

x86 assembly (clang, -O2):
<Malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
unsigned int hash_string(const void *key) {
  const char *str = (const char *)key;
  unsigned int hash = 5381;
  unsigned int c;
  while ((c = (unsigned int)*str)) {
    hash = ((hash << 5) + hash) + c;
    str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     114a <hash_string+0x4a>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hash_string+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash_string+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash_string+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %7, 33
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
int f(float x) { return (int)x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cvttss2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @f(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ matNd_print(double const *, int);
void mat3d_print(const double m[9]) { matNd_print(m, 3); }


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

x86 assembly (clang, -O2):
<mat3d_print>:
mov    $0x3,%esi
jmp    1030 <matNd_print@plt>

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

LLVM IR (-O2):
define void @mat3d_print(double* %0) {
%2 = tail call i32 @matNd_print(double* %0, i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_disconnection_complete_get_reason(const uint8_t *event) {
  return event[5];
}


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

x86 assembly (clang, -O2):
<hci_event_disconnection_complete_get_reason>:
mov    0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hci_event_disconnection_complete_get_reason(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_disconnection_complete_get_reason(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
ret i32 %3
}
char *mantail_of(char *name) {
  char *s0, *s1, *s;
  s0 = s1 = 0;
  for (s = name; *s; s++) {
    if (*s == '/') {
      s0 = s1;
      s1 = s;
    }
  }
  return s0;
}


x86 assembly (clang, -O0):
<mantail_of>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <mantail_of+0x63>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    114d <mantail_of+0x4d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <mantail_of+0x52>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1120 <mantail_of+0x20>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mantail_of>:
xor    %eax,%eax
xor    %ecx,%ecx
jmp    111a <mantail_of+0x1a>
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,%rax
mov    %rdi,%rcx
add    $0x1,%rdi
movzbl (%rdi),%edx
cmp    $0x2f,%dl
je     1110 <mantail_of+0x10>
test   %dl,%dl
jne    1116 <mantail_of+0x16>
ret

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

LLVM IR (-O2):
define i8* @mantail_of(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ null, %1 ], [ %9, %8 ]
%4 = phi i8* [ null, %1 ], [ %10, %8 ]
%5 = phi i8* [ %0, %1 ], [ %11, %8 ]
%6 = load i8, i8* %5
switch i8 %6, label %8 [
i8 0, label %12
i8 47, label %7
]
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i8* [ %4, %7 ], [ %3, %2 ]
%10 = phi i8* [ %5, %7 ], [ %4, %2 ]
%11 = getelementptr inbounds i8, i8* %5, i64 1
br label %2
12: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *itoa(int i) {
  char *s = malloc(10);
  sprintf(s, "%d", i);
  return s;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @itoa(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 10)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @itoa(i32 %0) {
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ find(int);
int main() {
  int i;
  for (i = 2; i <= 15; i++) {
    find(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jg     1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <find@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <find@plt>
mov    $0x3,%edi
call   1030 <find@plt>
mov    $0x4,%edi
call   1030 <find@plt>
mov    $0x5,%edi
call   1030 <find@plt>
mov    $0x6,%edi
call   1030 <find@plt>
mov    $0x7,%edi
call   1030 <find@plt>
mov    $0x8,%edi
call   1030 <find@plt>
mov    $0x9,%edi
call   1030 <find@plt>
mov    $0xa,%edi
call   1030 <find@plt>
mov    $0xb,%edi
call   1030 <find@plt>
mov    $0xc,%edi
call   1030 <find@plt>
mov    $0xd,%edi
call   1030 <find@plt>
mov    $0xe,%edi
call   1030 <find@plt>
mov    $0xf,%edi
call   1030 <find@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @find(i32 2)
%2 = tail call i32 @find(i32 3)
%3 = tail call i32 @find(i32 4)
%4 = tail call i32 @find(i32 5)
%5 = tail call i32 @find(i32 6)
%6 = tail call i32 @find(i32 7)
%7 = tail call i32 @find(i32 8)
%8 = tail call i32 @find(i32 9)
%9 = tail call i32 @find(i32 10)
%10 = tail call i32 @find(i32 11)
%11 = tail call i32 @find(i32 12)
%12 = tail call i32 @find(i32 13)
%13 = tail call i32 @find(i32 14)
%14 = tail call i32 @find(i32 15)
ret i32 0
}
/* Type definitions */
typedef int u_int16_t;
struct ibuf {
  int dummy;
};

/* Variables and functions */
int ibuf_add(struct ibuf *, void const *, int);
int /*<<< orphan*/ ibuf_free(struct ibuf *);
int imsg_add(struct ibuf *msg, const void *data, u_int16_t datalen) {
  if (datalen)
    if (ibuf_add(msg, data, datalen) == -1) {
      ibuf_free(msg);
      return (-1);
    }
  return (datalen);
}


x86 assembly (clang, -O0):
<imsg_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1170 <imsg_add+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <ibuf_add@plt>
cmp    $0xffffffff,%eax
jne    116b <imsg_add+0x4b>
mov    -0x10(%rbp),%rdi
call   1030 <ibuf_free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <imsg_add+0x56>
jmp    1170 <imsg_add+0x50>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imsg_add>:
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
je     1146 <imsg_add+0x26>
mov    %edx,%ebx
mov    %rdi,%r14
call   1040 <ibuf_add@plt>
cmp    $0xffffffff,%eax
jne    1148 <imsg_add+0x28>
mov    %r14,%rdi
call   1030 <ibuf_free@plt>
mov    $0xffffffff,%ebx
jmp    1148 <imsg_add+0x28>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ibuf = type { i32 }
define i32 @imsg_add(%struct.ibuf* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.ibuf*
%6 = alloca i8*
%7 = alloca i32
store %struct.ibuf* %0, %struct.ibuf** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load %struct.ibuf*, %struct.ibuf** %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @ibuf_add(%struct.ibuf* %11, i8* %12, i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load %struct.ibuf*, %struct.ibuf** %5
%18 = call i32 @ibuf_free(%struct.ibuf* %17)
store i32 -1, i32* %4
br label %22
19: ; preds = %10
br label %20
20: ; preds = %19, %3
%21 = load i32, i32* %7
store i32 %21, i32* %4
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
%struct.ibuf = type { i32 }
define i32 @imsg_add(%struct.ibuf* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @ibuf_add(%struct.ibuf* %0, i8* %1, i32 %2)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @ibuf_free(%struct.ibuf* %0)
br label %10
10: ; preds = %3, %5, %8
%11 = phi i32 [ -1, %8 ], [ %2, %5 ], [ 0, %3 ]
ret i32 %11
}