xunge/DecIR huggingface dataset:
char *strcpy(char *dest, char *source) {
  while (1) {
    if (*source == '\0') {
      *dest = '\0';
      break;
    }
    *dest = *source;
    dest++;
    source++;
  }
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1128 <strcpy+0x28>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1151 <strcpy+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %7, %2
%6 = phi i8* [ %0, %2 ], [ %11, %7 ]
store i8 0, i8* %6
ret i8* %6
7: ; preds = %2, %7
%8 = phi i8 [ %13, %7 ], [ %3, %2 ]
%9 = phi i8* [ %12, %7 ], [ %1, %2 ]
%10 = phi i8* [ %11, %7 ], [ %0, %2 ]
store i8 %8, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %5, label %7
}
int XBitmapBitOrder() {}


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

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

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

LLVM IR (-O2):
define i32 @XBitmapBitOrder() {
ret i32 undef
}
/* Type definitions */
struct sembuf {
  int member_1;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int semop(int, struct sembuf *, int);
int sem_v(int semid) {
  int ret;
  struct sembuf sb = {0, 1, 0};
  ret = semop(semid, &sb, 1);
  return ret;
}


x86 assembly (clang, -O0):
<sem_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_v>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@__const.sem_v.sb = %struct.sembuf { i32 0, i32 1, i32 0 }
define i32 @sem_v(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sembuf
store i32 %0, i32* %2
%5 = bitcast %struct.sembuf* %4 to i8*
%6 = load i32, i32* %2
%7 = call i32 @semop(i32 %6, %struct.sembuf* %4, i32 1)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@__const.sem_v.sb = %struct.sembuf { i32 0, i32 1, i32 0 }
define i32 @sem_v(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void MemCpyX(char *as_origem, char *ls_retorno, int an_inicio,
             int an_quantidade) {
  memcpy(ls_retorno, as_origem + an_inicio, an_quantidade);
}


x86 assembly (clang, -O0):
<MemCpyX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    -0x18(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemCpyX>:
mov    %rsi,%rax
movslq %edx,%rsi
add    %rdi,%rsi
mov    %rax,%rdi
mov    %ecx,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @MemCpyX(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @memcpy(i8* %1, i8* %6, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void *test(void *nothing) { pthread_exit((void *)0); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define noalias i8* @test(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i8* null)
ret i8* undef
}
void acsmx2_print_qinfo(void) {}


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

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

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

LLVM IR (-O2):
define void @acsmx2_print_qinfo() {
ret void
}
/* Variables and functions */
int __rs232_set_baud(void *, int);
int RS232SetBaudRate(void *handle, int rate) {
  if (NULL == handle) {
    return -1;
  }
  return __rs232_set_baud(handle, rate);
}


x86 assembly (clang, -O0):
<RS232SetBaudRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1137 <RS232SetBaudRate+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <RS232SetBaudRate+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <__rs232_set_baud@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RS232SetBaudRate>:
test   %rdi,%rdi
je     111a <RS232SetBaudRate+0xa>
jmp    1030 <__rs232_set_baud@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @RS232SetBaudRate(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 i8*, i8** %4
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %13
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @__rs232_set_baud(i8* %10, i32 %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @RS232SetBaudRate(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @__rs232_set_baud(i8* %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ SPI_CS_Low();
void __SD_Assert(void) { SPI_CS_Low(); }


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

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

LLVM IR (-O0):
define void @__SD_Assert() {
%1 = call i32 (...) @SPI_CS_Low()
ret void
}

LLVM IR (-O2):
define void @__SD_Assert() {
%1 = tail call i32 (...) @SPI_CS_Low()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insque(long, long);
INSQUE(long x, long y) {
  insque(x, y);
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @INSQUE(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 = call i32 @insque(i64 %5, i64 %6)
ret i32 1
}

LLVM IR (-O2):
define i32 @INSQUE(i64 %0, i64 %1) {
%3 = tail call i32 @insque(i64 %0, i64 %1)
ret i32 1
}
unsigned int fnet_get_highdata(unsigned int data) {
  return ((data & 0xFFFF0000) >> 16) & 0xFFFF;
}


x86 assembly (clang, -O0):
<fnet_get_highdata>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnet_get_highdata>:
mov    %edi,%eax
shr    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @fnet_get_highdata(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -65536
%5 = lshr i32 %4, 16
%6 = and i32 %5, 65535
ret i32 %6
}

LLVM IR (-O2):
define i32 @fnet_get_highdata(i32 %0) {
%2 = lshr i32 %0, 16
ret i32 %2
}
int bar(int n) {
  while (n >= 64)
    n -= 64;
  return n;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jl     111f <bar+0x1f>
mov    -0x4(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <bar+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%eax
cmp    $0x3f,%edi
mov    $0x3f,%ecx
cmovl  %edi,%ecx
neg    %ecx
add    %eax,%ecx
add    $0x3f,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add i32 %0, 63
%3 = call i32 @llvm.smin.i32(i32 %0, i32 63)
%4 = sub i32 %2, %3
%5 = and i32 %4, -64
%6 = sub i32 %0, %5
ret i32 %6
}
/* Variables and functions */
float CurrentFontSize();
int /*<<< orphan*/ changeTexMode(int);
int /*<<< orphan*/ fprintRTF(char *, int);
int getTexMode();
void CmdSpace(float kk) {
  int size = (int)(CurrentFontSize() * kk);
  if (getTexMode() == 6)
    changeTexMode(2);
  fprintRTF("{\\fs%d  }", size);
}


x86 assembly (clang, -O0):
<CmdSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <CurrentFontSize@plt>
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getTexMode@plt>
cmp    $0x6,%eax
jne    117a <CmdSpace+0x3a>
mov    $0x2,%edi
call   1030 <changeTexMode@plt>
mov    -0x8(%rbp),%esi
lea    0xe7c(%rip),%rdi
call   1060 <fprintRTF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdSpace>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1050 <CurrentFontSize@plt>
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <getTexMode@plt>
cmp    $0x6,%eax
jne    1169 <CmdSpace+0x29>
mov    $0x2,%edi
call   1030 <changeTexMode@plt>
movss  (%rsp),%xmm0
mulss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%esi
lea    0xe81(%rip),%rdi
pop    %rax
jmp    1060 <fprintRTF@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"{\\fs%d }\00"
define void @CmdSpace(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = call float (...) @CurrentFontSize()
%5 = load float, float* %2
%6 = fmul float %4, %5
%7 = fptosi float %6 to i32
store i32 %7, i32* %3
%8 = call i32 (...) @getTexMode()
%9 = icmp eq i32 %8, 6
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @changeTexMode(i32 2)
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %3
%14 = call i32 @fprintRTF(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"{\\fs%d }\00"
define void @CmdSpace(float %0) {
%2 = tail call float (...) @CurrentFontSize()
%3 = tail call i32 (...) @getTexMode()
%4 = icmp eq i32 %3, 6
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @changeTexMode(i32 2)
br label %7
7: ; preds = %5, %1
%8 = fmul float %2, %0
%9 = fptosi float %8 to i32
%10 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}
/* Variables and functions */
int close(int);
int closePort(int port) {
  int res = 0;
  if (port != -1)
    res = close(port);
  return res;
}


x86 assembly (clang, -O0):
<closePort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1137 <closePort+0x27>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closePort>:
cmp    $0xffffffff,%edi
je     111a <closePort+0xa>
jmp    1030 <close@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @closePort(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int bot2(int grid[6][7], int move) {}


x86 assembly (clang, -O0):
<bot2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bot2([7 x i32]* nocapture readnone %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sc1200wdt_read_data(unsigned char, unsigned char *);
int sc1200wdt_probe(void) {
  unsigned char reg;
  int tmp;
  {
    sc1200wdt_read_data((unsigned char)4, &reg);
    reg = (unsigned char)((int)reg & 15);
    if ((int)reg == 14) {
      tmp = 0;
    } else {
      tmp = -19;
    }
    return (tmp);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
lea    -0x1(%rbp),%rsi
call   1030 <sc1200wdt_read_data@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xe,%eax
jne    1149 <sc1200wdt_probe+0x39>
movl   $0x0,-0x8(%rbp)
jmp    1150 <sc1200wdt_probe+0x40>
movl   $0xffffffed,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x4,%edi
call   1030 <sc1200wdt_read_data@plt>
mov    0x7(%rsp),%al
and    $0xf,%al
xor    %ecx,%ecx
cmp    $0xe,%al
mov    $0xffffffed,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sc1200wdt_probe() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 @sc1200wdt_read_data(i8 zeroext 4, i8* %1)
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
store i8 %7, i8* %1
%8 = load i8, i8* %1
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 14
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 0, i32* %2
br label %13
12: ; preds = %0
store i32 -19, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @sc1200wdt_probe() {
%1 = alloca i8
%2 = call i32 @sc1200wdt_read_data(i8 zeroext 4, i8* %1)
%3 = load i8, i8* %1
%4 = and i8 %3, 15
%5 = icmp eq i8 %4, 14
%6 = select i1 %5, i32 0, i32 -19
ret i32 %6
}
void f(const int *m_ptr, int sig_off, int rec_size) {
  if (m_ptr[sig_off] == 0xdd && (sig_off + 15 <= (rec_size - 100))) {
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0xdd,(%rax,%rcx,4)
jne    113c <f+0x3c>
mov    -0xc(%rbp),%eax
add    $0xf,%eax
mov    -0x10(%rbp),%ecx
sub    $0x64,%ecx
cmp    %ecx,%eax
jg     113c <f+0x3c>
jmp    113c <f+0x3c>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i32* nocapture %0, i32 %1, i32 %2) {
ret void
}
int sum(int n) {
  int ret = 0;
  int i = 0;
  for (i = 1; i <= n; ++i) {
    ret += i;
  }
  return ret;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113f <sum+0x3f>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <sum+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
jle    1118 <sum+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int isalnum(int);
int sim_isalnum(int c) { return ((c < 0) || (c >= 128)) ? 0 : isalnum(c); }


x86 assembly (clang, -O0):
<sim_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1132 <sim_isalnum+0x22>
cmpl   $0x80,-0x4(%rbp)
jl     113c <sim_isalnum+0x2c>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <sim_isalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_isalnum>:
cmp    $0x7f,%edi
jbe    1118 <sim_isalnum+0x8>
xor    %eax,%eax
ret
jmp    1030 <isalnum@plt>

LLVM IR (-O0):
define i32 @sim_isalnum(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 %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 128
br i1 %7, label %8, label %9
8: ; preds = %5, %1
br label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = call i32 @isalnum(i32 %10)
br label %12
12: ; preds = %9, %8
%13 = phi i32 [ 0, %8 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @sim_isalnum(i32 %0) {
%2 = icmp ugt i32 %0, 127
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @isalnum(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void foo326(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo326(i32 %0) {
ret void
}
/* Variables and functions */
size_t memoryIndex(size_t p) {
  if (p < 0)
    return 0;
  else if (p < 65536)
    return p;
  else
    return 65536 - 1;
}


x86 assembly (clang, -O0):
<memoryIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jae    1120 <memoryIndex+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1143 <memoryIndex+0x43>
cmpq   $0x10000,-0x10(%rbp)
jae    113b <memoryIndex+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1143 <memoryIndex+0x43>
movq   $0xffff,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memoryIndex>:
cmp    $0xffff,%rdi
mov    $0xffff,%eax
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @memoryIndex(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ult i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %13
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp ult i64 %8, 65536
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i64, i64* %3
store i64 %11, i64* %2
br label %13
12: ; preds = %7
store i64 65535, i64* %2
br label %13
13: ; preds = %12, %10, %6
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @memoryIndex(i64 %0) {
%2 = icmp ult i64 %0, 65535
%3 = select i1 %2, i64 %0, i64 65535
ret i64 %3
}
/* Variables and functions */
int test1_f1();
void test1_f2() {
  int x = 1;
  x = test1_f1();
  if (x == 1) {
    int *p = 0;
    *p = 3;
  }
  if (x == 2) {
    int *p = 0;
    *p = 3;
  }
}


x86 assembly (clang, -O0):
<test1_f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test1_f1@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1145 <test1_f2+0x35>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpl   $0x2,-0x4(%rbp)
jne    1161 <test1_f2+0x51>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test1_f2() {
%1 = tail call i32 (...) @test1_f1()
%2 = icmp ne i32 %1, 1
tail call void @llvm.assume(i1 %2)
%3 = icmp ne i32 %1, 2
tail call void @llvm.assume(i1 %3)
ret void
}
int main(int argc, char *argv[]) {
  printf("%s[%d]\tparam num:%d\n", __func__, 8, argc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xed7(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%ecx
lea    0xee6(%rip),%rdi
lea    0xef4(%rip),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"%s[%d]\09param num:%d\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 8, i32 %0)
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double ran1() { return (double)((double)rand() / ((double)RAND_MAX)); }


x86 assembly (clang, -O0):
<ran1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ran1>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @ran1() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @ran1() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
int *fn2(int i) {
  int *p = i;
  p = i;
  fn1(i);
  return i;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <fn1@plt>
movslq -0x4(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
push   %rbx
movslq %edi,%rbx
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <fn1@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @fn2(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32, i32* %2
%11 = call i32 (i32, ...) bitcast (i32 (...)* @fn1 to i32 (i32, ...)*)(i32 %10)
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
ret i32* %14
}

LLVM IR (-O2):
define i32* @fn2(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @fn1 to i32 (i32, ...)*)(i32 %0)
%4 = inttoptr i64 %2 to i32*
ret i32* %4
}
void set_process_cpu_timer(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<set_process_cpu_timer>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_process_cpu_timer>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.set_process_cpu_timer = [22 x i8] c"set_process_cpu_timer\00"
define void @set_process_cpu_timer() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.set_process_cpu_timer, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.set_process_cpu_timer = [22 x i8] c"set_process_cpu_timer\00"
define void @set_process_cpu_timer() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.set_process_cpu_timer, i64 0, i64 0))
ret void
}
const char *_Locale_long_d_fmt(struct _Locale_time *__DUMMY_PAR) { return 0; }


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

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

LLVM IR (-O0):
%struct._Locale_time = type opaque
define i8* @_Locale_long_d_fmt(%struct._Locale_time* %0) {
%2 = alloca %struct._Locale_time*
store %struct._Locale_time* %0, %struct._Locale_time** %2
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_time = type opaque
define noalias i8* @_Locale_long_d_fmt(%struct._Locale_time* nocapture readnone %0) {
ret i8* null
}
int discount(float total) {
  float con;
  con = total * 20 / 100;
  total = total - con;
  return total;
}


x86 assembly (clang, -O0):
<discount>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<discount>:
movss  0xef8(%rip),%xmm1
mulss  %xmm0,%xmm1
divss  0xef0(%rip),%xmm1
addss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @discount(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 2.000000e+01
%6 = fdiv float %5, 1.000000e+02
store float %6, float* %3
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fsub float %7, %8
store float %9, float* %2
%10 = load float, float* %2
%11 = fptosi float %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @discount(float %0) {
%2 = fmul float %0, 2.000000e+01
%3 = fdiv float %2, 1.000000e+02
%4 = fsub float %0, %3
%5 = fptosi float %4 to i32
ret i32 %5
}
unsigned int min(unsigned int i1, unsigned int i2) { return i1 < i2 ? i1 : i2; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp ult i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MDrv_PNL_SetSSC(unsigned short, unsigned short,
                                   unsigned char);
void _SetSSC(unsigned short u16Fmodulation, unsigned short u16Rdeviation,
             unsigned char bEnable) {
  ;
  MDrv_PNL_SetSSC(u16Fmodulation, u16Rdeviation, bEnable);
  ;
}


x86 assembly (clang, -O0):
<_SetSSC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movzwl %cx,%edi
movzwl %ax,%esi
movzbl -0x5(%rbp),%edx
call   1030 <MDrv_PNL_SetSSC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_SetSSC>:
jmp    1030 <MDrv_PNL_SetSSC@plt>

LLVM IR (-O0):
define void @_SetSSC(i16 zeroext %0, i16 zeroext %1, i8 zeroext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i8
store i16 %0, i16* %4
store i16 %1, i16* %5
store i8 %2, i8* %6
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = load i8, i8* %6
%10 = call i32 @MDrv_PNL_SetSSC(i16 zeroext %7, i16 zeroext %8, i8 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @_SetSSC(i16 zeroext %0, i16 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @MDrv_PNL_SetSSC(i16 zeroext %0, i16 zeroext %1, i8 zeroext %2)
ret void
}
float lin_inter(float x, float y, float s) { return (x + s * (y - x)); }


x86 assembly (clang, -O0):
<lin_inter>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lin_inter>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lin_inter(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = load float, float* %5
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = call float @llvm.fmuladd.f32(float %8, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @lin_inter(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %0)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ NupAndDown();
void Ncr(void) {
  int x;
  *((unsigned int *)0xC000A044) &= ~(1 << 1);
  for (x = 0; x < 2; x++) {
    NupAndDown();
  }
}


x86 assembly (clang, -O0):
<Ncr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc000a044,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0xc000a044,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    114f <Ncr+0x3f>
mov    $0x0,%al
call   1030 <NupAndDown@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <Ncr+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ncr>:
push   %rax
mov    $0xc000a044,%eax
andb   $0xfd,(%rax)
xor    %eax,%eax
call   1030 <NupAndDown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <NupAndDown@plt>

LLVM IR (-O0):
define void @Ncr() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 3221266500 to i32*)
%3 = and i32 %2, -3
store i32 %3, i32* inttoptr (i64 3221266500 to i32*)
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 (...) @NupAndDown()
br label %9
9: ; preds = %7
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Ncr() {
%1 = load i32, i32* inttoptr (i64 3221266500 to i32*)
%2 = and i32 %1, -3
store i32 %2, i32* inttoptr (i64 3221266500 to i32*)
%3 = tail call i32 (...) @NupAndDown()
%4 = tail call i32 (...) @NupAndDown()
ret void
}
void EC_KEY_set_private_key(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_set_private_key() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ oom();
void *malloce(size_t size) {
  void *ret;
  ret = malloc(size);
  if (!ret)
    oom();
  return ret;
}


x86 assembly (clang, -O0):
<malloce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <malloce+0x2b>
mov    $0x0,%al
call   1030 <oom@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloce>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <malloce+0x15>
xor    %eax,%eax
call   1030 <oom@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @malloce(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @oom()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int doAddition(int val1, int val2) { return val1 + val2; }


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

x86 assembly (clang, -O2):
<doAddition>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @doAddition(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void error_pointer_assign(int *a, int __attribute((unit("m"))) * b) { a = b; }


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

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

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

LLVM IR (-O2):
define void @error_pointer_assign(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strlen(char *);
void cmdline_parser_print_version(void) {
  printf("%s %s\n", (strlen("lispd") ? "lispd" : "lispd"), "0.3.2");
}


x86 assembly (clang, -O0):
<cmdline_parser_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xedc(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed0(%rip),%rsi
cmp    $0x0,%rax
cmovne %rsi,%rsi
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rdx
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_parser_print_version>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xee8(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [6 x i8] c"lispd\00"
@.str.2 = [6 x i8] c"0.3.2\00"
define void @cmdline_parser_print_version() {
%1 = call i64 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [6 x i8] c"lispd\00"
@.str.2 = [6 x i8] c"0.3.2\00"
define void @cmdline_parser_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *ptr) {
  if (ptr != NULL) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int /*<<< orphan*/ strmove(char *, char *);
char *strins(char *dest, const char *ins) {
  strmove(dest + strlen(ins), dest);
  memcpy(dest, ins, strlen(ins));
  return dest;
}


x86 assembly (clang, -O0):
<strins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strmove@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strins>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %rbx,%rsi
call   1050 <strmove@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strins(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %3
%11 = call i32 @strmove(i8* %9, i8* %10)
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @memcpy(i8* %12, i8* %13, i32 %15)
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @strins(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strmove(i8* %5, i8* %0)
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %7)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *);
main() {
  char *sz = "This is line one.\nThis is line two.\n";
  FILE *fp;
  printf(sz);
  fp = fopen("test2.out", "w");
  fprintf(fp, sz);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xe96(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"This is line one.\0AThis is line two.\0A\00"
@.str.1 = [10 x i8] c"test2.out\00"
@.str.2 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i32*
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* %3)
%5 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = load i8*, i8** %1
%8 = call i32 @fprintf(i32* %6, i8* %7)
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"This is line one.\0AThis is line two.\0A\00"
@.str.1 = [10 x i8] c"test2.out\00"
@.str.2 = [2 x i8] c"w\00"
@str = [36 x i8] c"This is line one.\0AThis is line two.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 36, i64 1, i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret i32 0
}
int do_038() { return 38; }


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

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

LLVM IR (-O0):
define i32 @do_038() {
ret i32 38
}

LLVM IR (-O2):
define i32 @do_038() {
ret i32 38
}