xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char *, int /*<<< orphan*/);
int test_and_advance(char **input, const char *wanted) {
  if (strncmp(wanted, *input, strlen(wanted)) == 0) {
    *input += strlen(wanted);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_and_advance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    118c <test_and_advance+0x6c>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1193 <test_and_advance+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_advance>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    115f <test_and_advance+0x3f>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
add    %rax,(%r14)
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @test_and_advance(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i64 @strncmp(i8* %1, i8* %3, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = tail call i32 @strlen(i8* %1)
%9 = load i8*, i8** %0
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %0
br label %12
12: ; preds = %2, %7
%13 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %13
}
/* Type definitions */
struct aaip_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ aaip_ring_adr(struct aaip_state *, size_t, int,
                                 unsigned char **, size_t *, size_t *,
                                 int /*<<< orphan*/);
int aaip_get_buffer_byte(struct aaip_state *aaip, size_t idx, int flag) {
  unsigned char *start_pt;
  size_t at_start_pt, at_recs;
  aaip_ring_adr(aaip, idx, 1, &start_pt, &at_start_pt, &at_recs, 0);
  return ((int)*start_pt);
}


x86 assembly (clang, -O0):
<aaip_get_buffer_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <aaip_ring_adr@plt>
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aaip_get_buffer_byte>:
sub    $0x28,%rsp
movl   $0x0,(%rsp)
lea    0x10(%rsp),%rcx
lea    0x20(%rsp),%r8
lea    0x18(%rsp),%r9
mov    $0x1,%edx
call   1030 <aaip_ring_adr@plt>
mov    0x10(%rsp),%rax
movzbl (%rax),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.aaip_state = type { i32 }
define i32 @aaip_get_buffer_byte(%struct.aaip_state* %0, i64 %1, i32 %2) {
%4 = alloca %struct.aaip_state*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store %struct.aaip_state* %0, %struct.aaip_state** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%10 = load %struct.aaip_state*, %struct.aaip_state** %4
%11 = load i64, i64* %5
%12 = call i32 @aaip_ring_adr(%struct.aaip_state* %10, i64 %11, i32 1, i8** %7, i64* %8, i64* %9, i32 0)
%13 = load i8*, i8** %7
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
%struct.aaip_state = type { i32 }
define i32 @aaip_get_buffer_byte(%struct.aaip_state* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = bitcast i8** %4 to i8*
%8 = bitcast i64* %5 to i8*
%9 = bitcast i64* %6 to i8*
%10 = call i32 @aaip_ring_adr(%struct.aaip_state* %0, i64 %1, i32 1, i8** %4, i64* %5, i64* %6, i32 0)
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
ret i32 %13
}
void gravity_calculate_acceleration(void) {}


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

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

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

LLVM IR (-O2):
define void @gravity_calculate_acceleration() {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR54_set(void) { return U_WMRCORENONE_set("U_WMR54"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR54\00"
define i8* @U_WMR54_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR54\00"
define i8* @U_WMR54_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long icon_pixmap;
};
typedef TYPE_1__ XWMHints;

/* Variables and functions */
void set_XWMHints_icon_pixmap(void *_p, unsigned long _v) {
  ((XWMHints *)_p)->icon_pixmap = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XWMHints_icon_pixmap>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XWMHints_icon_pixmap(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void rop3_130_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_130_0_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 -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_130_0_0>:
xor    %edx,%esi
not    %sil
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_130_0_0(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* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_130_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, %2
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Run();
int main(int argc, char *argv[]) {
  Run();
  return 0;
}


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

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

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 = call i32 (...) @Run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Run()
ret i32 0
}
int squared(int x) { return x * x; }


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

x86 assembly (clang, -O2):
<squared>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @squared(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void lowpan_dev_debugfs_exit(struct net_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define void @lowpan_dev_debugfs_exit(%struct.net_device* nocapture %0) {
ret void
}
int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
%struct.list_head = type opaque
define i32 @dbg_check_data_nodes_order(%struct.ubifs_info* %0, %struct.list_head* %1) {
%3 = alloca %struct.ubifs_info*
%4 = alloca %struct.list_head*
store %struct.ubifs_info* %0, %struct.ubifs_info** %3
store %struct.list_head* %1, %struct.list_head** %4
ret i32 0
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.list_head = type opaque
define i32 @dbg_check_data_nodes_order(%struct.ubifs_info* nocapture readnone %0, %struct.list_head* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int execlp(const char *file, const char *arg, ...) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "execlp");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<execlp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
lea    0xee5(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execlp>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"execlp\00"
define i32 @execlp(i8* %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"execlp\00"
define i32 @execlp(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t htole16(uint16_t host_16bits) { return host_16bits; }


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

x86 assembly (clang, -O2):
<htole16>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @htole16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free2d(void **mem) {
  free(mem[0]);
  free(mem);
}


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

x86 assembly (clang, -O2):
<free2d>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free2d(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i8**
%7 = call i32 @free(i8** %6)
%8 = load i8**, i8*** %2
%9 = call i32 @free(i8** %8)
ret void
}

LLVM IR (-O2):
define void @free2d(i8** nocapture %0) {
%2 = bitcast i8** %0 to i8***
%3 = load i8**, i8*** %2
%4 = tail call i32 @free(i8** %3)
%5 = tail call i32 @free(i8** %0)
ret void
}
int test_imm_D7int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xD7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D7int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14090240
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Get_Date_Time(int);
void IF_dateC(void) { Get_Date_Time(1); }


x86 assembly (clang, -O0):
<IF_dateC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <Get_Date_Time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_dateC>:
mov    $0x1,%edi
jmp    1030 <Get_Date_Time@plt>

LLVM IR (-O0):
define void @IF_dateC() {
%1 = call i32 @Get_Date_Time(i32 1)
ret void
}

LLVM IR (-O2):
define void @IF_dateC() {
%1 = tail call i32 @Get_Date_Time(i32 1)
ret void
}
/* Variables and functions */
int backup_sync_msg(int, int, int);
int Backup_get_attribute(int id) { return backup_sync_msg(2, 1, id); }


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

x86 assembly (clang, -O2):
<Backup_get_attribute>:
mov    %edi,%edx
mov    $0x2,%edi
mov    $0x1,%esi
jmp    1030 <backup_sync_msg@plt>

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

LLVM IR (-O2):
define i32 @Backup_get_attribute(i32 %0) {
%2 = tail call i32 @backup_sync_msg(i32 2, i32 1, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ haircut();
int /*<<< orphan*/ havemeal();
int main(void) {
  haircut();
  havemeal();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @haircut()
%2 = tail call i32 (...) @havemeal()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ clear_SCL();
int /*<<< orphan*/ clear_SDA();
int /*<<< orphan*/ set_SCL();
int /*<<< orphan*/ set_SDA();
int /*<<< orphan*/ set_SDA_output();
void send_start_sequence() {
  set_SDA();
  set_SDA_output();
  _delay_us(1);
  set_SCL();
  _delay_us(1);
  clear_SDA();
  _delay_us(1);
  clear_SCL();
  _delay_us(1);
}


x86 assembly (clang, -O0):
<send_start_sequence>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <set_SDA@plt>
mov    $0x0,%al
call   1060 <set_SDA_output@plt>
mov    $0x1,%edi
call   1050 <_delay_us@plt>
mov    $0x0,%al
call   1080 <set_SCL@plt>
mov    $0x1,%edi
call   1050 <_delay_us@plt>
mov    $0x0,%al
call   1070 <clear_SDA@plt>
mov    $0x1,%edi
call   1050 <_delay_us@plt>
mov    $0x0,%al
call   1040 <clear_SCL@plt>
mov    $0x1,%edi
call   1050 <_delay_us@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_start_sequence>:
push   %rax
xor    %eax,%eax
call   1030 <set_SDA@plt>
xor    %eax,%eax
call   1060 <set_SDA_output@plt>
mov    $0x1,%edi
call   1050 <_delay_us@plt>
xor    %eax,%eax
call   1080 <set_SCL@plt>
mov    $0x1,%edi
call   1050 <_delay_us@plt>
xor    %eax,%eax
call   1070 <clear_SDA@plt>
mov    $0x1,%edi
call   1050 <_delay_us@plt>
xor    %eax,%eax
call   1040 <clear_SCL@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <_delay_us@plt>

LLVM IR (-O0):
define void @send_start_sequence() {
%1 = call i32 (...) @set_SDA()
%2 = call i32 (...) @set_SDA_output()
%3 = call i32 @_delay_us(i32 1)
%4 = call i32 (...) @set_SCL()
%5 = call i32 @_delay_us(i32 1)
%6 = call i32 (...) @clear_SDA()
%7 = call i32 @_delay_us(i32 1)
%8 = call i32 (...) @clear_SCL()
%9 = call i32 @_delay_us(i32 1)
ret void
}

LLVM IR (-O2):
define void @send_start_sequence() {
%1 = tail call i32 (...) @set_SDA()
%2 = tail call i32 (...) @set_SDA_output()
%3 = tail call i32 @_delay_us(i32 1)
%4 = tail call i32 (...) @set_SCL()
%5 = tail call i32 @_delay_us(i32 1)
%6 = tail call i32 (...) @clear_SDA()
%7 = tail call i32 @_delay_us(i32 1)
%8 = tail call i32 (...) @clear_SCL()
%9 = tail call i32 @_delay_us(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
int /*<<< orphan*/ printf_C(char *);
void TestC() {
  int i = 0x2000;
  while (1) {
    printf_C("proc3 ");
    milli_delay(1000);
  }
}


x86 assembly (clang, -O0):
<TestC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2000,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf_C@plt>
mov    $0x3e8,%edi
call   1040 <milli_delay@plt>
jmp    112f <TestC+0xf>

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

LLVM IR (-O0):
@.str = [7 x i8] c"proc3 \00"
define void @TestC() {
%1 = alloca i32
store i32 8192, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf_C(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @milli_delay(i32 1000)
br label %2
}

LLVM IR (-O2):
@.str = [7 x i8] c"proc3 \00"
define void @TestC() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf_C(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @milli_delay(i32 1000)
br label %1
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglEndFragmentShaderATI();
void _Lazy_glEndFragmentShaderATI(void) {
  if (GLeeInit())
    pglEndFragmentShaderATI();
}


x86 assembly (clang, -O0):
<_Lazy_glEndFragmentShaderATI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glEndFragmentShaderATI+0x1c>
mov    $0x0,%al
call   1040 <pglEndFragmentShaderATI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glEndFragmentShaderATI>:
push   %rax
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glEndFragmentShaderATI+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pglEndFragmentShaderATI@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glEndFragmentShaderATI() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglEndFragmentShaderATI()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glEndFragmentShaderATI() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglEndFragmentShaderATI()
br label %5
5: ; preds = %3, %0
ret void
}
int search_edk(const unsigned char *payload, const int plen, int payload_len) {
  if (payload[0] != 0xe3)
    return 0;
  else {
    if (payload[5] == 0x47)
      return (3 * 100);
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<search_edk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xe3,%eax
je     112c <search_edk+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1150 <search_edk+0x50>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
cmp    $0x47,%eax
jne    1149 <search_edk+0x49>
movl   $0x12c,-0x4(%rbp)
jmp    1150 <search_edk+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_edk>:
xor    %eax,%eax
cmpb   $0xe3,(%rdi)
jne    1115 <search_edk+0x15>
xor    %ecx,%ecx
cmpb   $0x47,0x5(%rdi)
mov    $0x12c,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @search_edk(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, -29
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 5
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 71
%10 = select i1 %9, i32 300, i32 0
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ 0, %3 ], [ %10, %6 ]
ret i32 %12
}
int test_imm_36uint8_reg(unsigned char val) {
  return ((val) & (-0x36 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_36uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffca,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_36uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -54
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s", "Patch failed :(!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [18 x i8] c"Patch failed :(!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [18 x i8] c"Patch failed :(!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void XtAppError() {}


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

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

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

LLVM IR (-O2):
define void @XtAppError() {
ret void
}
int test_and_set_bit(int nr, unsigned long *addr) {
  unsigned long mask = (1 << (nr));
  unsigned long old = *addr;
  *addr = old | mask;
  return (old & mask) != 0;
}


x86 assembly (clang, -O0):
<test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
or     -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set_bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    (%rsi),%rdx
mov    %rdx,%rax
or     %rcx,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
test   %rcx,%rdx
setne  %al
ret

LLVM IR (-O0):
define i32 @test_and_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = shl i32 1, %7
%9 = sext i32 %8 to i64
store i64 %9, i64* %5
%10 = load i64*, i64** %4
%11 = load i64, i64* %10
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = load i64, i64* %5
%14 = or i64 %12, %13
%15 = load i64*, i64** %4
store i64 %14, i64* %15
%16 = load i64, i64* %6
%17 = load i64, i64* %5
%18 = and i64 %16, %17
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @test_and_set_bit(i32 %0, i64* nocapture %1) {
%3 = shl nuw i32 1, %0
%4 = sext i32 %3 to i64
%5 = load i64, i64* %1
%6 = or i64 %5, %4
store i64 %6, i64* %1
%7 = and i64 %5, %4
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_version() { printf("check_procstat (%s)\n", "0.1"); }


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"check_procstat (%s)\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ setsid();
void godaemon(void) {
  switch (fork()) {
  case -1:
    exit(-1);
  case 0:
    close(1);
    close(2);
    setsid();
    break;
  default:
    exit(0);
  }
}


x86 assembly (clang, -O0):
<godaemon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
sub    $0xffffffff,%eax
je     1172 <godaemon+0x32>
jmp    1162 <godaemon+0x22>
mov    -0x4(%rbp),%eax
test   %eax,%eax
je     117c <godaemon+0x3c>
jmp    119c <godaemon+0x5c>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    $0x1,%edi
call   1030 <close@plt>
mov    $0x2,%edi
call   1030 <close@plt>
mov    $0x0,%al
call   1040 <setsid@plt>
jmp    11a3 <godaemon+0x63>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<godaemon>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
jne    1168 <godaemon+0x28>
mov    $0x1,%edi
call   1030 <close@plt>
mov    $0x2,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <setsid@plt>
cmp    $0xffffffff,%eax
jne    1177 <godaemon+0x37>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @godaemon() {
%1 = call i32 (...) @fork()
switch i32 %1, label %8 [
i32 -1, label %2
i32 0, label %4
]
2: ; preds = %0
%3 = call i32 @exit(i32 -1)
unreachable
4: ; preds = %0
%5 = call i32 @close(i32 1)
%6 = call i32 @close(i32 2)
%7 = call i32 (...) @setsid()
br label %10
8: ; preds = %0
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @godaemon() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %8 [
i32 -1, label %2
i32 0, label %4
]
2: ; preds = %0
%3 = tail call i32 @exit(i32 -1)
unreachable
4: ; preds = %0
%5 = tail call i32 @close(i32 1)
%6 = tail call i32 @close(i32 2)
%7 = tail call i32 (...) @setsid()
ret void
8: ; preds = %0
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int cos(float);
float interpolate(float a, float b, float x) {
  float pi_mod;
  float f_unk;
  pi_mod = x * 3.1415927;
  f_unk = (1 - cos(pi_mod)) * 0.5;
  return (a * (1 - f_unk) + b * x);
}


x86 assembly (clang, -O0):
<interpolate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe82(%rip),%xmm2
subss  -0x14(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate>:
sub    $0x18,%rsp
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
mulsd  0xecb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <cos@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0xeb4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
addss  0xeb0(%rip),%xmm0
movss  0x10(%rsp),%xmm1
mulss  0xc(%rsp),%xmm1
mulss  0x14(%rsp),%xmm0
addss  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @interpolate(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %6
%10 = fpext float %9 to double
%11 = fmul double %10, 0x400921FB5A7ED197
%12 = fptrunc double %11 to float
store float %12, float* %7
%13 = load float, float* %7
%14 = call i32 @cos(float %13)
%15 = sub nsw i32 1, %14
%16 = sitofp i32 %15 to double
%17 = fmul double %16, 5.000000e-01
%18 = fptrunc double %17 to float
store float %18, float* %8
%19 = load float, float* %4
%20 = load float, float* %8
%21 = fsub float 1.000000e+00, %20
%22 = load float, float* %5
%23 = load float, float* %6
%24 = fmul float %22, %23
%25 = call float @llvm.fmuladd.f32(float %19, float %21, float %24)
ret float %25
}

LLVM IR (-O2):
define float @interpolate(float %0, float %1, float %2) {
%4 = fpext float %2 to double
%5 = fmul double %4, 0x400921FB5A7ED197
%6 = fptrunc double %5 to float
%7 = tail call i32 @cos(float %6)
%8 = sub nsw i32 1, %7
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 5.000000e-01
%11 = fptrunc double %10 to float
%12 = fsub float 1.000000e+00, %11
%13 = fmul float %1, %2
%14 = tail call float @llvm.fmuladd.f32(float %0, float %12, float %13)
ret float %14
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
scalar_t__ leftChild(struct node *);
scalar_t__ rightChild(struct node *);
int isFull(struct node *node) {
  if (leftChild(node) && rightChild(node))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isFull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <leftChild@plt>
cmp    $0x0,%rax
je     115e <isFull+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <rightChild@plt>
cmp    $0x0,%rax
je     115e <isFull+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <isFull+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFull>:
push   %rbx
mov    %rdi,%rbx
call   1040 <leftChild@plt>
test   %rax,%rax
je     1145 <isFull+0x25>
mov    %rbx,%rdi
call   1030 <rightChild@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1145 <isFull+0x25>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @isFull(%struct.node* %0) {
%2 = alloca i32
%3 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
%4 = load %struct.node*, %struct.node** %3
%5 = call i64 @leftChild(%struct.node* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load %struct.node*, %struct.node** %3
%9 = call i64 @rightChild(%struct.node* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @isFull(%struct.node* %0) {
%2 = tail call i64 @leftChild(%struct.node* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @rightChild(%struct.node* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void notify_server(pid_t server) {
  kill(server, SIGUSR1);
  ;
}


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

x86 assembly (clang, -O2):
<notify_server>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define void @notify_server(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR1
%5 = call i32 @kill(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define void @notify_server(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = tail call i32 @kill(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_lock(int, int, unsigned long long, int /*<<< orphan*/);
set_lock_size(int fd, int type, long long unsigned start) {
  set_lock(fd, type, start, 0);
}


x86 assembly (clang, -O0):
<set_lock_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <set_lock@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_lock_size>:
xor    %ecx,%ecx
jmp    1030 <set_lock@plt>

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

LLVM IR (-O2):
define i32 @set_lock_size(i32 %0, i32 %1, i64 %2) {
%4 = tail call i32 @set_lock(i32 %0, i32 %1, i64 %2, i32 0)
ret i32 undef
}
/* Variables and functions */
int rand();
int round(int);
int sortear(int limite) { return round(rand() * limite); }


x86 assembly (clang, -O0):
<sortear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%edi
imul   -0x4(%rbp),%edi
call   1030 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortear>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
imul   %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <round@plt>

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

LLVM IR (-O2):
define i32 @sortear(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = mul nsw i32 %2, %0
%4 = tail call i32 @round(i32 %3)
ret i32 %4
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double diff_time(struct timespec *start, struct timespec *end) {
  return ((double)(end->tv_sec - start->tv_sec) * 1.0e9 +
          (double)(end->tv_nsec - start->tv_nsec));
}


x86 assembly (clang, -O0):
<diff_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
cvtsi2sd %rax,%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%rax
cvtsi2sd %rax,%xmm1
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_time>:
mov    (%rsi),%rax
mov    0x8(%rsi),%rcx
sub    0x8(%rdi),%rcx
cvtsi2sd %rcx,%xmm0
sub    (%rdi),%rax
cvtsi2sd %rax,%xmm1
mulsd  0xee0(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @diff_time(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = sitofp i64 %11 to double
%13 = load %struct.timespec*, %struct.timespec** %4
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = load %struct.timespec*, %struct.timespec** %3
%17 = getelementptr inbounds %struct.timespec, %struct.timespec* %16, i32 0, i32 0
%18 = load i64, i64* %17
%19 = sub nsw i64 %15, %18
%20 = sitofp i64 %19 to double
%21 = call double @llvm.fmuladd.f64(double %12, double 1.000000e+09, double %20)
ret double %21
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define double @diff_time(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%12 = load i64, i64* %11
%13 = sub nsw i64 %10, %12
%14 = sitofp i64 %13 to double
%15 = tail call double @llvm.fmuladd.f64(double %8, double 1.000000e+09, double %14)
ret double %15
}
/* Variables and functions */
int EOF;
int getchar();
void cleanStdin(void) {
  int c;
  do {
    c = getchar();
  } while (c != '\n' && c != EOF);
}


x86 assembly (clang, -O0):
<cleanStdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1143 <cleanStdin+0x33>
mov    -0x4(%rbp),%eax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1118 <cleanStdin+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanStdin>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <cleanStdin+0x20>
cmp    (%rbx),%eax
jne    1120 <cleanStdin+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @cleanStdin() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
br label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %1
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br label %11
11: ; preds = %7, %4
%12 = phi i1 [ false, %4 ], [ %10, %7 ]
br i1 %12, label %2, label %13
13: ; preds = %11
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @cleanStdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
__attribute__((unused)) unsigned MEM_32bits(void) {
  return sizeof(size_t) == 4;
}


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

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

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

LLVM IR (-O2):
define i32 @MEM_32bits() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(int, int, int, int);
int main(void) {
  printf("%0x\n", setbits(120, 4, 3, 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x78,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1040 <setbits@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x78,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1040 <setbits@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%0x\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 120, i32 4, i32 3, i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1;
  a--;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, -1
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
double pow(double, double);
double convert_it_3(double x) { return pow(x, -0.5); }


x86 assembly (clang, -O0):
<convert_it_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_it_3>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @convert_it_3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double -5.000000e-01)
ret double %4
}

LLVM IR (-O2):
define double @convert_it_3(double %0) {
%2 = tail call double @pow(double %0, double -5.000000e-01)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void aaa(void) { printf("aaa\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"aaa\00"
define void @aaa() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}