xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ xcb_get_property_reply_t;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ xcb_ewmh_get_cardinal_from_reply(int /*<<< orphan*/ *,
                                                    int /*<<< orphan*/ *);
uint8_t
xcb_ewmh_get_number_of_desktops_from_reply(uint32_t *number_of_desktops,
                                           xcb_get_property_reply_t *r) {
  return xcb_ewmh_get_cardinal_from_reply(number_of_desktops, r);
}


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

x86 assembly (clang, -O2):
<xcb_ewmh_get_number_of_desktops_from_reply>:
jmp    1030 <xcb_ewmh_get_cardinal_from_reply@plt>

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

LLVM IR (-O2):
define i32 @xcb_ewmh_get_number_of_desktops_from_reply(i32* %0, i32* %1) {
%3 = tail call i32 @xcb_ewmh_get_cardinal_from_reply(i32* %0, i32* %1)
ret i32 %3
}
int test_imm_72uint16_mem(unsigned short *val) {
  return ((*val) & (0x72 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_72uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 114
%7 = icmp ne i32 %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_72uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 114
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_TUNER_STEP_INCREMENT;
void cec_msg_tuner_step_increment(struct cec_msg *msg) {
  msg->len = 2;
  msg->msg[1] = CEC_MSG_TUNER_STEP_INCREMENT;
}


x86 assembly (clang, -O0):
<cec_msg_tuner_step_increment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_tuner_step_increment>:
movl   $0x2,(%rdi)
mov    0x2ee3(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_TUNER_STEP_INCREMENT = global i32 0
define void @cec_msg_tuner_step_increment(%struct.cec_msg* %0) {
%2 = alloca %struct.cec_msg*
store %struct.cec_msg* %0, %struct.cec_msg** %2
%3 = load %struct.cec_msg*, %struct.cec_msg** %2
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %3, i32 0, i32 0
store i32 2, i32* %4
%5 = load i32, i32* @CEC_MSG_TUNER_STEP_INCREMENT
%6 = load %struct.cec_msg*, %struct.cec_msg** %2
%7 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %6, i32 0, i32 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_TUNER_STEP_INCREMENT = global i32 0
define void @cec_msg_tuner_step_increment(%struct.cec_msg* nocapture %0) {
%2 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 2, i32* %2
%3 = load i32, i32* @CEC_MSG_TUNER_STEP_INCREMENT
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %3, i32* %6
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int gg_gethostbyname_real(char const *, struct in_addr **, unsigned int *,
                          int /*<<< orphan*/);
struct in_addr *gg_gethostbyname(const char *hostname) {
  struct in_addr *result;
  unsigned int count;
  if (gg_gethostbyname_real(hostname, &result, &count, 0) == -1)
    return NULL;
  return result;
}


x86 assembly (clang, -O0):
<gg_gethostbyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <gg_gethostbyname_real@plt>
cmp    $0xffffffff,%eax
jne    1145 <gg_gethostbyname+0x35>
movq   $0x0,-0x8(%rbp)
jmp    114d <gg_gethostbyname+0x3d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gg_gethostbyname>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rsi
lea    0xc(%rsp),%rdx
xor    %ebx,%ebx
xor    %ecx,%ecx
call   1030 <gg_gethostbyname_real@plt>
cmp    $0xffffffff,%eax
je     112f <gg_gethostbyname+0x1f>
mov    (%rsp),%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define %struct.in_addr* @gg_gethostbyname(i8* %0) {
%2 = alloca %struct.in_addr*
%3 = alloca i8*
%4 = alloca %struct.in_addr*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @gg_gethostbyname_real(i8* %6, %struct.in_addr** %4, i32* %5, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store %struct.in_addr* null, %struct.in_addr** %2
br label %12
10: ; preds = %1
%11 = load %struct.in_addr*, %struct.in_addr** %4
store %struct.in_addr* %11, %struct.in_addr** %2
br label %12
12: ; preds = %10, %9
%13 = load %struct.in_addr*, %struct.in_addr** %2
ret %struct.in_addr* %13
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define %struct.in_addr* @gg_gethostbyname(i8* %0) {
%2 = alloca %struct.in_addr*
%3 = alloca i32
%4 = bitcast %struct.in_addr** %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @gg_gethostbyname_real(i8* %0, %struct.in_addr** %2, i32* %3, i32 0)
%7 = icmp eq i32 %6, -1
%8 = load %struct.in_addr*, %struct.in_addr** %2
%9 = select i1 %7, %struct.in_addr* null, %struct.in_addr* %8
ret %struct.in_addr* %9
}
int sandbox_issue_fs_rw_extension(const char *path, char **ext_token) {
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @sandbox_issue_fs_rw_extension(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 -1
}
IR0AX1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*p0) <= (((short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1147 <IR0AX1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <IR0AX1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AX1>:
movzwl (%r8),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setle  %al
ret

LLVM IR (-O0):
define i32 @IR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %20
%22 = load i16, i16* %21
%23 = sext i16 %22 to i32
%24 = icmp sle i32 %18, %23
br i1 %24, label %25, label %26
25: ; preds = %6
store i32 1, i32* %7
br label %27
26: ; preds = %6
store i32 0, i32* %7
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @IR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = load i16, i16* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %8
%10 = load i16, i16* %9
%11 = icmp sle i16 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int gtm_event_log(int argc, char *category, char *code, char *msg) { return 0; }


x86 assembly (clang, -O0):
<gtm_event_log>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gtm_event_log(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @gtm_event_log(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getd(char **, int /*<<< orphan*/);
int is_numeric(char *c) {
  getd(&c, 0);
  if (!*c)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <getd@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1140 <is_numeric+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1147 <is_numeric+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <getd@plt>
mov    (%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_numeric(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @getd(i8** %2, i32 0)
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int inw(int);
int uartgetc(void) {
  if (inw(0xFE215054) & 0x1)
    return inw(0xFE215040);
  else
    return -1;
}


x86 assembly (clang, -O0):
<uartgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xfe215054,%edi
call   1030 <inw@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     1140 <uartgetc+0x30>
mov    $0xfe215040,%edi
call   1030 <inw@plt>
mov    %eax,-0x4(%rbp)
jmp    1147 <uartgetc+0x37>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @uartgetc() {
%1 = tail call i32 @inw(i32 -31371180)
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @inw(i32 -31371200)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ %5, %4 ], [ -1, %0 ]
ret i32 %7
}
/* Variables and functions */
char *strchr(char const *, int);
size_t strcnt(const char *s, int c) {
  size_t n = 0;
  while ((s = strchr(s, c)))
    s++, n++;
  return n;
}


x86 assembly (clang, -O0):
<strcnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     115e <strcnt+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <strcnt+0x17>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcnt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1147 <strcnt+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
add    $0x1,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <strcnt+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @strcnt(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add i64 %7, 1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %8, i32 %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i64 [ 0, %2 ], [ %9, %5 ]
ret i64 %13
}
struct pthread *__pthread_self() {
  struct pthread *self;
  __asm__("mov %%fs:0,%0" : "=r"(self));
  return self;
}


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

x86 assembly (clang, -O2):
<__pthread_self>:
mov    %fs:0x0,%rax
ret

LLVM IR (-O0):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
%1 = alloca %struct.pthread*
%2 = call %struct.pthread* asm "mov %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store %struct.pthread* %2, %struct.pthread** %1
%3 = load %struct.pthread*, %struct.pthread** %1
ret %struct.pthread* %3
}

LLVM IR (-O2):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
%1 = tail call %struct.pthread* asm "mov %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret %struct.pthread* %1
}
unsigned cdrom_lba_to_fad(unsigned lba) { return lba + 150; }


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

x86 assembly (clang, -O2):
<cdrom_lba_to_fad>:
lea    0x96(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @cdrom_lba_to_fad(i32 %0) {
%2 = add i32 %0, 150
ret i32 %2
}
int main(int argc, const char *argv[]) {
  int buffer[10];
  int i = 0;
  while (i < 10) {
    buffer[i] = i;
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    113c <main+0x3c>
mov    -0x44(%rbp),%ecx
movslq -0x44(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int bits_getb(const uint8_t *vec, size_t size, uint8_t bit) {
  if (size <= (bit >> 3))
    return -1;
  return (*(vec + (bit >> 3)) & (1 << (bit & 0x07))) != 0;
}


x86 assembly (clang, -O0):
<bits_getb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
ja     1131 <bits_getb+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <bits_getb+0x60>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x1c(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_getb>:
mov    %edx,%eax
sar    $0x3,%eax
movslq %eax,%rcx
mov    $0xffffffff,%eax
cmp    %rsi,%rcx
jae    111f <bits_getb+0x1f>
mov    (%rdi,%rcx,4),%eax
and    $0x7,%dl
mov    %edx,%ecx
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bits_getb(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%8 = load i64, i64* %6
%9 = load i32, i32* %7
%10 = ashr i32 %9, 3
%11 = sext i32 %10 to i64
%12 = icmp ule i64 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 -1, i32* %4
br label %27
14: ; preds = %3
%15 = load i32*, i32** %5
%16 = load i32, i32* %7
%17 = ashr i32 %16, 3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %15, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %7
%22 = and i32 %21, 7
%23 = shl i32 1, %22
%24 = and i32 %20, %23
%25 = icmp ne i32 %24, 0
%26 = zext i1 %25 to i32
store i32 %26, i32* %4
br label %27
27: ; preds = %14, %13
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @bits_getb(i32* nocapture %0, i64 %1, i32 %2) {
%4 = ashr i32 %2, 3
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %5, %1
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = getelementptr inbounds i32, i32* %0, i64 %5
%9 = load i32, i32* %8
%10 = and i32 %2, 7
%11 = lshr i32 %9, %10
%12 = and i32 %11, 1
br label %13
13: ; preds = %3, %7
%14 = phi i32 [ %12, %7 ], [ -1, %3 ]
ret i32 %14
}
void ECAPIntDisable(unsigned int baseAdd, unsigned int flag) {
  (*((volatile unsigned short *)(baseAdd + (0x2C)))) |= flag;
}


x86 assembly (clang, -O0):
<ECAPIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
or     %edx,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPIntDisable>:
add    $0x2c,%edi
or     %si,(%rdi)
ret

LLVM IR (-O0):
define void @ECAPIntDisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 44
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i16*
%10 = load volatile i16, i16* %9
%11 = zext i16 %10 to i32
%12 = or i32 %11, %5
%13 = trunc i32 %12 to i16
store volatile i16 %13, i16* %9
ret void
}

LLVM IR (-O2):
define void @ECAPIntDisable(i32 %0, i32 %1) {
%3 = add i32 %0, 44
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
%7 = trunc i32 %1 to i16
%8 = or i16 %6, %7
store volatile i16 %8, i16* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cgiTableEnd() { printf("</TABLE>\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"</TABLE>\00"
define void @cgiTableEnd() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int helpRoundFloat(float x) {
  if (x > 0.0) {
    return (int)(x + 0.5);
  } else {
    return (int)(x - 0.5);
  }
}


x86 assembly (clang, -O0):
<helpRoundFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1140 <helpRoundFloat+0x40>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    115c <helpRoundFloat+0x5c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeaf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpRoundFloat>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
cvtss2sd %xmm0,%xmm0
lea    0xeea(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @helpRoundFloat(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fadd double %9, 5.000000e-01
%11 = fptosi double %10 to i32
store i32 %11, i32* %2
br label %17
12: ; preds = %1
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fsub double %14, 5.000000e-01
%16 = fptosi double %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %12, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @helpRoundFloat(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ogt float %0, 0.000000e+00
%4 = select i1 %3, double 5.000000e-01, double -5.000000e-01
%5 = fadd double %4, %2
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Type definitions */
struct pagevec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __pagevec_release(struct pagevec *);
scalar_t__ pagevec_count(struct pagevec *);
void pagevec_release(struct pagevec *pvec) {
  if (pagevec_count(pvec))
    __pagevec_release(pvec);
}


x86 assembly (clang, -O0):
<pagevec_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pagevec_count@plt>
cmp    $0x0,%rax
je     1148 <pagevec_release+0x28>
mov    -0x8(%rbp),%rdi
call   1040 <__pagevec_release@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pagevec_release>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pagevec_count@plt>
test   %rax,%rax
je     1137 <pagevec_release+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__pagevec_release@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.pagevec = type { i32 }
define void @pagevec_release(%struct.pagevec* %0) {
%2 = alloca %struct.pagevec*
store %struct.pagevec* %0, %struct.pagevec** %2
%3 = load %struct.pagevec*, %struct.pagevec** %2
%4 = call i64 @pagevec_count(%struct.pagevec* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.pagevec*, %struct.pagevec** %2
%8 = call i32 @__pagevec_release(%struct.pagevec* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.pagevec = type { i32 }
define void @pagevec_release(%struct.pagevec* %0) {
%2 = tail call i64 @pagevec_count(%struct.pagevec* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__pagevec_release(%struct.pagevec* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void kazyfunc() { printf("en vagyok a kazy\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"en vagyok a kazy\00"
define void @kazyfunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double log(double);
double dexprand() {
  double a, random2();
  a = -log(random2());
  if (random2() > 0.5)
    a = (-a);
  return (a);
}


x86 assembly (clang, -O0):
<dexprand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random2@plt>
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random2@plt>
movsd  0xea1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    118a <dexprand+0x6a>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dexprand>:
sub    $0x28,%rsp
xor    %eax,%eax
call   1030 <random2@plt>
call   1040 <log@plt>
movapd %xmm0,(%rsp)
movapd 0xec3(%rip),%xmm1
xorpd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp)
xor    %eax,%eax
call   1030 <random2@plt>
movsd  0xeba(%rip),%xmm1
cmpltsd %xmm0,%xmm1
movapd (%rsp),%xmm0
andpd  %xmm1,%xmm0
andnpd 0x10(%rsp),%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @dexprand() {
%1 = alloca double
%2 = call double (...) @random2()
%3 = call double @log(double %2)
%4 = fneg double %3
store double %4, double* %1
%5 = call double (...) @random2()
%6 = fcmp ogt double %5, 5.000000e-01
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load double, double* %1
%9 = fneg double %8
store double %9, double* %1
br label %10
10: ; preds = %7, %0
%11 = load double, double* %1
ret double %11
}

LLVM IR (-O2):
define double @dexprand() {
%1 = tail call double (...) @random2()
%2 = tail call double @log(double %1)
%3 = fneg double %2
%4 = tail call double (...) @random2()
%5 = fcmp ogt double %4, 5.000000e-01
%6 = select i1 %5, double %2, double %3
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void randomize() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<randomize>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @randomize() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @randomize() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
char *_resposta_padrao(int, int, char *);
char *ConfigurarInterfaceDeRede(int sessao, char *codigo_ativacao,
                                char *dados_configuracao) {
  return _resposta_padrao(sessao, 12000, "Rede configurada com sucesso");
}


x86 assembly (clang, -O0):
<ConfigurarInterfaceDeRede>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2ee0,%esi
lea    0xece(%rip),%rdx
call   1030 <_resposta_padrao@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigurarInterfaceDeRede>:
lea    0xee9(%rip),%rdx
mov    $0x2ee0,%esi
jmp    1030 <_resposta_padrao@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Rede configurada com sucesso\00"
define i8* @ConfigurarInterfaceDeRede(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i8* @_resposta_padrao(i32 %7, i32 12000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}

LLVM IR (-O2):
@.str = [29 x i8] c"Rede configurada com sucesso\00"
define i8* @ConfigurarInterfaceDeRede(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* @_resposta_padrao(i32 %0, i32 12000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ **);
int /*<<< orphan*/ X509_CRL_it;
X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl) {
  return ASN1_item_d2i_fp(&X509_CRL_it, fp, crl);
}


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

x86 assembly (clang, -O2):
<d2i_X509_CRL_fp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_d2i_fp@plt>

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

LLVM IR (-O2):
@X509_CRL_it = global i32 0
define i32* @d2i_X509_CRL_fp(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_fp(i32* @X509_CRL_it, i32* %0, i32** %1)
ret i32* %3
}
int atrshmlog_minor_version() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @atrshmlog_minor_version() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ XA_STRING;
int /*<<< orphan*/ strlen(char const *);
int x_set_property(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                   int, char const *, int /*<<< orphan*/);
int x_set_string_property(Window window, Atom property, const char *prop) {
  return x_set_property(window, XA_STRING, property, 8, prop, strlen(prop));
}


x86 assembly (clang, -O0):
<x_set_string_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    %eax,%r9d
mov    $0x8,%ecx
call   1040 <x_set_property@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_set_string_property>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%r15d
mov    0x2eb1(%rip),%rax
mov    (%rax),%ebp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %r15d,%edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    $0x8,%ecx
mov    %rbx,%r8
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <x_set_property@plt>

LLVM IR (-O0):
@XA_STRING = global i32 0
define i32 @x_set_string_property(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* @XA_STRING
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @x_set_property(i32 %7, i32 %8, i32 %9, i32 8, i8* %10, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@XA_STRING = global i32 0
define i32 @x_set_string_property(i32 %0, i32 %1, i8* %2) {
%4 = load i32, i32* @XA_STRING
%5 = tail call i32 @strlen(i8* %2)
%6 = tail call i32 @x_set_property(i32 %0, i32 %4, i32 %1, i32 8, i8* %2, i32 %5)
ret i32 %6
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double now() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
int test_imm_41uint32_mem(unsigned int *val) {
  return ((*val) & (0x41 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_41uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 65
%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_41uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 65
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PSLLD_imm(int dst_reg, int amount) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x72);
  addbyte(0xc0 | dst_reg | 0x30);
  addbyte(amount);
}


x86 assembly (clang, -O0):
<MMX_PSLLD_imm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x72,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x30,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PSLLD_imm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x72,%edi
call   1030 <addbyte@plt>
or     $0xf0,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PSLLD_imm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 114)
%8 = load i32, i32* %3
%9 = or i32 192, %8
%10 = or i32 %9, 48
%11 = call i32 @addbyte(i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PSLLD_imm(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 114)
%6 = or i32 %0, 240
%7 = tail call i32 @addbyte(i32 %6)
%8 = tail call i32 @addbyte(i32 %1)
ret void
}
const char *pathcon_nm3_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathcon_nm3_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathcon_nm3_name_out+0x2b>
jmp    111a <pathcon_nm3_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathcon_nm3_name_out+0x3b>
jmp    114b <pathcon_nm3_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm3_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm3_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm3_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathcon_nm3_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathcon_nm3_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void f1(void) { char buffer1[100]; }


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

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca [100 x i8]
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
/* Variables and functions */
int gsaca_unsigned(unsigned char const *, unsigned int *, unsigned int);
int gsaca(const unsigned char *S, int *SA, int n) {
  if (n < 0)
    return -1;
  return gsaca_unsigned(S, (unsigned int *)SA, (unsigned int)n);
}


x86 assembly (clang, -O0):
<gsaca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1139 <gsaca+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <gsaca+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <gsaca_unsigned@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsaca>:
test   %edx,%edx
js     1119 <gsaca+0x9>
jmp    1030 <gsaca_unsigned@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @gsaca(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 i32, i32* %7
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 -1, i32* %4
br label %16
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i32*, i32** %6
%14 = load i32, i32* %7
%15 = call i32 @gsaca_unsigned(i8* %12, i32* %13, i32 %14)
store i32 %15, i32* %4
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @gsaca(i8* %0, i32* %1, i32 %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @gsaca_unsigned(i8* %0, i32* %1, i32 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ cli();
int /*<<< orphan*/ sti();
int /*<<< orphan*/ wake_up(void *);
void wake_up1(void *p) {
  cli();
  wake_up(p);
  sti();
}


x86 assembly (clang, -O0):
<wake_up1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <cli@plt>
mov    -0x8(%rbp),%rdi
call   1050 <wake_up@plt>
mov    $0x0,%al
call   1030 <sti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wake_up1>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <cli@plt>
mov    %rbx,%rdi
call   1050 <wake_up@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <sti@plt>

LLVM IR (-O0):
define void @wake_up1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @cli()
%4 = load i8*, i8** %2
%5 = call i32 @wake_up(i8* %4)
%6 = call i32 (...) @sti()
ret void
}

LLVM IR (-O2):
define void @wake_up1(i8* %0) {
%2 = tail call i32 (...) @cli()
%3 = tail call i32 @wake_up(i8* %0)
%4 = tail call i32 (...) @sti()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t pgm_read_byte_far(const void *s) { return *(const uint8_t *)s; }


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

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

LLVM IR (-O0):
define i32 @pgm_read_byte_far(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @pgm_read_byte_far(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail();
int main() {
  int N;
  int x = 0;
  int i = 0;
  while (i < N) {
    if (!(x == 0)) {
      __assert_fail();
      return 1;
    }
    i = i + 1;
  }
  if (!(x == 0)) {
    __assert_fail();
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1164 <main+0x54>
cmpl   $0x0,-0xc(%rbp)
je     1156 <main+0x46>
mov    $0x0,%al
call   1030 <__assert_fail@plt>
movl   $0x1,-0x4(%rbp)
jmp    117c <main+0x6c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x0,-0xc(%rbp)
je     117c <main+0x6c>
mov    $0x0,%al
call   1030 <__assert_fail@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int *);
void mikado(int bah) {
  int pooh = 10;
  printf("In mikado(), pooh = %d and &pooh = %p\n", pooh, &pooh);
  printf("in mikado(), bah = %d and &bah = %p\n", bah, &bah);
}


x86 assembly (clang, -O0):
<mikado>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rdx
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xee8(%rip),%rdi
lea    -0x4(%rbp),%rdx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mikado>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %edi,0xc(%rsp)
movl   $0xa,0x8(%rsp)
lea    0xed6(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0xc(%rsp),%rdx
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"In mikado(), pooh = %d and &pooh = %p\0A\00"
@.str.1 = [37 x i8] c"in mikado(), bah = %d and &bah = %p\0A\00"
define void @mikado(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %4, i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32* %2)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"In mikado(), pooh = %d and &pooh = %p\0A\00"
@.str.1 = [37 x i8] c"in mikado(), bah = %d and &bah = %p\0A\00"
define void @mikado(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 10, i32* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32* %2)
ret void
}