xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int spi_write(int, int *, int);
int do_write_disable(int fd) {
  uint8_t op = 0x04;
  return spi_write(fd, &op, 1);
}


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

x86 assembly (clang, -O2):
<do_write_disable>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <spi_write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @do_write_disable(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 4, i32* %2
%4 = call i32 @spi_write(i32 %0, i32* %2, i32 1)
ret i32 %4
}
/* Type definitions */
struct dcadec_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ta_free(struct dcadec_context *);
void dcadec_context_destroy(struct dcadec_context *dca) { ta_free(dca); }


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

x86 assembly (clang, -O2):
<dcadec_context_destroy>:
jmp    1030 <ta_free@plt>

LLVM IR (-O0):
%struct.dcadec_context = type { i32 }
define void @dcadec_context_destroy(%struct.dcadec_context* %0) {
%2 = alloca %struct.dcadec_context*
store %struct.dcadec_context* %0, %struct.dcadec_context** %2
%3 = load %struct.dcadec_context*, %struct.dcadec_context** %2
%4 = call i32 @ta_free(%struct.dcadec_context* %3)
ret void
}

LLVM IR (-O2):
%struct.dcadec_context = type { i32 }
define void @dcadec_context_destroy(%struct.dcadec_context* %0) {
%2 = tail call i32 @ta_free(%struct.dcadec_context* %0)
ret void
}
/* Type definitions */
struct in6_addr {
  int dummy;
};
struct dns_rr_txt {
  int dummy;
};
struct dns_ctx {
  int dummy;
};

