xunge/DecIR huggingface dataset:
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_bkgrndset(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_bkgrndset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_bkgrndset+0x2a>
jmp    1170 <cmd_bkgrndset+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_bkgrndset>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_bkgrndset+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_bkgrndset(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *xfread_name(int /*<<< orphan*/ *, char *, int);
char *xfread_lstring(FILE *fp, char *filename) {
  return xfread_name(fp, filename, 2);
}


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

x86 assembly (clang, -O2):
<xfread_lstring>:
mov    $0x2,%edx
jmp    1030 <xfread_name@plt>

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

LLVM IR (-O2):
define i8* @xfread_lstring(i32* %0, i8* %1) {
%3 = tail call i8* @xfread_name(i32* %0, i8* %1, i32 2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void s_quit() { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<s_quit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<s_quit>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @s_quit() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @s_quit() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
print_ack_send_error(int block_number) {
  printf("Unable to send ACK packet with block number %d\n", block_number);
  exit(1);
}


x86 assembly (clang, -O0):
<print_ack_send_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_ack_send_error>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Unable to send ACK packet with block number %d\0A\00"
define i32 @print_ack_send_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [48 x i8] c"Unable to send ACK packet with block number %d\0A\00"
define i32 @print_ack_send_error(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int iJIT_GetNewMethodID() {
  static unsigned int methodID = 0x100000;
  if (methodID == 0)
    return 0;
  return methodID++;
}


x86 assembly (clang, -O0):
<iJIT_GetNewMethodID>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f15(%rip)
jne    111d <iJIT_GetNewMethodID+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1131 <iJIT_GetNewMethodID+0x31>
mov    0x2efd(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2ef2(%rip)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iJIT_GetNewMethodID>:
mov    0x2f1a(%rip),%eax
test   %eax,%eax
je     1113 <iJIT_GetNewMethodID+0x13>
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0d(%rip)
ret

LLVM IR (-O0):
@iJIT_GetNewMethodID.methodID = internal global i32 1048576
define i32 @iJIT_GetNewMethodID() {
%1 = alloca i32
%2 = load i32, i32* @iJIT_GetNewMethodID.methodID
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %8
5: ; preds = %0
%6 = load i32, i32* @iJIT_GetNewMethodID.methodID
%7 = add i32 %6, 1
store i32 %7, i32* @iJIT_GetNewMethodID.methodID
store i32 %6, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@iJIT_GetNewMethodID.methodID = internal unnamed_addr global i32 1048576
define i32 @iJIT_GetNewMethodID() {
%1 = load i32, i32* @iJIT_GetNewMethodID.methodID
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = add i32 %1, 1
store i32 %4, i32* @iJIT_GetNewMethodID.methodID
br label %5
5: ; preds = %0, %3
ret i32 %1
}
int __sx25_read_config_parameters_file(
    char *filename, struct config_ident *ipt, struct LINK_config_data *lpt,
    struct X25_config_data *xpt, struct MLP_config_data *mpt,
    struct LAPB_config_data *lbp, struct LLC2_config_data *l2p,
    struct WAN_config_data *wpt, int *flags) {
  return (0);
}


x86 assembly (clang, -O0):
<__sx25_read_config_parameters_file>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.config_ident = type opaque
%struct.LINK_config_data = type opaque
%struct.X25_config_data = type opaque
%struct.MLP_config_data = type opaque
%struct.LAPB_config_data = type opaque
%struct.LLC2_config_data = type opaque
%struct.WAN_config_data = type opaque
define i32 @__sx25_read_config_parameters_file(i8* %0, %struct.config_ident* %1, %struct.LINK_config_data* %2, %struct.X25_config_data* %3, %struct.MLP_config_data* %4, %struct.LAPB_config_data* %5, %struct.LLC2_config_data* %6, %struct.WAN_config_data* %7, i32* %8) {
%10 = alloca i8*
%11 = alloca %struct.config_ident*
%12 = alloca %struct.LINK_config_data*
%13 = alloca %struct.X25_config_data*
%14 = alloca %struct.MLP_config_data*
%15 = alloca %struct.LAPB_config_data*
%16 = alloca %struct.LLC2_config_data*
%17 = alloca %struct.WAN_config_data*
%18 = alloca i32*
store i8* %0, i8** %10
store %struct.config_ident* %1, %struct.config_ident** %11
store %struct.LINK_config_data* %2, %struct.LINK_config_data** %12
store %struct.X25_config_data* %3, %struct.X25_config_data** %13
store %struct.MLP_config_data* %4, %struct.MLP_config_data** %14
store %struct.LAPB_config_data* %5, %struct.LAPB_config_data** %15
store %struct.LLC2_config_data* %6, %struct.LLC2_config_data** %16
store %struct.WAN_config_data* %7, %struct.WAN_config_data** %17
store i32* %8, i32** %18
ret i32 0
}

LLVM IR (-O2):
%struct.config_ident = type opaque
%struct.LINK_config_data = type opaque
%struct.X25_config_data = type opaque
%struct.MLP_config_data = type opaque
%struct.LAPB_config_data = type opaque
%struct.LLC2_config_data = type opaque
%struct.WAN_config_data = type opaque
define i32 @__sx25_read_config_parameters_file(i8* nocapture readnone %0, %struct.config_ident* nocapture readnone %1, %struct.LINK_config_data* nocapture readnone %2, %struct.X25_config_data* nocapture readnone %3, %struct.MLP_config_data* nocapture readnone %4, %struct.LAPB_config_data* nocapture readnone %5, %struct.LLC2_config_data* nocapture readnone %6, %struct.WAN_config_data* nocapture readnone %7, i32* nocapture readnone %8) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x20() {
  Assert_real((isbdigit(32) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              165, ("isbdigit should be 0 for  "));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x20>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xa5,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x20>:
push   %rax
mov    $0x20,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xa5,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for \00"
define void @t_isbdigit_0x20() {
%1 = call i64 @isbdigit(i32 32)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 165, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for \00"
define void @t_isbdigit_0x20() {
%1 = tail call i64 @isbdigit(i32 32)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 165, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncasecmp(char const *, char *, int);
int is_url(const char *str) {
  return !strncasecmp(str, "http://", sizeof("http://") - 1) ||
         !strncasecmp(str, "ftp://", sizeof("ftp://") - 1);
}


x86 assembly (clang, -O0):
<is_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1161 <is_url+0x51>
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_url>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1148 <is_url+0x38>
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncasecmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"http://\00"
@.str.1 = [7 x i8] c"ftp://\00"
define i32 @is_url(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strncasecmp(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"http://\00"
@.str.1 = [7 x i8] c"ftp://\00"
define i32 @is_url(i8* nocapture %0) {
%2 = tail call i32 @strncasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strncasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct tftphdr {
  int dummy;
};

/* Variables and functions */
struct tftphdr *tftprw_init(int);
struct tftphdr *tftpr_init() {
  return tftprw_init(1);
}


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

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

LLVM IR (-O0):
%struct.tftphdr = type { i32 }
define %struct.tftphdr* @tftpr_init() {
%1 = call %struct.tftphdr* @tftprw_init(i32 1)
ret %struct.tftphdr* %1
}

LLVM IR (-O2):
%struct.tftphdr = type { i32 }
define %struct.tftphdr* @tftpr_init() {
%1 = tail call %struct.tftphdr* @tftprw_init(i32 1)
ret %struct.tftphdr* %1
}
void GPIO1PinMuxSetup(unsigned int pinNo) {
  (*((volatile unsigned int *)((0x44E10000) + (0x800 + (pinNo * 4))))) =
      ((0x00000040u) | (0x00000020u) | ((0x00000008u) & (~(0x00000008u))) |
       ((0x00000010u) & (~(0x00000010u))) | ((7)));
}


x86 assembly (clang, -O0):
<GPIO1PinMuxSetup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0x800,%eax
add    $0x44e10000,%eax
mov    %eax,%eax
movl   $0x67,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO1PinMuxSetup>:
lea    0x44e10800(,%rdi,4),%eax
movl   $0x67,(%rax)
ret

LLVM IR (-O0):
define void @GPIO1PinMuxSetup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 4
%5 = add i32 2048, %4
%6 = add i32 1155596288, %5
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 103, i32* %8
ret void
}

LLVM IR (-O2):
define void @GPIO1PinMuxSetup(i32 %0) {
%2 = shl i32 %0, 2
%3 = add i32 %2, 1155598336
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 103, i32* %5
ret void
}
/* Type definitions */
struct cbor_buf {
  int dummy;
};

/* Variables and functions */
int cbor_buf_append_byte(struct cbor_buf *, int);
bool cbor_add_undef(struct cbor_buf *buf) {
  return cbor_buf_append_byte(buf, 0xf7);
}


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

x86 assembly (clang, -O2):
<cbor_add_undef>:
mov    $0xf7,%esi
jmp    1030 <cbor_buf_append_byte@plt>

LLVM IR (-O0):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_undef(%struct.cbor_buf* %0) {
%2 = alloca %struct.cbor_buf*
store %struct.cbor_buf* %0, %struct.cbor_buf** %2
%3 = load %struct.cbor_buf*, %struct.cbor_buf** %2
%4 = call i32 @cbor_buf_append_byte(%struct.cbor_buf* %3, i32 247)
ret i32 %4
}

LLVM IR (-O2):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_undef(%struct.cbor_buf* %0) {
%2 = tail call i32 @cbor_buf_append_byte(%struct.cbor_buf* %0, i32 247)
ret i32 %2
}
/* Type definitions */
struct linger {
  int l_onoff;
  scalar_t__ l_linger;
};
typedef int /*<<< orphan*/ linger;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_LINGER;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              struct linger *, int);
void _nxweb_close_bad_socket(int fd) {
  struct linger linger;
  linger.l_onoff = 1;
  linger.l_linger = 0;
  setsockopt(fd, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger));
  close(fd);
}


x86 assembly (clang, -O0):
<_nxweb_close_bad_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nxweb_close_bad_socket>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x1,(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
mov    %ebx,%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.linger = type { i32, i64 }
@SOL_SOCKET = global i32 0
@SO_LINGER = global i32 0
define void @_nxweb_close_bad_socket(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.linger
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.linger, %struct.linger* %3, i32 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.linger, %struct.linger* %3, i32 0, i32 1
store i64 0, i64* %5
%6 = load i32, i32* %2
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_LINGER
%9 = call i32 @setsockopt(i32 %6, i32 %7, i32 %8, %struct.linger* %3, i32 16)
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
ret void
}

LLVM IR (-O2):
%struct.linger = type { i32, i64 }
@SOL_SOCKET = global i32 0
@SO_LINGER = global i32 0
define void @_nxweb_close_bad_socket(i32 %0) {
%2 = alloca %struct.linger
%3 = bitcast %struct.linger* %2 to i8*
%4 = getelementptr inbounds %struct.linger, %struct.linger* %2, i64 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.linger, %struct.linger* %2, i64 0, i32 1
store i64 0, i64* %5
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_LINGER
%8 = call i32 @setsockopt(i32 %0, i32 %6, i32 %7, %struct.linger* %2, i32 16)
%9 = call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sumar(int, int, int, int, int, int *);
int main() {
  int *f = malloc(sizeof(int));
  sumar(1, 2, 3, 4, 5, f);
  printf("Resultado= %d\n", *f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%r9
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
call   1040 <sumar@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    %rax,%r9
call   1040 <sumar@plt>
mov    (%rbx),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Resultado= %d\0A\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @sumar(i32 1, i32 2, i32 3, i32 4, i32 5, i32* %1)
%3 = load i32, i32* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double deg, rad;
  printf("Podaj kat w stopniach : ");
  scanf("%lf", &deg);
  rad = 2 * 3.14159265358979323846 * deg / 360;
  printf("%.4f deg = %.4f rad\n", deg, rad);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb3(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeb1(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xeb5(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xeb1(%rip),%xmm1
lea    0xecf(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Podaj kat w stopniach : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c"%.4f deg = %.4f rad\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = fmul double 0x401921FB54442D18, %6
%8 = fdiv double %7, 3.600000e+02
store double %8, double* %3
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %9, double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Podaj kat w stopniach : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c"%.4f deg = %.4f rad\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 0x401921FB54442D18
%7 = fdiv double %6, 3.600000e+02
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %5, double %7)
ret i32 0
}
void copy_summary(int b[1000], int a[1000], int pos) {
  b[pos] = 0;
  int c = a[pos];
}


x86 assembly (clang, -O0):
<copy_summary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_summary>:
movslq %edx,%rax
movl   $0x0,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @copy_summary(i32* nocapture writeonly %0, i32* nocapture readnone %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 0, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LUCroutInplaceDecompose(int, double *);
extern void LUInDec(int n, double *A) {
  LUCroutInplaceDecompose(n, A);
  return;
}


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

x86 assembly (clang, -O2):
<LUInDec>:
jmp    1030 <LUCroutInplaceDecompose@plt>

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

LLVM IR (-O2):
define void @LUInDec(i32 %0, double* %1) {
%3 = tail call i32 @LUCroutInplaceDecompose(i32 %0, double* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void function4() { printf("Function 4\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Function 4\00"
define void @function4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
void bundled_version(int *major, int *minor, int *patch) {
  *major = 1;
  *minor = 2;
  *patch = 3;
}


x86 assembly (clang, -O0):
<bundled_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bundled_version>:
movl   $0x1,(%rdi)
movl   $0x2,(%rsi)
movl   $0x3,(%rdx)
ret

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

LLVM IR (-O2):
define void @bundled_version(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 1, i32* %0
store i32 2, i32* %1
store i32 3, i32* %2
ret void
}
void f() { extern int l __attribute__((cvmx_shared)); }


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
int main() {
  int i = 0;
  do {
    ++i;
    --i;
    ++i;
  } while (i < 0);
  do
    ++i;
  while (i < 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1112 <main+0x12>
jmp    113c <main+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     113c <main+0x3c>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int is_blockgraphics(int ucs) { return ucs >= 0x2500 && ucs <= 0x25FF; }


x86 assembly (clang, -O0):
<is_blockgraphics>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2500,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <is_blockgraphics+0x26>
cmpl   $0x25ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blockgraphics>:
and    $0xffffff00,%edi
xor    %eax,%eax
cmp    $0x2500,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_blockgraphics(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 9472
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 9727
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_blockgraphics(i32 %0) {
%2 = and i32 %0, -256
%3 = icmp eq i32 %2, 9472
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(long);
void outInt(long data) {
  putchar(data >> 24);
  putchar(data >> 16);
  putchar(data >> 8);
  putchar(data);
}


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

x86 assembly (clang, -O2):
<outInt>:
push   %rbx
mov    %rdi,%rbx
sar    $0x18,%rdi
call   1030 <putchar@plt>
mov    %rbx,%rdi
sar    $0x10,%rdi
call   1030 <putchar@plt>
mov    %rbx,%rdi
sar    $0x8,%rdi
call   1030 <putchar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @outInt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 24
%5 = call i32 @putchar(i64 %4)
%6 = load i64, i64* %2
%7 = ashr i64 %6, 16
%8 = call i32 @putchar(i64 %7)
%9 = load i64, i64* %2
%10 = ashr i64 %9, 8
%11 = call i32 @putchar(i64 %10)
%12 = load i64, i64* %2
%13 = call i32 @putchar(i64 %12)
ret void
}

LLVM IR (-O2):
define void @outInt(i64 %0) {
%2 = ashr i64 %0, 24
%3 = tail call i32 @putchar(i64 %2)
%4 = ashr i64 %0, 16
%5 = tail call i32 @putchar(i64 %4)
%6 = ashr i64 %0, 8
%7 = tail call i32 @putchar(i64 %6)
%8 = tail call i32 @putchar(i64 %0)
ret void
}
/* Variables and functions */
unsigned int get_seed();
int rand();
int /*<<< orphan*/ srand(unsigned int);
int rand_int(int min, int max) {
  int range = max - min;
  unsigned int seed = get_seed();
  int temp = 0;
  srand(seed);
  temp = rand() % range;
  return temp + min;
}


x86 assembly (clang, -O0):
<rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <get_seed@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sub    %edi,%ebx
xor    %eax,%eax
call   1040 <get_seed@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %5
%11 = call i32 (...) @get_seed()
store i32 %11, i32* %6
store i32 0, i32* %7
%12 = load i32, i32* %6
%13 = call i32 @srand(i32 %12)
%14 = call i32 (...) @rand()
%15 = load i32, i32* %5
%16 = srem i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @rand_int(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 (...) @get_seed()
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, %3
%8 = add nsw i32 %7, %0
ret i32 %8
}
signed long long signedlonglong_ignoring_longint(signed long long x,
                                                 long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlonglong_ignoring_longint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_longint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
bool is_octal_digit(char c) { return c >= '0' && c <= '7'; }


x86 assembly (clang, -O0):
<is_octal_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_octal_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_octal_digit>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_octal_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 55
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_octal_digit(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
int Strlenrm(char *s, int c) {
  int i = 0;
  while (*s != 0 && *s != c) {
    i++;
    *s++;
  }
  return i;
}


x86 assembly (clang, -O0):
<Strlenrm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <Strlenrm+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <Strlenrm+0x47>
jmp    1161 <Strlenrm+0x61>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <Strlenrm+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strlenrm>:
movsbl (%rdi),%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1121 <Strlenrm+0x21>
cmp    %esi,%ecx
je     1121 <Strlenrm+0x21>
xor    %eax,%eax
nop
movsbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1121 <Strlenrm+0x21>
cmp    %esi,%ecx
jne    1110 <Strlenrm+0x10>
ret

LLVM IR (-O0):
define i32 @Strlenrm(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 = %19, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i32, i32* %4
%16 = icmp ne i32 %14, %15
br label %17
17: ; preds = %11, %6
%18 = phi i1 [ false, %6 ], [ %16, %11 ]
br i1 %18, label %19, label %25
19: ; preds = %17
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
%24 = load i8, i8* %22
br label %6
25: ; preds = %17
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @Strlenrm(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = sext i8 %3 to i32
%6 = icmp eq i32 %5, %1
%7 = or i1 %4, %6
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ 0, %2 ]
%10 = phi i8* [ %12, %8 ], [ %0, %2 ]
%11 = add nuw nsw i32 %9, 1
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
%15 = sext i8 %13 to i32
%16 = icmp eq i32 %15, %1
%17 = or i1 %14, %16
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i32 [ 0, %2 ], [ %11, %8 ]
ret i32 %19
}
/* Variables and functions */
int strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int expand_arg(char *arg) {
  if (!arg)
    return 0;
  return strtol(arg, NULL, 0);
}


x86 assembly (clang, -O0):
<expand_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <expand_arg+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1145 <expand_arg+0x35>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_arg>:
test   %rdi,%rdi
je     111e <expand_arg+0xe>
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <strtol@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @expand_arg(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
unsigned long in32(unsigned long addr) {
  return *(volatile unsigned long *)addr;
}


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

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

LLVM IR (-O0):
define i64 @in32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @in32(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
ret i64 %3
}
int main(void) {
  if (a$b() != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <a$b@plt>
cmp    $0x1,%eax
je     1144 <main+0x24>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <a$b@plt>
cmp    $0x1,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @"a$b"()
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %5
4: ; preds = %0
unreachable
5: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @"a$b"()
%2 = icmp eq i32 %1, 1
br i1 %2, label %4, label %3
3: ; preds = %0
tail call void @abort()
unreachable
4: ; preds = %0
ret i32 0
}
void Scalar_TYPE_Ops_dummy___() { ; }


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

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

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

LLVM IR (-O2):
define void @Scalar_TYPE_Ops_dummy___() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int L3(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  uint32_t c = L3(2, 2);
  printf("2+2=%d\n", c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <L3@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"2+2=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @L3(i32 2, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
char *compare2(int x, int y) {
  x = y;
  return "ok";
}


x86 assembly (clang, -O0):
<compare2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    0xee9(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
define i8* @compare2(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
store i32 %5, i32* %3
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
define i8* @compare2(i32 %0, i32 %1) {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
int hex(int c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  if (c >= 'A' && c <= 'F')
    return c - 'A' + 10;
  if (c >= 'a' && c <= 'f')
    return c - 'a' + 10;
  return -1;
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <hex+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <hex+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     114e <hex+0x4e>
cmpl   $0x46,-0x8(%rbp)
jg     114e <hex+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     1173 <hex+0x73>
cmpl   $0x66,-0x8(%rbp)
jg     1173 <hex+0x73>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <hex+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hex+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 70
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 102
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -55
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -87
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ _asschn();
int /*<<< orphan*/ _outnl();
_nl() {
  _asschn();
  _outnl();
}


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

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

LLVM IR (-O0):
define i32 @_nl() {
%1 = alloca i32
%2 = call i32 (...) @_asschn()
%3 = call i32 (...) @_outnl()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @_nl() {
%1 = tail call i32 (...) @_asschn()
%2 = tail call i32 (...) @_outnl()
ret i32 undef
}
/* Type definitions */
struct rq {
  int dummy;
};

/* Variables and functions */
scalar_t__ rq_push_task(struct rq *, int *);
int rq_push_tasks(struct rq *this_rq) {
  int push_count = 0;
  while (rq_push_task(this_rq, &push_count))
    ;
  return push_count;
}


x86 assembly (clang, -O0):
<rq_push_tasks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <rq_push_task@plt>
cmp    $0x0,%rax
je     113f <rq_push_tasks+0x2f>
jmp    1123 <rq_push_tasks+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_push_tasks>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <rq_push_task@plt>
test   %rax,%rax
jne    1130 <rq_push_tasks+0x20>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.rq = type { i32 }
define i32 @rq_push_tasks(%struct.rq* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %4, %1
%5 = call i64 @rq_push_task(%struct.rq* %0, i32* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = load i32, i32* %2
ret i32 %8
}