xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ calcCSum(unsigned char *);
scalar_t__ getCSum(unsigned char *);
int isValidPacket(unsigned char *packet) {
  if (packet[0] != 0x55)
    return -1;
  if (calcCSum(packet) != getCSum(packet))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<isValidPacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x55,%eax
je     1148 <isValidPacket+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <isValidPacket+0x61>
mov    -0x10(%rbp),%rdi
call   1040 <calcCSum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getCSum@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     117a <isValidPacket+0x5a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <isValidPacket+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidPacket>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%eax
cmpb   $0x55,(%rdi)
jne    114e <isValidPacket+0x2e>
mov    %rdi,%rbx
call   1040 <calcCSum@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <getCSum@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%r14
setne  %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @isValidPacket(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp ne i32 %7, 85
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %18
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i64 @calcCSum(i8* %11)
%13 = load i8*, i8** %3
%14 = call i64 @getCSum(i8* %13)
%15 = icmp ne i64 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 -1, i32* %2
br label %18
17: ; preds = %10
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @isValidPacket(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 85
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i64 @calcCSum(i8* %0)
%6 = tail call i64 @getCSum(i8* %0)
%7 = icmp ne i64 %5, %6
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ -1, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least32_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ endian_32(int /*<<< orphan*/ const, int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const);
uint_least32_t endian_big32(const uint8_t ptr[4]) {
  return endian_32(ptr[0], ptr[1], ptr[2], ptr[3]);
}


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

x86 assembly (clang, -O2):
<endian_big32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%esi
mov    0x8(%rdi),%edx
mov    0xc(%rdi),%ecx
mov    %eax,%edi
jmp    1030 <endian_32@plt>

LLVM IR (-O0):
define i32 @endian_big32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 3
%14 = load i32, i32* %13
%15 = call i32 @endian_32(i32 %5, i32 %8, i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @endian_big32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = tail call i32 @endian_32(i32 %2, i32 %4, i32 %6, i32 %8)
ret i32 %9
}
void XSharpFreeFontStruct(void *dpy, void *fontSet) {}


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

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

LLVM IR (-O0):
define void @XSharpFreeFontStruct(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @XSharpFreeFontStruct(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ matrixScalarProduct(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *, int);
GLdouble matrixVectorNormSq(GLdouble *vector, int size) {
  return matrixScalarProduct(vector, vector, size);
}


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

x86 assembly (clang, -O2):
<matrixVectorNormSq>:
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <matrixScalarProduct@plt>

LLVM IR (-O0):
define i32 @matrixVectorNormSq(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** %3
%7 = load i32, i32* %4
%8 = call i32 @matrixScalarProduct(i32* %5, i32* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @matrixVectorNormSq(i32* %0, i32 %1) {
%3 = tail call i32 @matrixScalarProduct(i32* %0, i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsrp(char *, void *);
void wsrp(void *v) { __builtin_arm_wsrp("1:2:3:4:5", v); }


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

x86 assembly (clang, -O2):
<wsrp>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <__builtin_arm_wsrp@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"1:2:3:4:5\00"
define void @wsrp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__builtin_arm_wsrp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"1:2:3:4:5\00"
define void @wsrp(i8* %0) {
%2 = tail call i32 @__builtin_arm_wsrp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_string(char *, char *);
void show_msg(const char *msg) { show_string("dlldebugmessage", (char *)msg); }


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

x86 assembly (clang, -O2):
<show_msg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <show_string@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"dlldebugmessage\00"
define void @show_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @show_string(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"dlldebugmessage\00"
define void @show_msg(i8* %0) {
%2 = tail call i32 @show_string(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void rop3_154_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


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

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

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

LLVM IR (-O2):
define void @rop3_154_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = xor i8 %6, %5
%8 = and i8 %6, %1
%9 = and i8 %7, %4
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ joystick_update();
int /*<<< orphan*/ tape_update_output();
int /*<<< orphan*/ update_sound();
void pia1a_data_postwrite(void) {
  update_sound();
  joystick_update();
  tape_update_output();
}


x86 assembly (clang, -O0):
<pia1a_data_postwrite>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <update_sound@plt>
mov    $0x0,%al
call   1030 <joystick_update@plt>
mov    $0x0,%al
call   1040 <tape_update_output@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pia1a_data_postwrite>:
push   %rax
xor    %eax,%eax
call   1050 <update_sound@plt>
xor    %eax,%eax
call   1030 <joystick_update@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <tape_update_output@plt>

LLVM IR (-O0):
define void @pia1a_data_postwrite() {
%1 = call i32 (...) @update_sound()
%2 = call i32 (...) @joystick_update()
%3 = call i32 (...) @tape_update_output()
ret void
}

LLVM IR (-O2):
define void @pia1a_data_postwrite() {
%1 = tail call i32 (...) @update_sound()
%2 = tail call i32 (...) @joystick_update()
%3 = tail call i32 (...) @tape_update_output()
ret void
}
unsigned char readButtons() {
  unsigned int *data = ((unsigned int *)0x50033FFC);
  unsigned char buttons = *data & 0xF;
  return ~buttons;
}


x86 assembly (clang, -O0):
<readButtons>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50033ffc,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readButtons>:
mov    0x50033ffc,%al
not    %al
or     $0xf0,%al
ret

LLVM IR (-O0):
define zeroext i8 @readButtons() {
%1 = alloca i32*
%2 = alloca i8
store i32* inttoptr (i64 1342390268 to i32*), i32** %1
%3 = load i32*, i32** %1
%4 = load i32, i32* %3
%5 = and i32 %4, 15
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = xor i32 %8, -1
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @readButtons() {
%1 = load i32, i32* inttoptr (i64 1342390268 to i32*)
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 15
%4 = xor i8 %3, -1
ret i8 %4
}
void init_required_fw_features(void) {
  extern void _init_focus_eventflag();
  extern void _init_nd_eventflag();
  extern void _init_nd_semaphore();
  _init_focus_eventflag();
  _init_nd_eventflag();
  _init_nd_semaphore();
}


x86 assembly (clang, -O0):
<init_required_fw_features>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <_init_focus_eventflag@plt>
mov    $0x0,%al
call   1030 <_init_nd_eventflag@plt>
mov    $0x0,%al
call   1050 <_init_nd_semaphore@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_required_fw_features>:
push   %rax
xor    %eax,%eax
call   1040 <_init_focus_eventflag@plt>
xor    %eax,%eax
call   1030 <_init_nd_eventflag@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <_init_nd_semaphore@plt>

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

LLVM IR (-O2):
define void @init_required_fw_features() {
tail call void (...) @_init_focus_eventflag()
tail call void (...) @_init_nd_eventflag()
tail call void (...) @_init_nd_semaphore()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reglib_is_alpha2(char const *);
int /*<<< orphan*/ reglib_is_world_regdom(char const *);
int reglib_is_valid_regdom(const char *alpha2) {
  if (!reglib_is_alpha2(alpha2) && !reglib_is_world_regdom(alpha2))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<reglib_is_valid_regdom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <reglib_is_alpha2@plt>
cmp    $0x0,%eax
jne    115c <reglib_is_valid_regdom+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <reglib_is_world_regdom@plt>
cmp    $0x0,%eax
jne    115c <reglib_is_valid_regdom+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1163 <reglib_is_valid_regdom+0x43>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reglib_is_valid_regdom>:
push   %rbx
mov    %rdi,%rbx
call   1030 <reglib_is_alpha2@plt>
test   %eax,%eax
jne    1139 <reglib_is_valid_regdom+0x19>
mov    %rbx,%rdi
call   1040 <reglib_is_world_regdom@plt>
test   %eax,%eax
je     1140 <reglib_is_valid_regdom+0x20>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @reglib_is_valid_regdom(i8* %0) {
%2 = tail call i32 @reglib_is_alpha2(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @reglib_is_world_regdom(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 1, %7 ], [ 0, %4 ]
ret i32 %9
}
int isAbsolute(char path[64]) {
  if (path[0] != '/')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isAbsolute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1124 <isAbsolute+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <isAbsolute+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAbsolute>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
setne  %al
ret

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

LLVM IR (-O2):
define i32 @isAbsolute(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int inpd(scalar_t__);
int /*<<< orphan*/ outpd(scalar_t__, scalar_t__);
uint8_t ahci_ctrl_is_bit_set(uint16_t iobase, uint16_t reg, uint32_t mask) {
  outpd(iobase + 0, reg);
  return (inpd(iobase + 4) & mask) != 0;
}


x86 assembly (clang, -O0):
<ahci_ctrl_is_bit_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x0,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <outpd@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1040 <inpd@plt>
and    -0x14(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ahci_ctrl_is_bit_set>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <outpd@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
call   1040 <inpd@plt>
xor    %ecx,%ecx
test   %ebp,%eax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ahci_ctrl_is_bit_set(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = add nsw i64 %7, 0
%9 = load i64, i64* %5
%10 = call i32 @outpd(i64 %8, i64 %9)
%11 = load i64, i64* %4
%12 = add nsw i64 %11, 4
%13 = call i32 @inpd(i64 %12)
%14 = load i32, i32* %6
%15 = and i32 %13, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @ahci_ctrl_is_bit_set(i64 %0, i64 %1, i32 %2) {
%4 = tail call i32 @outpd(i64 %0, i64 %1)
%5 = add nsw i64 %0, 4
%6 = tail call i32 @inpd(i64 %5)
%7 = and i32 %6, %2
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
double f(double x, double y) { return 0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @f(double %0, double %1) {
ret double 0.000000e+00
}
void nestedLoop(int n, int m, int N) {
  int i, j, k;
  if (0 <= n && 0 <= m && 0 <= N) {
    i = 0;
    while (i < n) {
      j = 0;
      while (j < m) {
        j += 1;
        k = i;
        while (k < N)
          k += 1;
        i = k;
      }
      ++i;
    }
  }
}


x86 assembly (clang, -O0):
<nestedLoop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jg     119b <nestedLoop+0x9b>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     119b <nestedLoop+0x9b>
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jg     119b <nestedLoop+0x9b>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1196 <nestedLoop+0x96>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1188 <nestedLoop+0x88>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117d <nestedLoop+0x7d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1163 <nestedLoop+0x63>
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <nestedLoop+0x48>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <nestedLoop+0x35>
jmp    119b <nestedLoop+0x9b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nestedLoop(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = icmp sle i32 0, %10
br i1 %11, label %12, label %45
12: ; preds = %3
%13 = load i32, i32* %5
%14 = icmp sle i32 0, %13
br i1 %14, label %15, label %45
15: ; preds = %12
%16 = load i32, i32* %6
%17 = icmp sle i32 0, %16
br i1 %17, label %18, label %45
18: ; preds = %15
store i32 0, i32* %7
br label %19
19: ; preds = %41, %18
%20 = load i32, i32* %7
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %44
23: ; preds = %19
store i32 0, i32* %8
br label %24
24: ; preds = %39, %23
%25 = load i32, i32* %8
%26 = load i32, i32* %5
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %41
28: ; preds = %24
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
store i32 %30, i32* %8
%31 = load i32, i32* %7
store i32 %31, i32* %9
br label %32
32: ; preds = %36, %28
%33 = load i32, i32* %9
%34 = load i32, i32* %6
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %39
36: ; preds = %32
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
store i32 %38, i32* %9
br label %32
39: ; preds = %32
%40 = load i32, i32* %9
store i32 %40, i32* %7
br label %24
41: ; preds = %24
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
br label %19
44: ; preds = %19
br label %45
45: ; preds = %44, %15, %12, %3
ret void
}

LLVM IR (-O2):
define void @nestedLoop(i32 %0, i32 %1, i32 %2) {
ret void
}
void set_fd_path(void *value_addr, int fd, const char *path) {
  *((int *)value_addr) = fd;
  value_addr += sizeof(int *);
  *((const char **)value_addr) = path;
}


x86 assembly (clang, -O0):
<set_fd_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_fd_path>:
mov    %esi,(%rdi)
mov    %rdx,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @set_fd_path(i8* nocapture writeonly %0, i32 %1, i8* %2) {
%4 = bitcast i8* %0 to i32*
store i32 %1, i32* %4
%5 = getelementptr i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i8**
store i8* %2, i8** %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo(int i) {
  if (i > 1)
    return;
  bar();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112a <foo+0x1a>
jmp    1131 <foo+0x21>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x1,%edi
jle    1116 <foo+0x6>
ret
xor    %eax,%eax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = call i32 (...) @bar()
br label %8
8: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %1, %3
ret void
}
float constrain(float v, float min, float max) {
  if (v < min)
    return min;
  else if (v > max)
    return max;
  else
    return v;
}


x86 assembly (clang, -O0):
<constrain>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <constrain+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <constrain+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <constrain+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <constrain+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<constrain>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define float @constrain(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
void homekit_mdns_add_txt(const char *key, const char *format, ...) {}


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

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

LLVM IR (-O0):
define void @homekit_mdns_add_txt(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @homekit_mdns_add_txt(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t divide_ceiling(uint32_t a, uint32_t b) {
  uint32_t ret = a / b;
  if (a % b)
    ret += 1;
  return ret;
}


x86 assembly (clang, -O0):
<divide_ceiling>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     112d <divide_ceiling+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_ceiling>:
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @divide_ceiling(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* %3
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @divide_ceiling(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ double_matrix_multiplication();
int /*<<< orphan*/ double_sub_matrix();
void closed_loop(void) {
  double_matrix_multiplication();
  double_sub_matrix();
}


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

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

LLVM IR (-O0):
define void @closed_loop() {
%1 = call i32 (...) @double_matrix_multiplication()
%2 = call i32 (...) @double_sub_matrix()
ret void
}

LLVM IR (-O2):
define void @closed_loop() {
%1 = tail call i32 (...) @double_matrix_multiplication()
%2 = tail call i32 (...) @double_sub_matrix()
ret void
}
char *my_index(str, chr) const char *str;
int chr;
{
  while (*str) {
    if (*str == chr) {
      return (char *)str;
    }
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <my_index+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <my_index+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <my_index+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <my_index+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_index>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <my_index+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <my_index+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <my_index+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @my_index(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
extern __attribute__((always_)) void android_compiler_barrier() {
  __asm__ __volatile__("" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @android_compiler_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: bigfile-set-attr [-t dtype] [-n nmemb] filepath "
                  "block attr val \n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"usage: bigfile-set-attr [-t dtype] [-n nmemb] filepath block attr val \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"usage: bigfile-set-attr [-t dtype] [-n nmemb] filepath block attr val \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int **malloc(int);
int main(void) {
  int(*p)[10] = malloc(sizeof(int) * 10);
  (*p)[1] = 42;
  (*(long(*)[10])p)[1] = 42;
  return (*p)[1];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2a,0x4(%rax)
mov    -0x10(%rbp),%rax
movq   $0x2a,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    $0x2a,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]*
store i32 0, i32* %1
%3 = call i32** @malloc(i32 40)
%4 = bitcast i32** %3 to [10 x i32]*
store [10 x i32]* %4, [10 x i32]** %2
%5 = load [10 x i32]*, [10 x i32]** %2
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 1
store i32 42, i32* %6
%7 = load [10 x i32]*, [10 x i32]** %2
%8 = bitcast [10 x i32]* %7 to [10 x i64]*
%9 = getelementptr inbounds [10 x i64], [10 x i64]* %8, i64 0, i64 1
store i64 42, i64* %9
%10 = load [10 x i32]*, [10 x i32]** %2
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %10, i64 0, i64 1
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32** @malloc(i32 40)
ret i32 42
}
/* Variables and functions */
int gmx_trjorder(int, char **);
int main(int argc, char *argv[]) { return gmx_trjorder(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_trjorder@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <gmx_trjorder@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_trjorder(i32 %0, i8** %1)
ret i32 %3
}
void rop3_108_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & T;
  stk1 = S ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

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

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

LLVM IR (-O2):
define void @rop3_108_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = xor i8 %5, %1
%7 = xor i8 %2, -1
%8 = or i8 %6, %7
%9 = and i8 %8, %1
%10 = xor i8 %1, -1
%11 = and i8 %5, %10
%12 = or i8 %9, %11
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
double genrand_int32();
double random_double2(double n) {
  return n * (genrand_int32() / (double)4294967295.0);
}


x86 assembly (clang, -O0):
<random_double2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <genrand_int32@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_double2>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <genrand_int32@plt>
divsd  0xedb(%rip),%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @random_double2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double (...) @genrand_int32()
%5 = fdiv double %4, 0x41EFFFFFFFE00000
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @random_double2(double %0) {
%2 = tail call double (...) @genrand_int32()
%3 = fdiv double %2, 0x41EFFFFFFFE00000
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int strlen(char const *);
int /*<<< orphan*/ strncat(char *, char const *, size_t const);
void smartcat(char *p1, const size_t s1, const char *p2) {
  assert(s1 > strlen(p1) + strlen(p2) + 1);
  strncat(p1, p2, s1);
}


x86 assembly (clang, -O0):
<smartcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%ecx
mov    %eax,%edx
mov    -0x20(%rbp),%rax
add    %edx,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <strncat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smartcat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%r12d
mov    %r15,%rdi
call   1030 <strlen@plt>
add    %r12d,%eax
add    $0x1,%eax
cltq
xor    %edi,%edi
cmp    %r14,%rax
setb   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <strncat@plt>

LLVM IR (-O0):
define void @smartcat(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %5
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = add nsw i32 %9, %11
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = icmp ugt i64 %7, %14
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i8*, i8** %4
%19 = load i8*, i8** %6
%20 = load i64, i64* %5
%21 = call i32 @strncat(i8* %18, i8* %19, i64 %20)
ret void
}

LLVM IR (-O2):
define void @smartcat(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %2)
%6 = add i32 %4, 1
%7 = add i32 %6, %5
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, %1
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = tail call i32 @strncat(i8* %0, i8* %2, i64 %1)
ret void
}
__attribute__((always_)) void out_fatal_discard(const char *file, int line,
                                                const char *func,
                                                const char *fmt, ...) {
  (void)file;
  (void)line;
  (void)func;
  (void)fmt;
}


x86 assembly (clang, -O0):
<out_fatal_discard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @out_fatal_discard(i8* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3, ...) {
ret void
}
void rcu_preempt_remove_callbacks(struct rcu_ctrlblk *rcp) {}


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

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

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

LLVM IR (-O2):
%struct.rcu_ctrlblk = type opaque
define void @rcu_preempt_remove_callbacks(%struct.rcu_ctrlblk* nocapture %0) {
ret void
}
const char XORChar(const char a, const char b) { return (a == b ? '0' : '1'); }


x86 assembly (clang, -O0):
<XORChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edx
movsbl -0x2(%rbp),%esi
mov    $0x31,%eax
mov    $0x30,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XORChar>:
cmp    %sil,%dil
sete   %al
xor    $0x31,%al
ret

LLVM IR (-O0):
define signext i8 @XORChar(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 48, i32 49
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @XORChar(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = select i1 %3, i8 48, i8 49
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ pout(char *, char *);
int /*<<< orphan*/ skip(char *, char);
int /*<<< orphan*/ sout(char *, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
void parsesrv(char *cmd) {
  skip(cmd, '\r');
  if (!strncmp("PING ", cmd, 5)) {
    sout("PONG %s", cmd + 5);
  }
  pout("%s\n", cmd);
}


x86 assembly (clang, -O0):
<parsesrv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <skip@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0x5,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    118c <parsesrv+0x4c>
mov    -0x8(%rbp),%rsi
add    $0x5,%rsi
lea    0xe7f(%rip),%rdi
call   1050 <sout@plt>
mov    -0x8(%rbp),%rsi
lea    0xe77(%rip),%rdi
call   1060 <pout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsesrv>:
push   %rbx
mov    %rdi,%rbx
mov    $0xd,%esi
call   1030 <skip@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1176 <parsesrv+0x36>
lea    0x5(%rbx),%rsi
lea    0xe95(%rip),%rdi
call   1050 <sout@plt>
lea    0xe91(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1060 <pout@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"PING \00"
@.str.1 = [8 x i8] c"PONG %s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @parsesrv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @skip(i8* %3, i8 signext 13)
%5 = load i8*, i8** %2
%6 = call i32 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i32 5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 5
%11 = call i32 @sout(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %2
%14 = call i32 @pout(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"PING \00"
@.str.1 = [8 x i8] c"PONG %s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @parsesrv(i8* %0) {
%2 = tail call i32 @skip(i8* %0, i8 signext 13)
%3 = tail call i32 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 5)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 5
%7 = tail call i32 @sout(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %1
%9 = tail call i32 @pout(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doub2unico(double, char *);
int /*<<< orphan*/ strcat(char *, char *);
void sudu(double spe, char ch[]) {
  char *s = "901F5EA6";
  char *s1 = "006B006D002F0068";
  strcat(ch, s);
  doub2unico(spe, ch);
  strcat(ch, s1);
}


x86 assembly (clang, -O0):
<sudu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xec6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <doub2unico@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudu>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
lea    0xecb(%rip),%rsi
call   1040 <strcat@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <doub2unico@plt>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"901F5EA6\00"
@.str.1 = [17 x i8] c"006B006D002F0068\00"
define void @sudu(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = load double, double* %3
%11 = load i8*, i8** %4
%12 = call i32 @doub2unico(double %10, i8* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %6
%15 = call i32 @strcat(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"901F5EA6\00"
@.str.1 = [17 x i8] c"006B006D002F0068\00"
define void @sudu(double %0, i8* %1) {
%3 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @doub2unico(double %0, i8* %1)
%5 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}