xunge/DecIR huggingface dataset:
/* Variables and functions */
float tansig_approx(float);
float sigmoid_approx(float x) { return .5f + .5f * tansig_approx(.5f * x); }


x86 assembly (clang, -O0):
<sigmoid_approx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <tansig_approx@plt>
movss  0xec9(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid_approx>:
push   %rax
mulss  0xee7(%rip),%xmm0
call   1030 <tansig_approx@plt>
movss  0xeda(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sigmoid_approx(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 5.000000e-01, %3
%5 = call float @tansig_approx(float %4)
%6 = call float @llvm.fmuladd.f32(float 5.000000e-01, float %5, float 5.000000e-01)
ret float %6
}

LLVM IR (-O2):
define float @sigmoid_approx(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = tail call float @tansig_approx(float %2)
%4 = tail call float @llvm.fmuladd.f32(float %3, float 5.000000e-01, float 5.000000e-01)
ret float %4
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ timespec_from_nsec(struct timespec *, int);
void timespec_from_msec(struct timespec *a, int64_t b) {
  timespec_from_nsec(a, b * 1000000);
}


x86 assembly (clang, -O0):
<timespec_from_msec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
imul   $0xf4240,-0xc(%rbp),%esi
call   1030 <timespec_from_nsec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_from_msec>:
imul   $0xf4240,%esi,%esi
jmp    1030 <timespec_from_nsec@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @timespec_from_msec(%struct.timespec* %0, i32 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i32
store %struct.timespec* %0, %struct.timespec** %3
store i32 %1, i32* %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 1000000
%8 = call i32 @timespec_from_nsec(%struct.timespec* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @timespec_from_msec(%struct.timespec* %0, i32 %1) {
%3 = mul nsw i32 %1, 1000000
%4 = tail call i32 @timespec_from_nsec(%struct.timespec* %0, i32 %3)
ret void
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzNullAdapt_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKUP(int);
void BrzNullAdapt_ackup(struct comp *comp, int port) {
  struct BrzNullAdapt_ *c = (struct BrzNullAdapt_ *)comp;
  SEND_ACKUP(1);
}


x86 assembly (clang, -O0):
<BrzNullAdapt_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <SEND_ACKUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzNullAdapt_ = type { i32 }
define void @BrzNullAdapt_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzNullAdapt_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzNullAdapt_*
store %struct.BrzNullAdapt_* %7, %struct.BrzNullAdapt_** %5
%8 = call i32 @SEND_ACKUP(i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzNullAdapt_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKUP(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configureMultiProtocolRtlsPatch();
int /*<<< orphan*/ enterMultiProtocolRtlsCpeHdPatch();
void refreshMultiProtocolRtlsPatch(void) {
  enterMultiProtocolRtlsCpeHdPatch();
  configureMultiProtocolRtlsPatch();
}


x86 assembly (clang, -O0):
<refreshMultiProtocolRtlsPatch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <enterMultiProtocolRtlsCpeHdPatch@plt>
mov    $0x0,%al
call   1040 <configureMultiProtocolRtlsPatch@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @refreshMultiProtocolRtlsPatch() {
%1 = call i32 (...) @enterMultiProtocolRtlsCpeHdPatch()
%2 = call i32 (...) @configureMultiProtocolRtlsPatch()
ret void
}

LLVM IR (-O2):
define void @refreshMultiProtocolRtlsPatch() {
%1 = tail call i32 (...) @enterMultiProtocolRtlsCpeHdPatch()
%2 = tail call i32 (...) @configureMultiProtocolRtlsPatch()
ret void
}
/* Variables and functions */
double doNextEvent();
int /*<<< orphan*/ libc_printf(char *, int);
int /*<<< orphan*/ printQueue();
int /*<<< orphan*/ pumpQueue();
void twoDsim_processEvent(void) {
  double dt;
  if ((1 == 0)) {
    libc_printf((char *)"processEvent before pumpQueue\\n", 31);
  }
  pumpQueue();
  if ((1 == 0)) {
    libc_printf((char *)"before doNextEvent\\n", 20);
    printQueue();
  }
  dt = doNextEvent();
  if ((1 == 0)) {
    libc_printf((char *)"finished doNextEvent\\n", 22);
  }
}


x86 assembly (clang, -O0):
<twoDsim_processEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pumpQueue@plt>
mov    $0x0,%al
call   1030 <doNextEvent@plt>
movsd  %xmm0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @twoDsim_processEvent() {
%1 = alloca double
%2 = call i32 (...) @pumpQueue()
%3 = call double (...) @doNextEvent()
store double %3, double* %1
ret void
}

LLVM IR (-O2):
define void @twoDsim_processEvent() {
%1 = tail call i32 (...) @pumpQueue()
%2 = tail call double (...) @doNextEvent()
ret void
}
int sizeof_long() {
  if (sizeof(long) == 4)
    return 1;
  if (sizeof(long) == 8)
    return 2;
}


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

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

LLVM IR (-O0):
define i32 @sizeof_long() {
ret i32 2
}

LLVM IR (-O2):
define i32 @sizeof_long() {
ret i32 2
}
/* Variables and functions */
unsigned int procid();
int /*<<< orphan*/ sys_call(int, unsigned int, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
void exit() {
  unsigned int proc_index = procid();
  sys_call(0x0E, proc_index, 0, 0, 0);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <procid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xe,%edi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sys_call@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
xor    %eax,%eax
call   1040 <procid@plt>
mov    $0xe,%edi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sys_call@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @procid()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @sys_call(i32 14, i32 %5, i32 0, i32 0, i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @procid()
%3 = tail call i32 @sys_call(i32 14, i32 %2, i32 0, i32 0, i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("\n");
  printf("getch/ungetch usage:  g)getch()   u)ungetch(c)\n");
  printf("constants          :  s)BUF_SIZE  o)BUF_OVERFLOW\n");
  printf("push back          :  e)'\\n'      E)EOF\n");
  printf("Test program usage :  H)Help      Q)Quit\n\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xf99(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
call   1030 <printf@plt>
lea    0xf40(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xef1(%rip),%rdi
call   1040 <puts@plt>
lea    0xf16(%rip),%rdi
call   1040 <puts@plt>
lea    0xf32(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [48 x i8] c"getch/ungetch usage: g)getch() u)ungetch(c)\0A\00"
@.str.2 = [50 x i8] c"constants : s)BUF_SIZE o)BUF_OVERFLOW\0A\00"
@.str.3 = [41 x i8] c"push back : e)'\\n' E)EOF\0A\00"
@.str.4 = [43 x i8] c"Test program usage : H)Help Q)Quit\0A\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"getch/ungetch usage: g)getch() u)ungetch(c)\00"
@str.5 = [49 x i8] c"constants : s)BUF_SIZE o)BUF_OVERFLOW\00"
@str.6 = [40 x i8] c"push back : e)'\\n' E)EOF\00"
@str.7 = [42 x i8] c"Test program usage : H)Help Q)Quit\0A\00"
define void @print_usage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.7, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int sleep(unsigned int);
unsigned int Sleep(unsigned int secs) {
  unsigned int rc;
  rc = sleep(secs);
  return rc;
}


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

x86 assembly (clang, -O2):
<Sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define i32 @Sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ A_BOLD;
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int main() {
  initscr();
  attron(A_BOLD);
  printw("Hello.\n");
  attroff(A_BOLD);
  printw("World.\n");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initscr@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1050 <attron@plt>
lea    0xe65(%rip),%rdi
call   1060 <printw@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
lea    0xe53(%rip),%rdi
call   1060 <printw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x0,%al
call   1080 <getch@plt>
mov    $0x0,%al
call   1090 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <initscr@plt>
mov    0x2e61(%rip),%rbx
mov    (%rbx),%edi
call   1050 <attron@plt>
lea    0xe73(%rip),%rdi
call   1060 <printw@plt>
mov    (%rbx),%edi
call   1030 <attroff@plt>
lea    0xe68(%rip),%rdi
call   1060 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
xor    %eax,%eax
call   1080 <getch@plt>
xor    %eax,%eax
call   1090 <endwin@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@A_BOLD = global i32 0
@.str = [8 x i8] c"Hello.\0A\00"
@.str.1 = [8 x i8] c"World.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = load i32, i32* @A_BOLD
%4 = call i32 @attron(i32 %3)
%5 = call i32 @printw(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @A_BOLD
%7 = call i32 @attroff(i32 %6)
%8 = call i32 @printw(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @refresh()
%10 = call i32 (...) @getch()
%11 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@.str = [8 x i8] c"Hello.\0A\00"
@.str.1 = [8 x i8] c"World.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = load i32, i32* @A_BOLD
%3 = tail call i32 @attron(i32 %2)
%4 = tail call i32 @printw(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @A_BOLD
%6 = tail call i32 @attroff(i32 %5)
%7 = tail call i32 @printw(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (...) @refresh()
%9 = tail call i32 (...) @getch()
%10 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int save_binarydata_to_file_generic(char *, char const *, int, char *);
int append_binarydata_to_file(char *fileLocation, const char *dataToWrite,
                              int dataLength) {
  return save_binarydata_to_file_generic(fileLocation, dataToWrite, dataLength,
                                         "ab");
}


x86 assembly (clang, -O0):
<append_binarydata_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xecb(%rip),%rcx
call   1030 <save_binarydata_to_file_generic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_binarydata_to_file>:
lea    0xee9(%rip),%rcx
jmp    1030 <save_binarydata_to_file_generic@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ab\00"
define i32 @append_binarydata_to_file(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @save_binarydata_to_file_generic(i8* %7, i8* %8, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"ab\00"
define i32 @append_binarydata_to_file(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @save_binarydata_to_file_generic(i8* %0, i8* %1, i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Type definitions */
typedef int int_least8_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_int_least8_t(int_least8_t *const dest,
                                         int_least8_t const src) {
  return (((*dest) = src), true);
}


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

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_int_least8_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
__attribute__((weak)) void UDPD_IrqHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<UDPD_IrqHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UDPD_IrqHandler+0x9>
jmp    1109 <UDPD_IrqHandler+0x9>

x86 assembly (clang, -O2):
<UDPD_IrqHandler>:
jmp    1100 <UDPD_IrqHandler>

LLVM IR (-O0):
define weak void @UDPD_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @UDPD_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ __stdfix_sat_uk(scalar_t__);
uint32_t __stdfix_ssub_uk(uint32_t x, uint32_t y) {
  return (__stdfix_sat_uk((uint64_t)x - (uint64_t)y));
}


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

x86 assembly (clang, -O2):
<__stdfix_ssub_uk>:
sub    %rsi,%rdi
jmp    1030 <__stdfix_sat_uk@plt>

LLVM IR (-O0):
define i64 @__stdfix_ssub_uk(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
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = call i64 @__stdfix_sat_uk(i64 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @__stdfix_ssub_uk(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = tail call i64 @__stdfix_sat_uk(i64 %3)
ret i64 %4
}
unsigned precedenceLevel(char operator) {
  switch (operator) {
  case '+':
  case '-':
    return 1;
  case '*':
  case '/':
  case '%':
    return 2;
  case '^':
    return 3;
  }
}


x86 assembly (clang, -O0):
<precedenceLevel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x25,%eax
je     1180 <precedenceLevel+0x80>
jmp    111f <precedenceLevel+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2a,%eax
je     1180 <precedenceLevel+0x80>
jmp    1130 <precedenceLevel+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     1174 <precedenceLevel+0x74>
jmp    1141 <precedenceLevel+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1174 <precedenceLevel+0x74>
jmp    1152 <precedenceLevel+0x52>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1180 <precedenceLevel+0x80>
jmp    1163 <precedenceLevel+0x63>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     118c <precedenceLevel+0x8c>
jmp    1193 <precedenceLevel+0x93>
movl   $0x1,-0x4(%rbp)
jmp    1193 <precedenceLevel+0x93>
movl   $0x2,-0x4(%rbp)
jmp    1193 <precedenceLevel+0x93>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedenceLevel>:
mov    $0x1,%eax
cmp    $0x2e,%edi
jg     1115 <precedenceLevel+0x15>
cmp    $0x25,%edi
je     111f <precedenceLevel+0x1f>
cmp    $0x2a,%edi
je     111f <precedenceLevel+0x1f>
ret
cmp    $0x5e,%edi
je     1125 <precedenceLevel+0x25>
cmp    $0x2f,%edi
jne    1114 <precedenceLevel+0x14>
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @precedenceLevel(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 37, label %7
i32 94, label %8
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %9
7: ; preds = %1, %1, %1
store i32 2, i32* %2
br label %9
8: ; preds = %1
store i32 3, i32* %2
br label %9
9: ; preds = %6, %7, %8, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @precedenceLevel(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 94, label %4
i32 37, label %3
i32 42, label %3
i32 47, label %3
]
3: ; preds = %1, %1, %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %3, %4, %1
%6 = phi i32 [ 3, %4 ], [ 2, %3 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ write(int, void const *, size_t);
ssize_t write_safe(int fd, const void *buf, size_t count) {
  ssize_t ret;
  do {
    ret = write(fd, buf, count);
  } while (ret < 0 && errno == EINTR);
  return ret;
}


x86 assembly (clang, -O0):
<write_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jge    1161 <write_safe+0x51>
mov    0x2e92(%rip),%rax
mov    (%rax),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1123 <write_safe+0x13>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_safe>:
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 <write@plt>
test   %rax,%rax
jns    114b <write_safe+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <write_safe+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 @write_safe(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
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 @write(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 @write_safe(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i64 @write(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
}
int main() {
  int a = 0;
  int b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%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
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
XStoreColor() {}


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

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

LLVM IR (-O0):
define i32 @XStoreColor() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XStoreColor() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int testfunc();
int main(void) {
  printf("%d\n", testfunc());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @testfunc()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int getchar();
void read_message(int array[], int *c) {
  while ((array[*c] = getchar()) != '\n') {
    *c += 1;
    if (*c == 81) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<read_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
movslq (%rdx),%rdx
mov    %eax,(%rcx,%rdx,4)
cmp    $0xa,%eax
je     1160 <read_message+0x50>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x51,(%rax)
jne    115b <read_message+0x4b>
jmp    1160 <read_message+0x50>
jmp    1120 <read_message+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_message>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
movslq (%rbx),%rcx
mov    %eax,(%r14,%rcx,4)
cmp    $0xa,%eax
je     113f <read_message+0x2f>
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
cmp    $0x51,%eax
jne    1120 <read_message+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @read_message(i32* nocapture writeonly %0, i32* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = tail call i32 (...) @getchar()
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %4, i32* %7
%8 = icmp eq i32 %4, 10
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = icmp eq i32 %11, 81
br i1 %12, label %13, label %3
13: ; preds = %9, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int my_isneg(int n) {
  if (n < 0)
    my_putchar('N');
  else
    my_putchar('P');
  my_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<my_isneg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1134 <my_isneg+0x24>
mov    $0x4e,%edi
call   1030 <my_putchar@plt>
jmp    113e <my_isneg+0x2e>
mov    $0x50,%edi
call   1030 <my_putchar@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isneg>:
push   %rax
not    %edi
shr    $0x1f,%edi
add    %edi,%edi
add    $0x4e,%edi
call   1030 <my_putchar@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_isneg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @my_putchar(i8 signext 78)
br label %9
7: ; preds = %1
%8 = call i32 @my_putchar(i8 signext 80)
br label %9
9: ; preds = %7, %5
%10 = call i32 @my_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @my_isneg(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i8 78, i8 80
%4 = tail call i32 @my_putchar(i8 signext %3)
%5 = tail call i32 @my_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lcm_init();
unsigned int lcm_esd_recover(void) {
  lcm_init();
  return 1;
}


x86 assembly (clang, -O0):
<lcm_esd_recover>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lcm_init@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_esd_recover>:
push   %rax
xor    %eax,%eax
call   1030 <lcm_init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lcm_esd_recover() {
%1 = call i32 (...) @lcm_init()
ret i32 1
}

LLVM IR (-O2):
define i32 @lcm_esd_recover() {
%1 = tail call i32 (...) @lcm_init()
ret i32 1
}
unsigned int buf_uint(unsigned char *buf) {
  return buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
}


x86 assembly (clang, -O0):
<buf_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @buf_uint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @buf_uint(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
void init_proc(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<init_proc>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <init_proc+0x9>
jmp    1109 <init_proc+0x9>

x86 assembly (clang, -O2):
<init_proc>:
jmp    1100 <init_proc>

LLVM IR (-O0):
define void @init_proc() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @init_proc() {
br label %1
1: ; preds = %1, %0
br label %1
}
doindex(ap, c) char **ap;
{
  if (c >= 2)
    putnum((long)strindex(ap[1], ap[2]));
}


x86 assembly (clang, -O0):
<doindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jl     115a <doindex+0x3a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    $0x0,%al
call   1030 <strindex@plt>
movslq %eax,%rdi
mov    $0x0,%al
call   1040 <putnum@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doindex>:
cmp    $0x2,%esi
jl     1146 <doindex+0x26>
push   %rax
mov    0x8(%rdi),%rax
mov    0x10(%rdi),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   1030 <strindex@plt>
movslq %eax,%rdi
xor    %eax,%eax
call   1040 <putnum@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @doindex(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %0, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @strindex to i32 (i8*, i8*, ...)*)(i8* %6, i8* %8)
%10 = sext i32 %9 to i64
%11 = tail call i32 (i64, ...) bitcast (i32 (...)* @putnum to i32 (i64, ...)*)(i64 %10)
br label %12
12: ; preds = %4, %2
ret i32 undef
}
/* Variables and functions */
float floorf(float);
float dtMathFloorf(float x) { return floorf(x); }


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

x86 assembly (clang, -O2):
<dtMathFloorf>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define float @dtMathFloorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.floor.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @dtMathFloorf(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
/* Variables and functions */
int errno;
int plt_sockGetLastError() { return errno; }


x86 assembly (clang, -O0):
<plt_sockGetLastError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plt_sockGetLastError>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @plt_sockGetLastError() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @plt_sockGetLastError() {
%1 = load i32, i32* @errno
ret i32 %1
}
unsigned short int f14(unsigned short int x, long int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned short) - y));
}


x86 assembly (clang, -O0):
<f14>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f14>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%ax
ret

LLVM IR (-O0):
define zeroext i16 @f14(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 16, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f14(i16 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i16
%4 = tail call i16 @llvm.fshl.i16(i16 %0, i16 %0, i16 %3)
ret i16 %4
}
unsigned long int div_rhs(const long int rhs) {
  if (rhs == 0)
    return 1;
  return rhs;
}


x86 assembly (clang, -O0):
<div_rhs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <div_rhs+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1128 <div_rhs+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_rhs>:
test   %rdi,%rdi
mov    $0x1,%eax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
define i64 @div_rhs(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %9
7: ; preds = %1
%8 = load i64, i64* %3
store i64 %8, i64* %2
br label %9
9: ; preds = %7, %6
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
define i64 @div_rhs(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char *makename(char *, char const *, ...);
char *xcb_atom_name_unique(const char *base, uint32_t id) {
  if (base)
    return makename("%s_U%lu", base, id);
  else
    return makename("U%lu", id);
}


x86 assembly (clang, -O0):
<xcb_atom_name_unique>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <xcb_atom_name_unique+0x38>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <makename@plt>
mov    %rax,-0x8(%rbp)
jmp    115e <xcb_atom_name_unique+0x4e>
movslq -0x14(%rbp),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <makename@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_atom_name_unique>:
mov    %esi,%edx
test   %rdi,%rdi
je     1128 <xcb_atom_name_unique+0x18>
mov    %rdi,%rsi
lea    0xedf(%rip),%rdi
xor    %eax,%eax
jmp    1030 <makename@plt>
movslq %edx,%rsi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
jmp    1030 <makename@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s_U%lu\00"
@.str.1 = [5 x i8] c"U%lu\00"
define i8* @xcb_atom_name_unique(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** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i8* (i8*, i8*, ...) @makename(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
store i8* %11, i8** %3
br label %17
12: ; preds = %2
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = call i8* (i8*, i8*, ...) @makename(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i8* %16, i8** %3
br label %17
17: ; preds = %12, %8
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s_U%lu\00"
@.str.1 = [5 x i8] c"U%lu\00"
define i8* @xcb_atom_name_unique(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* (i8*, i8*, ...) @makename(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %10
6: ; preds = %2
%7 = sext i32 %1 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i8* (i8*, i8*, ...) @makename(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i8* [ %5, %4 ], [ %9, %6 ]
ret i8* %11
}
/* Variables and functions */
int __mib_chain_delete(int, unsigned int);
int _mib_chain_delete(int id, unsigned int recordNum) {
  return __mib_chain_delete(id, recordNum);
}


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

x86 assembly (clang, -O2):
<_mib_chain_delete>:
jmp    1030 <__mib_chain_delete@plt>

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

LLVM IR (-O2):
define i32 @_mib_chain_delete(i32 %0, i32 %1) {
%3 = tail call i32 @__mib_chain_delete(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv, char **envp) {
  (void)argc;
  (void)argv;
  (void)envp;
  fprintf(stdout, "Hello world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = load i8**, i8*** %6
%10 = load i8**, i8*** %7
%11 = load i32, i32* @stdout
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fun(char *);
main(void) {
  char x[100];
  fun(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
call   1030 <fun@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
mov    %rsp,%rdi
call   1030 <fun@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @fun(i8* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @fun(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error(char *str) {
  printf("%s\n", str);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *substr(char *str, int from, int to) {
  char *sub = malloc(sizeof(char) * (to - from + 1));
  strncpy(sub, str + from, to - from);
  sub[to - from] = '\0';
  return sub;
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
sub    %esi,%ebx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 1, %12
%14 = trunc i64 %13 to i32
%15 = call i8* @malloc(i32 %14)
store i8* %15, i8** %7
%16 = load i8*, i8** %7
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i32, i32* %6
%22 = load i32, i32* %5
%23 = sub nsw i32 %21, %22
%24 = call i32 @strncpy(i8* %16, i8* %20, i32 %23)
%25 = load i8*, i8** %7
%26 = load i32, i32* %6
%27 = load i32, i32* %5
%28 = sub nsw i32 %26, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %25, i64 %29
store i8 0, i8* %30
%31 = load i8*, i8** %7
ret i8* %31
}

LLVM IR (-O2):
define i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @strncpy(i8* %6, i8* %8, i32 %4)
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8 0, i8* %11
ret i8* %6
}
void w_quick_sort_int_restore(void *data, int index, void *key) {
  int *ints = (int *)data;
  ints[index] = *((int *)key);
}


x86 assembly (clang, -O0):
<w_quick_sort_int_restore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_quick_sort_int_restore>:
mov    (%rdx),%eax
movslq %esi,%rcx
mov    %eax,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define void @w_quick_sort_int_restore(i8* nocapture writeonly %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %0 to i32*
%5 = bitcast i8* %2 to i32*
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int fscan_udecimal(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
unsigned scan_udecimal() { return fscan_udecimal(stdin); }


x86 assembly (clang, -O0):
<scan_udecimal>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <fscan_udecimal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_udecimal>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fscan_udecimal@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @scan_udecimal() {
%1 = load i32, i32* @stdin
%2 = call i32 @fscan_udecimal(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @scan_udecimal() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fscan_udecimal(i32 %1)
ret i32 %2
}