/* Variables and functions */
scalar_t__ dns_resolve(struct dns_ctx *, int /*<<< orphan*/);
int /*<<< orphan*/ dns_submit_a6dnsbl_txt(struct dns_ctx *,
                                          struct in6_addr const *, char const *,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
struct dns_rr_txt *dns_resolve_a6dnsbl_txt(struct dns_ctx *ctx,
                                           const struct in6_addr *addr,
                                           const char *dnsbl) {
  return (struct dns_rr_txt *)dns_resolve(
      ctx, dns_submit_a6dnsbl_txt(ctx, addr, dnsbl, 0, 0));
}


x86 assembly (clang, -O0):
<dns_resolve_a6dnsbl_txt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1040 <dns_submit_a6dnsbl_txt@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <dns_resolve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_resolve_a6dnsbl_txt>:
push   %rbx
mov    %rdi,%rbx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <dns_submit_a6dnsbl_txt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <dns_resolve@plt>

LLVM IR (-O0):
%struct.dns_rr_txt = type { i32 }
%struct.dns_ctx = type { i32 }
%struct.in6_addr = type { i32 }
define %struct.dns_rr_txt* @dns_resolve_a6dnsbl_txt(%struct.dns_ctx* %0, %struct.in6_addr* %1, i8* %2) {
%4 = alloca %struct.dns_ctx*
%5 = alloca %struct.in6_addr*
%6 = alloca i8*
store %struct.dns_ctx* %0, %struct.dns_ctx** %4
store %struct.in6_addr* %1, %struct.in6_addr** %5
store i8* %2, i8** %6
%7 = load %struct.dns_ctx*, %struct.dns_ctx** %4
%8 = load %struct.dns_ctx*, %struct.dns_ctx** %4
%9 = load %struct.in6_addr*, %struct.in6_addr** %5
%10 = load i8*, i8** %6
%11 = call i32 @dns_submit_a6dnsbl_txt(%struct.dns_ctx* %8, %struct.in6_addr* %9, i8* %10, i32 0, i32 0)
%12 = call i64 @dns_resolve(%struct.dns_ctx* %7, i32 %11)
%13 = inttoptr i64 %12 to %struct.dns_rr_txt*
ret %struct.dns_rr_txt* %13
}

LLVM IR (-O2):
%struct.dns_rr_txt = type { i32 }
%struct.dns_ctx = type { i32 }
%struct.in6_addr = type { i32 }
define %struct.dns_rr_txt* @dns_resolve_a6dnsbl_txt(%struct.dns_ctx* %0, %struct.in6_addr* %1, i8* %2) {
%4 = tail call i32 @dns_submit_a6dnsbl_txt(%struct.dns_ctx* %0, %struct.in6_addr* %1, i8* %2, i32 0, i32 0)
%5 = tail call i64 @dns_resolve(%struct.dns_ctx* %0, i32 %4)
%6 = inttoptr i64 %5 to %struct.dns_rr_txt*
ret %struct.dns_rr_txt* %6
}
int test_gps() { return 100; }


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

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

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

LLVM IR (-O2):
define i32 @test_gps() {
ret i32 100
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char const, int);
void ft_putstr_fd(char const *s, int fd) {
  int i;
  i = 0;
  while (s[i])
    ft_putchar_fd(s[i++], fd);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <ft_putstr_fd+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   1030 <ft_putchar_fd@plt>
jmp    1126 <ft_putstr_fd+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <ft_putstr_fd+0x35>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = add nuw i64 %6, 1
%9 = tail call i32 @ft_putchar_fd(i8 signext %7, i32 %1)
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCSPGRP;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ isatty(int);
int tcsetpgrp(int fd, pid_t pid) {
  if (!isatty(fd))
    return -1;
  return ioctl(fd, TIOCSPGRP, &pid);
}


x86 assembly (clang, -O0):
<tcsetpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isatty@plt>
cmp    $0x0,%eax
jne    114b <tcsetpgrp+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <tcsetpgrp+0x43>
mov    -0x8(%rbp),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsetpgrp>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,0xc(%rsp)
call   1030 <isatty@plt>
test   %eax,%eax
je     114b <tcsetpgrp+0x2b>
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1040 <ioctl@plt>
jmp    1150 <tcsetpgrp+0x30>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@TIOCSPGRP = global i32 0
define i32 @tcsetpgrp(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = tail call i32 @isatty(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @TIOCSPGRP
%8 = call i32 @ioctl(i32 %0, i32 %7, i32* %3)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ -1, %2 ]
ret i32 %10
}
void clk_disable(struct clk *c) {}


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

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

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

LLVM IR (-O2):
%struct.clk = type opaque
define void @clk_disable(%struct.clk* nocapture %0) {
ret void
}
int c065(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c065() {
ret i32 0
}
void ff_hevc_put_hevc_qpel_hv8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_hv8_12_sse4() {
ret void
}
int test_imm_E5int32_mem(int *val) {
  return ((*val) & (0xE5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E5int32_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, 229
%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_E5int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 229
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void delay_second(int i) {
  int j;
  for (; i != 0; i--) {
    for (j = 65535; j != 0; j--)
      ;
    { asm volatile("nop"); }
  }
}


x86 assembly (clang, -O0):
<delay_second>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <delay_second+0x44>
movl   $0xffff,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1135 <delay_second+0x35>
jmp    1127 <delay_second+0x27>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <delay_second+0x18>
nop
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <delay_second+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_second>:
test   %edi,%edi
je     1116 <delay_second+0x16>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
nop
add    $0xffffffff,%edi
jne    1110 <delay_second+0x10>
ret

LLVM IR (-O0):
define void @delay_second(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
store i32 65535, i32* %3
br label %8
8: ; preds = %12, %7
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
br label %8
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, -1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay_second(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%5 = add nsw i32 %4, -1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(
      stderr,
      "usage: locate [-0Scims] [-l limit] [-d database] pattern ...\n\n");
  (void)fprintf(stderr, "default database: `%s' or $LOCATE_PATH\n",
                "/var/db/locate.database");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"usage: locate [-0Scims] [-l limit] [-d database] pattern ...\0A\0A\00"
@.str.1 = [40 x i8] c"default database: `%s' or $LOCATE_PATH\0A\00"
@.str.2 = [24 x i8] c"/var/db/locate.database\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"usage: locate [-0Scims] [-l limit] [-d database] pattern ...\0A\0A\00"
@.str.1 = [40 x i8] c"default database: `%s' or $LOCATE_PATH\0A\00"
@.str.2 = [24 x i8] c"/var/db/locate.database\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printArray(int, int *);
int main(void) {
  int vetor[4] = {1, 2, 3, 4}, tamanho = 4;
  printArray(tamanho, vetor);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
call   1030 <printArray@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.vetor = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca i32
%3 = bitcast [4 x i32]* %1 to i8*
store i32 4, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = call i32 @printArray(i32 %4, i32* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vetor = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32 4, i32* %3)
ret i32 0
}
void _Unwind_RaiseException() {}


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

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

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

LLVM IR (-O2):
define void @_Unwind_RaiseException() {
ret void
}
void netdev_dpdk_register(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ config_weechat_debug_set_all();
void config_weechat_debug_change_cb(const void *pointer, void *data,
                                    struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  config_weechat_debug_set_all();
}


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

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

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @config_weechat_debug_change_cb(i8* %0, i8* %1, %struct.t_config_option* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_config_option*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.t_config_option* %2, %struct.t_config_option** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.t_config_option*, %struct.t_config_option** %6
%10 = call i32 (...) @config_weechat_debug_set_all()
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_weechat_debug_change_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 (...) @config_weechat_debug_set_all()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_palindrome(char const *, int, int);
void test9(void) {
  const char a[] = {'a', 'B', 'c', 'D', 'E', 'e', 'D', 'c', 'B', 'a'};
  test_palindrome(a, sizeof(a), 1);
  test_palindrome(a, sizeof(a), 2);
  printf("\n");
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
lea    -0xa(%rbp),%rdi
mov    $0xa,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6344654544634261,%rax
65 44 63
mov    %rax,(%rsp)
movw   $0x6142,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test9.a = [10 x i8] c"aBcDEeDcBa"
@.str = [2 x i8] c"\0A\00"
define void @test9() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_palindrome(i8* %3, i32 10, i32 1)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = call i32 @test_palindrome(i8* %5, i32 10, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.test9.a = [10 x i8] c"aBcDEeDcBa"
define void @test9() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @test_palindrome(i8* %2, i32 10, i32 1)
%4 = call i32 @test_palindrome(i8* %2, i32 10, i32 2)
%5 = call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int mhash_finish(int);
uint32_t hash_finish(uint32_t hash, uint32_t final) {
  return mhash_finish(hash ^ final);
}


x86 assembly (clang, -O0):
<hash_finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    -0x8(%rbp),%edi
call   1030 <mhash_finish@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_finish>:
xor    %esi,%edi
jmp    1030 <mhash_finish@plt>

LLVM IR (-O0):
define i32 @hash_finish(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 = xor i32 %5, %6
%8 = call i32 @mhash_finish(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash_finish(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = tail call i32 @mhash_finish(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
int /*<<< orphan*/ wcsrtombs(char *, int /*<<< orphan*/ const **, size_t,
                             int /*<<< orphan*/ *);
void uninitvar_wcsrtombs(void) {
  char *dst;
  const wchar_t *p;
  ;
  size_t len;
  mbstate_t *ps;
  (void)wcsrtombs(dst, &p, len, ps);
}


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

x86 assembly (clang, -O2):
<uninitvar_wcsrtombs>:
push   %rax
mov    %rsp,%rsi
call   1030 <wcsrtombs@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @uninitvar_wcsrtombs() {
%1 = alloca i8*
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i32*
%5 = load i8*, i8** %1
%6 = load i64, i64* %3
%7 = load i32*, i32** %4
%8 = call i32 @wcsrtombs(i8* %5, i32** %2, i64 %6, i32* %7)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcsrtombs() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @wcsrtombs(i8* undef, i32** %1, i64 undef, i32* undef)
ret void
}
int __attribute__((noderef)) * func(int __attribute__((noderef)) * arg) {
  int y = *arg;
  return arg;
}


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

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

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

LLVM IR (-O2):
define i32* @func(i32* readnone returned %0) {
ret i32* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
void print_elem(void *e, int64_t c, void *p) {
  int ee = *(int *)(e);
  printf("%d => %lld\n", ee, c);
}


x86 assembly (clang, -O0):
<print_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"%d => %lld\0A\00"
define void @print_elem(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d => %lld\0A\00"
define void @print_elem(i8* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t size) {
  void *ret;
  ret = malloc(size);
  if (ret == NULL) {
    perror("malloc");
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <xmalloc+0x3a>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ pic_is_normal_IRQ(int);
int /*<<< orphan*/ pic_send_EOI_normal(int);
int /*<<< orphan*/ pic_send_EOI_spurious(int);
void isr_irq_15() {
  if (pic_is_normal_IRQ(15)) {
    pic_send_EOI_normal(15);
  } else {
    pic_send_EOI_spurious(15);
  }
}


x86 assembly (clang, -O0):
<isr_irq_15>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1040 <pic_is_normal_IRQ@plt>
cmp    $0x0,%rax
je     1157 <isr_irq_15+0x27>
mov    $0xf,%edi
call   1050 <pic_send_EOI_normal@plt>
jmp    1161 <isr_irq_15+0x31>
mov    $0xf,%edi
call   1030 <pic_send_EOI_spurious@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isr_irq_15>:
push   %rax
mov    $0xf,%edi
call   1040 <pic_is_normal_IRQ@plt>
mov    $0xf,%edi
test   %rax,%rax
je     114b <isr_irq_15+0x1b>
pop    %rax
jmp    1050 <pic_send_EOI_normal@plt>
pop    %rax
jmp    1030 <pic_send_EOI_spurious@plt>

LLVM IR (-O0):
define void @isr_irq_15() {
%1 = call i64 @pic_is_normal_IRQ(i32 15)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @pic_send_EOI_normal(i32 15)
br label %7
5: ; preds = %0
%6 = call i32 @pic_send_EOI_spurious(i32 15)
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
define void @isr_irq_15() {
%1 = tail call i64 @pic_is_normal_IRQ(i32 15)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @pic_send_EOI_normal(i32 15)
br label %7
5: ; preds = %0
%6 = tail call i32 @pic_send_EOI_spurious(i32 15)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void sensors_default_fatal_error(const char *proc, const char *err) {
  fprintf(stderr, "Fatal error in `%s': %s\n", proc, err);
  exit(1);
}


x86 assembly (clang, -O0):
<sensors_default_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sensors_default_fatal_error>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Fatal error in `%s': %s\0A\00"
define void @sensors_default_fatal_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Fatal error in `%s': %s\0A\00"
define void @sensors_default_fatal_error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ FreeWorm();
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ refresh();
void Error_Quit(char *msg) {
  extern WINDOW *mainwin;
  extern int oldcur;
  delwin(mainwin);
  curs_set(oldcur);
  endwin();
  refresh();
  FreeWorm();
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<Error_Quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e65(%rip),%rax
mov    (%rax),%rdi
call   1040 <delwin@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1090 <curs_set@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1030 <FreeWorm@plt>
mov    -0x8(%rbp),%rdi
call   1070 <perror@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<Error_Quit>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e6d(%rip),%rax
mov    (%rax),%rdi
call   1040 <delwin@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1090 <curs_set@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1030 <FreeWorm@plt>
mov    %rbx,%rdi
call   1070 <perror@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@mainwin = external global i32*
@oldcur = external global i32
@EXIT_FAILURE = global i32 0
define void @Error_Quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32*, i32** @mainwin
%4 = call i32 @delwin(i32* %3)
%5 = load i32, i32* @oldcur
%6 = call i32 @curs_set(i32 %5)
%7 = call i32 (...) @endwin()
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @FreeWorm()
%10 = load i8*, i8** %2
%11 = call i32 @perror(i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@mainwin = external global i32*
@oldcur = external global i32
@EXIT_FAILURE = global i32 0
define void @Error_Quit(i8* nocapture %0) {
%2 = load i32*, i32** @mainwin
%3 = tail call i32 @delwin(i32* %2)
%4 = load i32, i32* @oldcur
%5 = tail call i32 @curs_set(i32 %4)
%6 = tail call i32 (...) @endwin()
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 (...) @FreeWorm()
%9 = tail call i32 @perror(i8* %0)
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ alloc_failed(char const *, int);
int /*<<< orphan*/ assert(int);
void *realloc(void *, long);
void *mem_resize(void *ptr, long nbytes, const char *file, int line) {
  assert(ptr);
  assert(nbytes > 0);
  ptr = realloc(ptr, nbytes);
  if (ptr == NULL) {
    alloc_failed(file, line);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<mem_resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    118c <mem_resize+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <alloc_failed@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_resize>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbp,%rbp
setg   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <realloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1174 <mem_resize+0x44>
mov    %r15,%rdi
mov    %r14d,%esi
call   1040 <alloc_failed@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @mem_resize(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %6
%13 = icmp sgt i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i8* @realloc(i8* %16, i64 %17)
store i8* %18, i8** %5
%19 = load i8*, i8** %5
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %25
21: ; preds = %4
%22 = load i8*, i8** %7
%23 = load i32, i32* %8
%24 = call i32 @alloc_failed(i8* %22, i32 %23)
br label %25
25: ; preds = %21, %4
%26 = load i8*, i8** %5
ret i8* %26
}

LLVM IR (-O2):
define noalias i8* @mem_resize(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = ptrtoint i8* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp sgt i64 %1, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i8* @realloc(i8* %0, i64 %1)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = tail call i32 @alloc_failed(i8* %2, i32 %3)
br label %15
15: ; preds = %13, %4
ret i8* %11
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank7(int);
void m65setParamsB007(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank7(val << 10);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xa,%edi
call   1030 <chr1setBank7@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank7@plt>

LLVM IR (-O0):
define void @m65setParamsB007(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 = shl i32 %6, 10
%8 = call i32 @chr1setBank7(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m65setParamsB007(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank7(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displays_describe_name_before_describe_block(char const *);
void Displayer_display_describe_name(const char *desc) {
  displays_describe_name_before_describe_block(desc);
}


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

x86 assembly (clang, -O2):
<Displayer_display_describe_name>:
jmp    1030 <displays_describe_name_before_describe_block@plt>

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

LLVM IR (-O2):
define void @Displayer_display_describe_name(i8* %0) {
%2 = tail call i32 @displays_describe_name_before_describe_block(i8* %0)
ret void
}
int omap_get_gpt_irq(int n) { return 37 + (n - 1); }


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

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

LLVM IR (-O0):
define i32 @omap_get_gpt_irq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = add nsw i32 37, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @omap_get_gpt_irq(i32 %0) {
%2 = add nsw i32 %0, 36
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void exit_on_error(const char *error) {
  if (error != NULL) {
    fputs(error, stderr);
  }
  _exit(-1);
}


x86 assembly (clang, -O0):
<exit_on_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <exit_on_error+0x29>
mov    -0x8(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit_on_error>:
push   %rax
test   %rdi,%rdi
je     1134 <exit_on_error+0x14>
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define void @exit_on_error(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* %0, i32 %4)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t SCB_GetFPUType(void) { return 0U; }


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

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

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

LLVM IR (-O2):
define i32 @SCB_GetFPUType() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parse_bool(char const *, int *);
int /*<<< orphan*/ set_show_all_tracks_int(int);
void set_show_all_tracks(unsigned int id, const char *buf) {
  int tmp;
  parse_bool(buf, &tmp);
  set_show_all_tracks_int(tmp);
}


x86 assembly (clang, -O0):
<set_show_all_tracks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <parse_bool@plt>
mov    -0x14(%rbp),%edi
call   1040 <set_show_all_tracks_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_show_all_tracks>:
push   %rax
mov    %rsi,%rdi
lea    0x4(%rsp),%rsi
call   1030 <parse_bool@plt>
mov    0x4(%rsp),%edi
call   1040 <set_show_all_tracks_int@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @set_show_all_tracks(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @parse_bool(i8* %1, i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @set_show_all_tracks_int(i32 %6)
ret void
}
const char *zlibVersion() { return "1.2.3"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.3\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ traverse(struct TreeNode *, int **, int *);
int *preorderTraversal0(struct TreeNode *root, int *returnSize) {
  if (!root)
    return NULL;
  int *arr = (int *)malloc(sizeof(int));
  *returnSize = 0;
  traverse(root, &arr, returnSize);
  return arr;
}


x86 assembly (clang, -O0):
<preorderTraversal0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <preorderTraversal0+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1179 <preorderTraversal0+0x59>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rsi
call   1030 <traverse@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preorderTraversal0>:
test   %rdi,%rdi
je     115e <preorderTraversal0+0x3e>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,(%rsp)
movl   $0x0,(%r14)
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <traverse@plt>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32* @preorderTraversal0(%struct.TreeNode* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca %struct.TreeNode*
%5 = alloca i32*
%6 = alloca i32*
store %struct.TreeNode* %0, %struct.TreeNode** %4
store i32* %1, i32** %5
%7 = load %struct.TreeNode*, %struct.TreeNode** %4
%8 = icmp ne %struct.TreeNode* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i32* null, i32** %3
br label %18
10: ; preds = %2
%11 = call i64 @malloc(i32 4)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %6
%13 = load i32*, i32** %5
store i32 0, i32* %13
%14 = load %struct.TreeNode*, %struct.TreeNode** %4
%15 = load i32*, i32** %5
%16 = call i32 @traverse(%struct.TreeNode* %14, i32** %6, i32* %15)
%17 = load i32*, i32** %6
store i32* %17, i32** %3
br label %18
18: ; preds = %10, %9
%19 = load i32*, i32** %3
ret i32* %19
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32* @preorderTraversal0(%struct.TreeNode* %0, i32* %1) {
%3 = alloca i32*
%4 = icmp eq %struct.TreeNode* %0, null
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = bitcast i32** %3 to i8*
%7 = tail call i64 @malloc(i32 4)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %3
store i32 0, i32* %1
%9 = call i32 @traverse(%struct.TreeNode* %0, i32** %3, i32* %1)
%10 = load i32*, i32** %3
br label %11
11: ; preds = %2, %5
%12 = phi i32* [ %10, %5 ], [ null, %2 ]
ret i32* %12
}
/* Variables and functions */
int f(int);
char *g(int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", g(1));
  return f(2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <g@plt>
mov    %rax,%rsi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <g@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <f@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @g(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @f(i32 2)
ret i32 %3
}
void free2d(int **grid, int w) {
  int i = 0;
  for (; i < w; i++) {
    free(grid[i]);
  }
  free(grid);
}


x86 assembly (clang, -O0):
<free2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free2d+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free2d+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casAMLabel_get_height() {
ret i32 12
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casAMLabel_get_height() {
ret i32 12
}