xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(int, unsigned int);
void *utilAllocateData(unsigned int numbytes) { return calloc(1, numbytes); }


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

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

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

LLVM IR (-O2):
define noalias i8* @utilAllocateData(i32 %0) {
%2 = tail call i8* @calloc(i32 1, i32 %0)
ret i8* %2
}
int main() {
  *((int *)0) = 7;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
movl   $0x7,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 7, i32* null
ret i32 0
}

LLVM IR (-O2):
void av_pkt_dump2() {}


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

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

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

LLVM IR (-O2):
define void @av_pkt_dump2() {
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ read(int, void *, size_t);
ssize_t sf_read(int fd, void *buffer, size_t len) {
  ssize_t n = 0;
  do {
    n = read(fd, buffer, len);
  } while (n < 0 && errno == EINTR);
  return n;
}


x86 assembly (clang, -O0):
<sf_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jge    1169 <sf_read+0x59>
mov    0x2e8a(%rip),%rax
mov    (%rax),%rax
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    112b <sf_read+0x1b>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sf_read>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read@plt>
test   %rax,%rax
jns    114b <sf_read+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <sf_read+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i64 @sf_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i64 @read(i32 %9, i8* %10, i64 %11)
store i64 %12, i64* %7
br label %13
13: ; preds = %8
%14 = load i64, i64* %7
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i64, i64* %7
ret i64 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i64 @sf_read(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%6 = icmp slt i64 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i64 %5
}
long main() { long x, y, z; }


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

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

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

LLVM IR (-O2):
define i64 @main() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ cons_clear();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pause() {
  printf("Press any key to continue.\n");
  getchar();
  getchar();
  cons_clear();
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1050 <cons_clear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cons_clear@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Press any key to continue.\0A\00"
define void @pause() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
%3 = call i32 (...) @getchar()
%4 = call i32 (...) @cons_clear()
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Press any key to continue.\00"
define void @pause() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 (...) @cons_clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHeader() {
  printf("\n  ***********ISP BASED FLASH PROGRAMMER FOR AT89S51 AND "
         "AT89S52***********\n\n");
  printf("  ***************  ORIGINALLY WRITTEN BY SRIKANT PATNAIK   "
         "***************\n");
  printf("  **********  PRESENT VERSION MODIFIED BY KARSTEN ALBREKTSEN  "
         "************\n\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<printHeader>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xf19(%rip),%rdi
call   1040 <puts@plt>
lea    0xf58(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [78 x i8] c"\0A ***********ISP BASED FLASH PROGRAMMER FOR AT89S51 AND AT89S52***********\0A\0A\00"
@.str.1 = [76 x i8] c" *************** ORIGINALLY WRITTEN BY SRIKANT PATNAIK ***************\0A\00"
@.str.2 = [77 x i8] c" ********** PRESENT VERSION MODIFIED BY KARSTEN ALBREKTSEN ************\0A\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @printHeader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [77 x i8] c"\0A ***********ISP BASED FLASH PROGRAMMER FOR AT89S51 AND AT89S52***********\0A\00"
@str.4 = [75 x i8] c" *************** ORIGINALLY WRITTEN BY SRIKANT PATNAIK ***************\00"
@str.5 = [76 x i8] c" ********** PRESENT VERSION MODIFIED BY KARSTEN ALBREKTSEN ************\0A\00"
define void @printHeader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ hypot(double, double);
long double hypotl(long double x, long double y) {
  return (long double)hypot((double)x, (double)y);
}


x86 assembly (clang, -O0):
<hypotl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
call   1030 <hypot@plt>
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypotl>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
fstpl  (%rsp)
movsd  (%rsp),%xmm1
call   1030 <hypot@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @hypotl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call i64 @hypot(double %6, double %8)
%10 = sitofp i64 %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @hypotl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call i64 @hypot(double %3, double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}
int __sx25_write_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) {
  return (0);
}


x86 assembly (clang, -O0):
<__sx25_write_config_parameters_file>:
push   %rbp
mov    %rsp,%rbp
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_write_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_write_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) {
%9 = alloca i8*
%10 = alloca %struct.config_ident*
%11 = alloca %struct.LINK_config_data*
%12 = alloca %struct.X25_config_data*
%13 = alloca %struct.MLP_config_data*
%14 = alloca %struct.LAPB_config_data*
%15 = alloca %struct.LLC2_config_data*
%16 = alloca %struct.WAN_config_data*
store i8* %0, i8** %9
store %struct.config_ident* %1, %struct.config_ident** %10
store %struct.LINK_config_data* %2, %struct.LINK_config_data** %11
store %struct.X25_config_data* %3, %struct.X25_config_data** %12
store %struct.MLP_config_data* %4, %struct.MLP_config_data** %13
store %struct.LAPB_config_data* %5, %struct.LAPB_config_data** %14
store %struct.LLC2_config_data* %6, %struct.LLC2_config_data** %15
store %struct.WAN_config_data* %7, %struct.WAN_config_data** %16
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_write_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) {
ret i32 0
}
int main() {
  char arr[1];
  arr[0] = 1;
  return arr[0];
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int *retNull(char);
int ternaryRetNull(char cond) {
  int *p = retNull(cond);
  return *p;
}


x86 assembly (clang, -O0):
<ternaryRetNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <retNull@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ternaryRetNull>:
push   %rax
call   1030 <retNull@plt>
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ternaryRetNull(i8 signext %0) {
%2 = tail call i32* @retNull(i8 signext %0)
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushString(int /*<<< orphan*/);
int /*<<< orphan*/ readlinesock(int);
void basReadLineSock() {
  int sock;
  sock = popNumber();
  pushString(readlinesock(sock));
}


x86 assembly (clang, -O0):
<basReadLineSock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <readlinesock@plt>
mov    %eax,%edi
call   1040 <pushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basReadLineSock>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <readlinesock@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushString@plt>

LLVM IR (-O0):
define void @basReadLineSock() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @readlinesock(i32 %3)
%5 = call i32 @pushString(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basReadLineSock() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @readlinesock(i32 %1)
%3 = tail call i32 @pushString(i32 %2)
ret void
}
unsigned int int_hash(void *p) {
  unsigned int n = *((int *)p);
  return n;
}


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

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

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

LLVM IR (-O2):
define i32 @int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Delay_ms(int);
short read_ZIGBEE_short(int);
int /*<<< orphan*/ write_ZIGBEE_short(int, short);
void RF_reset() {
  short int temp = 0;
  temp = read_ZIGBEE_short(0x36);
  temp = temp | 0x04;
  write_ZIGBEE_short(0x36, temp);
  temp = temp & (!0x04);
  write_ZIGBEE_short(0x36, temp);
  Delay_ms(1);
}


x86 assembly (clang, -O0):
<RF_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
mov    $0x36,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
or     $0x4,%eax
mov    %ax,-0x2(%rbp)
mov    $0x36,%edi
movswl -0x2(%rbp),%esi
call   1040 <write_ZIGBEE_short@plt>
movswl -0x2(%rbp),%eax
and    $0x0,%eax
mov    %ax,-0x2(%rbp)
mov    $0x36,%edi
movswl -0x2(%rbp),%esi
call   1040 <write_ZIGBEE_short@plt>
mov    $0x1,%edi
call   1050 <Delay_ms@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RF_reset>:
push   %rax
mov    $0x36,%edi
call   1030 <read_ZIGBEE_short@plt>
or     $0x4,%eax
movswl %ax,%esi
mov    $0x36,%edi
call   1040 <write_ZIGBEE_short@plt>
mov    $0x36,%edi
xor    %esi,%esi
call   1040 <write_ZIGBEE_short@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <Delay_ms@plt>

LLVM IR (-O0):
define void @RF_reset() {
%1 = alloca i16
store i16 0, i16* %1
%2 = call signext i16 @read_ZIGBEE_short(i32 54)
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = or i32 %4, 4
%6 = trunc i32 %5 to i16
store i16 %6, i16* %1
%7 = load i16, i16* %1
%8 = call i32 @write_ZIGBEE_short(i32 54, i16 signext %7)
%9 = load i16, i16* %1
%10 = sext i16 %9 to i32
%11 = and i32 %10, 0
%12 = trunc i32 %11 to i16
store i16 %12, i16* %1
%13 = load i16, i16* %1
%14 = call i32 @write_ZIGBEE_short(i32 54, i16 signext %13)
%15 = call i32 @Delay_ms(i32 1)
ret void
}

LLVM IR (-O2):
define void @RF_reset() {
%1 = tail call signext i16 @read_ZIGBEE_short(i32 54)
%2 = or i16 %1, 4
%3 = tail call i32 @write_ZIGBEE_short(i32 54, i16 signext %2)
%4 = tail call i32 @write_ZIGBEE_short(i32 54, i16 signext 0)
%5 = tail call i32 @Delay_ms(i32 1)
ret void
}
int Bematech_FI_DataHora(Var, Retorno) {
  return Formata("\x1b|35|23|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_DataHora>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_DataHora>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|23|\1B\00"
define i32 @Bematech_FI_DataHora(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|23|\1B\00"
define i32 @Bematech_FI_DataHora(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int umorse_encode(char const *, size_t, int /*<<< orphan*/ *, size_t, int);
int umorse_encode_aligned(const char *text, size_t tlen, uint8_t *code,
                          size_t clen) {
  return umorse_encode(text, tlen, code, clen, (0x0));
}


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

x86 assembly (clang, -O2):
<umorse_encode_aligned>:
xor    %r8d,%r8d
jmp    1030 <umorse_encode@plt>

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

LLVM IR (-O2):
define i32 @umorse_encode_aligned(i8* %0, i64 %1, i32* %2, i64 %3) {
%5 = tail call i32 @umorse_encode(i8* %0, i64 %1, i32* %2, i64 %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Jump(void) { WriteInstruction("call jump"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"call jump\00"
define void @CR_Jump() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int /*<<< orphan*/, char *, char *, int);
int _mod(int a, int b, char *file, int line) {
  if (b < 1.2e-38)
    fatal_error(0, "Modulo zero, file %s, line %d", file, line);
  return a % b;
}


x86 assembly (clang, -O0):
<_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xece(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1151 <_mod+0x41>
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %edi,%edi
lea    0xebc(%rip),%rsi
call   1030 <fatal_error@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %esi,%esi
jg     1129 <_mod+0x19>
lea    0xede(%rip),%rsi
xor    %edi,%edi
call   1030 <fatal_error@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Modulo zero, file %s, line %d\00"
define i32 @_mod(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to double
%11 = fcmp olt double %10, 1.200000e-38
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14)
br label %16
16: ; preds = %12, %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = srem i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
@.str = [30 x i8] c"Modulo zero, file %s, line %d\00"
define i32 @_mod(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp slt i32 %1, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
br label %8
8: ; preds = %6, %4
%9 = srem i32 %0, %1
ret i32 %9
}
int redisApi_on_shutdown(void *inst) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @redisApi_on_shutdown(i8* nocapture readnone %0) {
ret i32 -1
}
int mlx5dr_action_destroy(struct mlx5dr_action *action) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mlx5dr_action = type opaque
define i32 @mlx5dr_action_destroy(%struct.mlx5dr_action* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SHL_W_IMM(int reg, int count) {
  addbyte(0x66);
  if (reg & 8)
    addbyte(0x41);
  addbyte(0xc1);
  addbyte(0xc0 | (reg & 7) | 0x20);
  addbyte(count);
}


x86 assembly (clang, -O0):
<SHL_W_IMM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1141 <SHL_W_IMM+0x31>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xc0,%edi
or     $0x20,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHL_W_IMM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
test   $0x8,%bpl
je     1131 <SHL_W_IMM+0x21>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
and    $0x7,%ebp
or     $0xe0,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SHL_W_IMM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = load i32, i32* %3
%7 = and i32 %6, 8
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @addbyte(i32 65)
br label %11
11: ; preds = %9, %2
%12 = call i32 @addbyte(i32 193)
%13 = load i32, i32* %3
%14 = and i32 %13, 7
%15 = or i32 192, %14
%16 = or i32 %15, 32
%17 = call i32 @addbyte(i32 %16)
%18 = load i32, i32* %4
%19 = call i32 @addbyte(i32 %18)
ret void
}

LLVM IR (-O2):
define void @SHL_W_IMM(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = and i32 %0, 8
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @addbyte(i32 65)
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @addbyte(i32 193)
%10 = and i32 %0, 7
%11 = or i32 %10, 224
%12 = tail call i32 @addbyte(i32 %11)
%13 = tail call i32 @addbyte(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t write_n(int fd, const void *buf, size_t count) {
  size_t nleft = count;
  ssize_t nwritten;
  char *bufp = (char *)buf;
  while (nleft > 0) {
  }
}


x86 assembly (clang, -O0):
<write_n>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x20(%rbp)
jbe    112f <write_n+0x2f>
jmp    111f <write_n+0x1f>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_n>:
test   %rdx,%rdx
je     1112 <write_n+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <write_n+0x10>
ret

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

LLVM IR (-O2):
define i32 @write_n(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %3, %5
br label %5
6: ; preds = %3
ret i32 undef
}
/* Type definitions */
struct programmer_t {
  int dummy;
};

/* Variables and functions */
int buspirate_expect_bin(struct programmer_t *, unsigned char *, int,
                         unsigned char *, int);
int buspirate_expect_bin_byte(struct programmer_t *pgm, unsigned char send_byte,
                              unsigned char expect_byte) {
  return buspirate_expect_bin(pgm, &send_byte, 1, &expect_byte, 1);
}


x86 assembly (clang, -O0):
<buspirate_expect_bin_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%r8d
lea    -0xa(%rbp),%rcx
mov    %r8d,%edx
call   1030 <buspirate_expect_bin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buspirate_expect_bin_byte>:
push   %rax
mov    %sil,0x7(%rsp)
mov    %dl,0x6(%rsp)
lea    0x7(%rsp),%rsi
lea    0x6(%rsp),%rcx
mov    $0x1,%edx
mov    $0x1,%r8d
call   1030 <buspirate_expect_bin@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.programmer_t = type { i32 }
define i32 @buspirate_expect_bin_byte(%struct.programmer_t* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca %struct.programmer_t*
%5 = alloca i8
%6 = alloca i8
store %struct.programmer_t* %0, %struct.programmer_t** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load %struct.programmer_t*, %struct.programmer_t** %4
%8 = call i32 @buspirate_expect_bin(%struct.programmer_t* %7, i8* %5, i32 1, i8* %6, i32 1)
ret i32 %8
}

LLVM IR (-O2):
%struct.programmer_t = type { i32 }
define i32 @buspirate_expect_bin_byte(%struct.programmer_t* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
store i8 %1, i8* %4
store i8 %2, i8* %5
%6 = call i32 @buspirate_expect_bin(%struct.programmer_t* %0, i8* %4, i32 1, i8* %5, i32 1)
ret i32 %6
}
int int_ops_sar(int l, int r) { return l >> r; }


x86 assembly (clang, -O0):
<int_ops_sar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_ops_sar>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @int_ops_sar(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 = ashr i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @int_ops_sar(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
void alarm_handler() {}


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

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

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

LLVM IR (-O2):
define void @alarm_handler() {
ret void
}
int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) {
  return -22;
}


x86 assembly (clang, -O0):
<irq_set_affinity_hint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffea,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.cpumask = type opaque
define i32 @irq_set_affinity_hint(i32 %0, %struct.cpumask* nocapture readnone %1) {
ret i32 -22
}
double CMtoFT(double CM) { return CM / 30.48; }


x86 assembly (clang, -O0):
<CMtoFT>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMtoFT>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @CMtoFT(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.048000e+01
ret double %4
}

LLVM IR (-O2):
define double @CMtoFT(double %0) {
%2 = fdiv double %0, 3.048000e+01
ret double %2
}
char *rotateStrFast(char *s, int num) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @rotateStrFast(i8* nocapture readnone %0, i32 %1) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ PF_PACKET;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ htons(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_raw_socket() {
  int fd;
  fd = socket(PF_PACKET, SOCK_RAW, htons(0xEFFF));
  return fd;
}


x86 assembly (clang, -O0):
<create_raw_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0xefff,%edi
call   1030 <htons@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_raw_socket>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rax
mov    (%rax),%ebx
mov    0x2ead(%rip),%rax
mov    (%rax),%ebp
mov    $0xefff,%edi
call   1030 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <socket@plt>

LLVM IR (-O0):
@PF_PACKET = global i32 0
@SOCK_RAW = global i32 0
define i32 @create_raw_socket() {
%1 = alloca i32
%2 = load i32, i32* @PF_PACKET
%3 = load i32, i32* @SOCK_RAW
%4 = call i32 @htons(i32 61439)
%5 = call i32 @socket(i32 %2, i32 %3, i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@PF_PACKET = global i32 0
@SOCK_RAW = global i32 0
define i32 @create_raw_socket() {
%1 = load i32, i32* @PF_PACKET
%2 = load i32, i32* @SOCK_RAW
%3 = tail call i32 @htons(i32 61439)
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void bail(const char *error) {
  printf("%s: %s\n", error, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bail>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @bail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @bail(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void clear(void) {
  fflush(stdout);
  fflush(stdin);
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stdin = global i32 0
define void @clear() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @stdin
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stdin = global i32 0
define void @clear() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stdin
%4 = tail call i32 @fflush(i32 %3)
ret void
}
char *mhs_stpcpy(char *dest, const char *src) {
  register char *d = dest;
  register const char *s = src;
  do {
    *d++ = *s;
  } while (*s++);
  return (d - 1);
}


x86 assembly (clang, -O0):
<mhs_stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,(%rax)
jne    111c <mhs_stpcpy+0x1c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mhs_stpcpy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
mov    %cl,0x1(%rax)
add    $0x1,%rax
cmpb   $0x0,(%rsi)
lea    0x1(%rsi),%rsi
jne    1110 <mhs_stpcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @mhs_stpcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u64_t1ha64s_data(int /*<<< orphan*/ const *, size_t,
                                         uintptr_t);
uint64_t rgph_u64_t1ha64s_u8a(const uint8_t *key, size_t len, uintptr_t seed) {
  return rgph_u64_t1ha64s_data(key, len, seed);
}


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

x86 assembly (clang, -O2):
<rgph_u64_t1ha64s_u8a>:
jmp    1030 <rgph_u64_t1ha64s_data@plt>

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

LLVM IR (-O2):
define i32 @rgph_u64_t1ha64s_u8a(i32* %0, i64 %1, i64 %2) {
%4 = tail call i32 @rgph_u64_t1ha64s_data(i32* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ciiaF(int);
void ciiaF2(int x) { ciiaF(x); }


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

x86 assembly (clang, -O2):
<ciiaF2>:
jmp    1030 <ciiaF@plt>

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

LLVM IR (-O2):
define void @ciiaF2(i32 %0) {
%2 = tail call i32 @ciiaF(i32 %0)
ret void
}
/* Variables and functions */
int EOF;
int getch();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ ungetch(char);
main() {
  int c;
  ungetch('a');
  while ((c = getch()) != EOF)
    putchar(c);
  ungetch('s');
  ungetch('d');
  putchar(getch());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1040 <ungetch@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%eax
je     116f <main+0x3f>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1149 <main+0x19>
mov    $0x73,%edi
call   1040 <ungetch@plt>
mov    $0x64,%edi
call   1040 <ungetch@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x61,%edi
call   1040 <ungetch@plt>
xor    %eax,%eax
call   1050 <getch@plt>
mov    0x2e9f(%rip),%rbx
cmp    (%rbx),%eax
je     1162 <main+0x32>
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getch@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
mov    $0x73,%edi
call   1040 <ungetch@plt>
mov    $0x64,%edi
call   1040 <ungetch@plt>
xor    %eax,%eax
call   1050 <getch@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @ungetch(i8 signext 97)
br label %4
4: ; preds = %8, %0
%5 = call i32 (...) @getch()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @putchar(i32 %9)
br label %4
11: ; preds = %4
%12 = call i32 @ungetch(i8 signext 115)
%13 = call i32 @ungetch(i8 signext 100)
%14 = call i32 (...) @getch()
%15 = call i32 @putchar(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 @ungetch(i8 signext 97)
%2 = tail call i32 (...) @getch()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %11, label %5
5: ; preds = %0, %5
%6 = phi i32 [ %8, %5 ], [ %2, %0 ]
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getch()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %5
11: ; preds = %5, %0
%12 = tail call i32 @ungetch(i8 signext 115)
%13 = tail call i32 @ungetch(i8 signext 100)
%14 = tail call i32 (...) @getch()
%15 = tail call i32 @putchar(i32 %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void setup() {
  setvbuf(stdin, NULL, _IONBF, 0);
  setvbuf(stdout, NULL, _IONBF, 0);
  setvbuf(stderr, NULL, _IONBF, 0);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2ebf(%rip),%rbx
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@stdin = global i32 0
@_IONBF = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define void @setup() {
%1 = load i32, i32* @stdin
%2 = load i32, i32* @_IONBF
%3 = call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = load i32, i32* @stdout
%5 = load i32, i32* @_IONBF
%6 = call i32 @setvbuf(i32 %4, i32* null, i32 %5, i32 0)
%7 = load i32, i32* @stderr
%8 = load i32, i32* @_IONBF
%9 = call i32 @setvbuf(i32 %7, i32* null, i32 %8, i32 0)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@_IONBF = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define void @setup() {
%1 = load i32, i32* @stdin
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = load i32, i32* @stdout
%5 = load i32, i32* @_IONBF
%6 = tail call i32 @setvbuf(i32 %4, i32* null, i32 %5, i32 0)
%7 = load i32, i32* @stderr
%8 = load i32, i32* @_IONBF
%9 = tail call i32 @setvbuf(i32 %7, i32* null, i32 %8, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c))
    c -= ('a' - 'A');
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1136 <toupper+0x26>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int core3_safe(char const *);
int U_EMRSETMITERLIMIT_safe(const char *record) { return (core3_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRSETMITERLIMIT_safe>:
jmp    1030 <core3_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETMITERLIMIT_safe(i8* %0) {
%2 = tail call i32 @core3_safe(i8* %0)
ret i32 %2
}
OP(op, ff) { RST(0x38); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x38,%edi
mov    $0x0,%al
call   1030 <RST@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
mov    $0x38,%edi
xor    %eax,%eax
jmp    1030 <RST@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 56)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 56)
ret i32 undef
}