xunge/DecIR huggingface dataset:
/* Variables and functions */
char *getStatusText(int const);
int lseek(int, int);
int /*<<< orphan*/ printf(char *, int, char *);
int lseek_log(int oftIndex, int pos) {
  const int status = lseek(oftIndex, pos);
  printf("SEEK FILE %d: %s\n", oftIndex, getStatusText(status));
  return status;
}


x86 assembly (clang, -O0):
<lseek_log>:
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   1040 <lseek@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <getStatusText@plt>
mov    -0x10(%rbp),%esi
mov    %rax,%rdx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek_log>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <lseek@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <getStatusText@plt>
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"SEEK FILE %d: %s\0A\00"
define i32 @lseek_log(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @lseek(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = call i8* @getStatusText(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [18 x i8] c"SEEK FILE %d: %s\0A\00"
define i32 @lseek_log(i32 %0, i32 %1) {
%3 = tail call i32 @lseek(i32 %0, i32 %1)
%4 = tail call i8* @getStatusText(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %4)
ret i32 %3
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  int /*<<< orphan*/ tv_nsec;
};

/* Variables and functions */
scalar_t__ nanosleep(struct timespec *, struct timespec *);
unsigned sleep(unsigned seconds) {
  struct timespec tv = {.tv_sec = seconds, .tv_nsec = 0};
  if (nanosleep(&tv, &tv))
    return tv.tv_sec;
  return 0;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
je     1149 <sleep+0x39>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <sleep+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rax
mov    %edi,(%rsp)
movl   $0x0,0x4(%rsp)
mov    %rsp,%rdi
mov    %rdi,%rsi
call   1030 <nanosleep@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1134 <sleep+0x24>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timespec
store i32 %0, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
store i32 0, i32* %7
%8 = call i64 @nanosleep(%struct.timespec* %4, %struct.timespec* %4)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 0, i32* %5
%6 = call i64 @nanosleep(%struct.timespec* %2, %struct.timespec* %2)
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* %4
%9 = select i1 %7, i32 0, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ des(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ desm1(unsigned char *, unsigned char *, unsigned char *);
void TriEnDes(unsigned char *s, unsigned char *o, unsigned char *Key) {
  unsigned char TmpBuff[16];
  des(s, o, Key);
  desm1(o, TmpBuff, Key + 8);
  des(TmpBuff, o, Key);
}


x86 assembly (clang, -O0):
<TriEnDes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <des@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
call   1040 <desm1@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <des@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TriEnDes>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <des@plt>
lea    0x8(%r14),%rdx
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <desm1@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <des@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @TriEnDes(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @des(i8* %8, i8* %9, i8* %10)
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 8
%16 = call i32 @desm1(i8* %12, i8* %13, i8* %15)
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = call i32 @des(i8* %17, i8* %18, i8* %19)
ret void
}

LLVM IR (-O2):
define void @TriEnDes(i8* %0, i8* %1, i8* %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @des(i8* %0, i8* %1, i8* %2)
%7 = getelementptr inbounds i8, i8* %2, i64 8
%8 = call i32 @desm1(i8* %1, i8* %5, i8* %7)
%9 = call i32 @des(i8* %5, i8* %1, i8* %2)
ret void
}
int fun593() { return 593; }


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

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

LLVM IR (-O0):
define i32 @fun593() {
ret i32 593
}

LLVM IR (-O2):
define i32 @fun593() {
ret i32 593
}
/* Variables and functions */
float sqrt(float);
int isExactSquare(float p) {
  float m = sqrt(p);
  if (m == (int)sqrt(p))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isExactSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
cvttss2si %xmm1,%eax
cvtsi2ss %eax,%xmm1
ucomiss %xmm1,%xmm0
jne    116b <isExactSquare+0x5b>
jp     116b <isExactSquare+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <isExactSquare+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isExactSquare>:
sub    $0x28,%rsp
movaps %xmm0,%xmm2
sqrtss %xmm0,%xmm0
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm2
movaps %xmm0,%xmm1
jae    114a <isExactSquare+0x3a>
movaps %xmm0,0x10(%rsp)
movaps %xmm2,%xmm0
movss  %xmm2,0xc(%rsp)
call   1030 <sqrt@plt>
xorps  %xmm3,%xmm3
movss  0xc(%rsp),%xmm2
movaps %xmm0,%xmm1
movaps 0x10(%rsp),%xmm0
ucomiss %xmm3,%xmm2
jae    1163 <isExactSquare+0x53>
movaps %xmm2,%xmm0
movss  %xmm1,0x10(%rsp)
call   1030 <sqrt@plt>
movss  0x10(%rsp),%xmm1
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @isExactSquare(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = call float @sqrt(float %5)
store float %6, float* %4
%7 = load float, float* %4
%8 = load float, float* %3
%9 = call float @sqrt(float %8)
%10 = fptosi float %9 to i32
%11 = sitofp i32 %10 to float
%12 = fcmp oeq float %7, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @isExactSquare(float %0) {
%2 = tail call float @sqrt(float %0)
%3 = tail call float @sqrt(float %0)
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
%6 = fcmp oeq float %2, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_unsigned_long(unsigned long const k1,
                                            unsigned long const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_unsigned_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_unsigned_long>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_unsigned_long(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 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_unsigned_long(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *trim(char *);
int main() {
  char *buffer = (char *)malloc(strlen("  cat asdf ") + 1);
  strcpy(buffer, "  cat");
  printf("%s\n", trim(buffer));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1060 <trim@plt>
mov    %rax,%rsi
lea    0xe74(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <trim@plt>
lea    0xe9a(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c" cat asdf \00"
@.str.1 = [6 x i8] c" cat\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i64 %3, 1
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = call i8* @trim(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c" cat\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i64 12)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* @trim(i8* %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int __wrap_chown(const char *pathname, uid_t owner, gid_t group) { return 0; }


x86 assembly (clang, -O0):
<__wrap_chown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__wrap_chown(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_RD_MODE;
int ioctl(int, int /*<<< orphan*/, int *);
uint8_t get_spi_mode(int fd) {
  uint8_t mode;
  int ret = ioctl(fd, SPI_IOC_RD_MODE, &mode);
  if (ret >= 0) {
    return mode;
  }
  return ret;
}


x86 assembly (clang, -O0):
<get_spi_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1148 <get_spi_mode+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <get_spi_mode+0x3e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_spi_mode>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
test   %eax,%eax
js     112c <get_spi_mode+0x1c>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@SPI_IOC_RD_MODE = global i32 0
define i32 @get_spi_mode(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @SPI_IOC_RD_MODE
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp sgt i32 %5, -1
%7 = load i32, i32* %2
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
void do_fldln2(void *p) {
  asm __volatile__("fninit");
  asm __volatile__("fldln2");
  asm __volatile__("fstpl (%0)" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<do_fldln2>:
fninit
fldln2
fstpl  (%rdi)
ret

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

LLVM IR (-O2):
define void @do_fldln2(i8* %0) {
tail call void asm sideeffect "fninit", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fldln2", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fstpl ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
void cmgr_mmap_finalize(void) { return; }


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

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

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

LLVM IR (-O2):
define void @cmgr_mmap_finalize() {
ret void
}
/* Variables and functions */
double atof(char *);
double not_a_number(void) { return atof("NaN"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"NaN\00"
define double @not_a_number() {
%1 = call double @atof(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret double %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"NaN\00"
define double @not_a_number() {
%1 = tail call double @atof(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret double %1
}
/* Type definitions */
struct transmission {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append_segment(struct transmission *, char *);
char *strndup(char *, int);
void add_segment(struct transmission *trans, char *seg_start, int seglen) {
  char *seg;
  seg = strndup(seg_start, seglen);
  append_segment(trans, seg);
}


x86 assembly (clang, -O0):
<add_segment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strndup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <append_segment@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_segment>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <strndup@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <append_segment@plt>

LLVM IR (-O0):
%struct.transmission = type { i32 }
define void @add_segment(%struct.transmission* %0, i8* %1, i32 %2) {
%4 = alloca %struct.transmission*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store %struct.transmission* %0, %struct.transmission** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @strndup(i8* %8, i32 %9)
store i8* %10, i8** %7
%11 = load %struct.transmission*, %struct.transmission** %4
%12 = load i8*, i8** %7
%13 = call i32 @append_segment(%struct.transmission* %11, i8* %12)
ret void
}

LLVM IR (-O2):
%struct.transmission = type { i32 }
define void @add_segment(%struct.transmission* %0, i8* nocapture %1, i32 %2) {
%4 = tail call i8* @strndup(i8* %1, i32 %2)
%5 = tail call i32 @append_segment(%struct.transmission* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char *);
void show(char *c, int x, int y) { printf("\x1b[%d;%dH%s", y, x, c); }


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[%d;%dH%s\00"
define void @show(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[%d;%dH%s\00"
define void @show(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %1, i8* %0)
ret void
}
int keypin_open_journal(const char *fname) {
  (void)fname;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @keypin_open_journal(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dailyWeather2Write(int, char **, char **, int);
void dailyWeather2Write_R(int *nSites, char *siteNames[], char *siteDirs[],
                          int *year) {
  dailyWeather2Write(*nSites, siteNames, siteDirs, *year);
}


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

x86 assembly (clang, -O2):
<dailyWeather2Write_R>:
mov    (%rdi),%edi
mov    (%rcx),%ecx
jmp    1030 <dailyWeather2Write@plt>

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

LLVM IR (-O2):
define void @dailyWeather2Write_R(i32* nocapture %0, i8** %1, i8** %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %3
%7 = tail call i32 @dailyWeather2Write(i32 %5, i8** %1, i8** %2, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write32(int, int);
void systemReset() {
  write32(0x0D8005E0, 0xFFFFFFFE);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<systemReset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd8005e0,%edi
mov    $0xfffffffe,%esi
call   1030 <write32@plt>
jmp    1123 <systemReset+0x13>

x86 assembly (clang, -O2):
<systemReset>:
push   %rax
mov    $0xd8005e0,%edi
mov    $0xfffffffe,%esi
call   1030 <write32@plt>
jmp    1120 <systemReset+0x10>

LLVM IR (-O0):
define void @systemReset() {
%1 = call i32 @write32(i32 226493920, i32 -2)
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @systemReset() {
%1 = tail call i32 @write32(i32 226493920, i32 -2)
br label %2
2: ; preds = %0, %2
br label %2
}
void _infix_operator_mod_u32_u32(unsigned long lhs, unsigned long rhs,
                                 unsigned long *__rval_1) {
  *__rval_1 = lhs % rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_mod_u32_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rdx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_mod_u32_u32>:
mov    %rdx,%rcx
mov    %rdi,%rax
mov    %rdi,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     111b <_infix_operator_mod_u32_u32+0x1b>
xor    %edx,%edx
div    %rsi
mov    %rdx,(%rcx)
ret
xor    %edx,%edx
div    %esi
mov    %rdx,(%rcx)
ret

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

LLVM IR (-O2):
define void @_infix_operator_mod_u32_u32(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = urem i64 %0, %1
store i64 %4, i64* %2
ret void
}
/* Variables and functions */
int get(long, long);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, long *, long *);
int main(int argc, char *argv[]) {
  long a, b, m;
  scanf("%i%i", &a, &b);
  printf("%i", get(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <get@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1040 <get@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%i%i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %6, i64* %7)
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = call i32 @get(i64 %10, i64 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%i%i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3, i64* %4)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @get(i64 %8, i64 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
void UARTFIFOLevelGet(uint32_t ui32Base, uint32_t *pui32TxLevel,
                      uint32_t *pui32RxLevel) {
  uint32_t ui32Temp;
  ASSERT(_UARTBaseValid(ui32Base));
  ui32Temp = (*((volatile uint32_t *)(ui32Base + 0x00000034)));
  *pui32TxLevel = ui32Temp & 0x00000007;
  *pui32RxLevel = ui32Temp & 0x00000038;
}


x86 assembly (clang, -O0):
<UARTFIFOLevelGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
and    $0x7,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
and    $0x38,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOLevelGet>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebp,%rax
mov    0x34(%rax),%eax
mov    %eax,%ecx
and    $0x7,%ecx
mov    %ecx,(%rbx)
and    $0x38,%eax
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTFIFOLevelGet(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = call i32 @_UARTBaseValid(i32 %8)
%10 = call i32 @ASSERT(i32 %9)
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 52
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = and i32 %16, 7
%18 = load i32*, i32** %5
store i32 %17, i32* %18
%19 = load i32, i32* %7
%20 = and i32 %19, 56
%21 = load i32*, i32** %6
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @UARTFIFOLevelGet(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @_UARTBaseValid(i32 %0)
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 52
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, 7
store i32 %10, i32* %1
%11 = and i32 %9, 56
store i32 %11, i32* %2
ret void
}
void ecm_sfe_ipv6_stop(int num) { return; }


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

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

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

LLVM IR (-O2):
define void @ecm_sfe_ipv6_stop(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htobe32(int /*<<< orphan*/);
void WriteBE32(unsigned char *ptr, uint32_t x) {
  *((uint32_t *)ptr) = htobe32(x);
}


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

x86 assembly (clang, -O2):
<WriteBE32>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htobe32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @WriteBE32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htobe32(i32 %5)
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @WriteBE32(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htobe32(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int removeDuplicatesNTimes(int *, int, int);
int removeDuplicates(int *nums, int numsSize) {
  return removeDuplicatesNTimes(nums, numsSize, 2);
}


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

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

LLVM IR (-O0):
define i32 @removeDuplicates(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 @removeDuplicatesNTimes(i32* %5, i32 %6, i32 2)
ret i32 %7
}

LLVM IR (-O2):
define i32 @removeDuplicates(i32* %0, i32 %1) {
%3 = tail call i32 @removeDuplicatesNTimes(i32* %0, i32 %1, i32 2)
ret i32 %3
}
void XtInstallAccelerators() {}


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

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

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

LLVM IR (-O2):
define void @XtInstallAccelerators() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *p = malloc(sizeof(int));
  int *q = p;
  int i, x;
  i = x;
  if (i == 4711)
    free(q);
  *p = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1267,-0x1c(%rbp)
jne    1161 <main+0x41>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32* @malloc(i32 4)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
store i32* %7, i32** %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 4711
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32*, i32** %3
%13 = call i32 @free(i32* %12)
br label %14
14: ; preds = %11, %0
%15 = load i32*, i32** %2
store i32 1, i32* %15
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void pru_set_reg(uint8_t pru_num, uint8_t reg_num, uint32_t reg_value) {
  if (reg_num >= (16) || pru_num > 1)
    return;
  uint32_t *base_addr =
      (uint32_t *)((0x01C30000) + (((512) / 2) - ((4) * (16))) +
                   (0x2000 * pru_num));
  *(base_addr + reg_num) = reg_value;
  return;
}


x86 assembly (clang, -O0):
<pru_set_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1121 <pru_set_reg+0x21>
cmpl   $0x1,-0x4(%rbp)
jle    1126 <pru_set_reg+0x26>
jmp    1145 <pru_set_reg+0x45>
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
add    $0x1c300c0,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pru_set_reg>:
cmp    $0x1,%edi
jg     111b <pru_set_reg+0x1b>
cmp    $0xf,%esi
jg     111b <pru_set_reg+0x1b>
movslq %edi,%rax
shl    $0xd,%rax
movslq %esi,%rcx
mov    %edx,0x1c300c0(%rax,%rcx,4)
ret

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

LLVM IR (-O2):
define void @pru_set_reg(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 15
%5 = icmp sgt i32 %0, 1
%6 = or i1 %5, %4
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = shl nsw i32 %0, 13
%9 = add nsw i32 %8, 29556928
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = sext i32 %1 to i64
%13 = getelementptr inbounds i32, i32* %11, i64 %12
store i32 %2, i32* %13
br label %14
14: ; preds = %3, %7
ret void
}
int IoSeq_byteCompare(const void *a, const void *b) {
  char aa = *(char *)a;
  char bb = *(char *)b;
  if (aa < bb) {
    return -1;
  }
  if (aa == bb) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<IoSeq_byteCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jge    113a <IoSeq_byteCompare+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <IoSeq_byteCompare+0x5d>
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jne    1156 <IoSeq_byteCompare+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <IoSeq_byteCompare+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IoSeq_byteCompare>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @IoSeq_byteCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp ne i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
char *binary_prefix(const int number) { return ""; }


x86 assembly (clang, -O0):
<binary_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @binary_prefix(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @binary_prefix(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char get_random_number(int, int);
int /*<<< orphan*/ printf(char *, char *, char);
int /*<<< orphan*/ sleep(char);
int /*<<< orphan*/ stdout;
void think(uint8_t *name) {
  uint8_t random = get_random_number(1, 20);
  printf("%s thinking for %u seconds.\n", name, random);
  fflush(stdout);
  sleep(random);
}


x86 assembly (clang, -O0):
<think>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x14,%esi
call   1050 <get_random_number@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe97(%rip),%rdi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
movsbl -0x9(%rbp),%edi
call   1060 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<think>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x14,%esi
call   1050 <get_random_number@plt>
movsbl %al,%ebp
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"%s thinking for %u seconds.\0A\00"
@stdout = global i32 0
define void @think(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = call signext i8 @get_random_number(i32 1, i32 20)
store i8 %4, i8* %3
%5 = load i8*, i8** %2
%6 = load i8, i8* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5, i8 signext %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = load i8, i8* %3
%11 = call i32 @sleep(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s thinking for %u seconds.\0A\00"
@stdout = global i32 0
define void @think(i8* %0) {
%2 = tail call signext i8 @get_random_number(i32 1, i32 20)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @sleep(i8 signext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndexedXE0(int);
int /*<<< orphan*/ INC16(int /*<<< orphan*/, int);
void OpF6E0M0(void) { INC16(DirectIndexedXE0(3), 0xFFFF); }


x86 assembly (clang, -O0):
<OpF6E0M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <INC16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpF6E0M0>:
push   %rax
mov    $0x3,%edi
call   1030 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <INC16@plt>

LLVM IR (-O0):
define void @OpF6E0M0() {
%1 = call i32 @DirectIndexedXE0(i32 3)
%2 = call i32 @INC16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @OpF6E0M0() {
%1 = tail call i32 @DirectIndexedXE0(i32 3)
%2 = tail call i32 @INC16(i32 %1, i32 65535)
ret void
}
int test4(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test4() {
ret i32 0
}
int adis16260_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @adis16260_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void AV_WB32(uint8_t *dst, unsigned val) {
  *dst++ = val >> 24;
  *dst++ = val >> 16;
  *dst++ = val >> 8;
  *dst++ = val;
}


x86 assembly (clang, -O0):
<AV_WB32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
shr    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
shr    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AV_WB32>:
mov    %esi,%eax
shr    $0x18,%eax
mov    %eax,(%rdi)
mov    %esi,%eax
shr    $0x10,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
shr    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @AV_WB32(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 = lshr i32 %5, 24
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %3
store i32 %6, i32* %7
%9 = load i32, i32* %4
%10 = lshr i32 %9, 16
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %3
store i32 %10, i32* %11
%13 = load i32, i32* %4
%14 = lshr i32 %13, 8
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %3
store i32 %14, i32* %15
%17 = load i32, i32* %4
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %3
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @AV_WB32(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %0
%5 = lshr i32 %1, 16
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %4
%7 = lshr i32 %1, 8
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %6
store i32 %1, i32* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
short compareSection(int /*<<< orphan*/ *, int /*<<< orphan*/, int, char *);
short hasCorrectPDFVersion(FILE *file) {
  return compareSection(file, 0, 8, "%PDF-1.4");
}


x86 assembly (clang, -O0):
<hasCorrectPDFVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
lea    0xed2(%rip),%rcx
call   1030 <compareSection@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasCorrectPDFVersion>:
lea    0xee9(%rip),%rcx
xor    %esi,%esi
mov    $0x8,%edx
jmp    1030 <compareSection@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%PDF-1.4\00"
define signext i16 @hasCorrectPDFVersion(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call signext i16 @compareSection(i32* %3, i32 0, i32 8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i16 %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"%PDF-1.4\00"
define signext i16 @hasCorrectPDFVersion(i32* %0) {
%2 = tail call signext i16 @compareSection(i32* %0, i32 0, i32 8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i16 %2
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
char *strdup(char *);
char *find_egress_interface(struct sockaddr *source, struct sockaddr *dest) {
  return strdup("InterfaceUnavailable");
}


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

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [21 x i8] c"InterfaceUnavailable\00"
define i8* @find_egress_interface(%struct.sockaddr* %0, %struct.sockaddr* %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
store %struct.sockaddr* %1, %struct.sockaddr** %4
%5 = call i8* @strdup(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i8* %5
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [21 x i8] c"InterfaceUnavailable\00"
define noalias i8* @find_egress_interface(%struct.sockaddr* nocapture readnone %0, %struct.sockaddr* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(21) i8* @strdup(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
int somatorio(int n) {
  if (n <= 1) {
    return n;
  } else {
    int x = somatorio(n - 1);
    return x += n;
  }
}


x86 assembly (clang, -O0):
<somatorio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <somatorio+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <somatorio+0x3a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <somatorio@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<somatorio>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1123 <somatorio+0x23>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %ecx,%eax
lea    -0x3(%rdi),%edx
imul   %rcx,%rdx
shr    %rdx
add    %edi,%eax
sub    %edx,%eax
mov    $0x1,%edi
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @somatorio(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = add nsw i32 %0, -2
%6 = mul i32 %4, %5
%7 = zext i32 %5 to i33
%8 = add nsw i32 %0, -3
%9 = zext i32 %8 to i33
%10 = mul i33 %7, %9
%11 = lshr i33 %10, 1
%12 = trunc i33 %11 to i32
%13 = add i32 %6, %0
%14 = sub i32 %13, %12
br label %15
15: ; preds = %3, %1
%16 = phi i32 [ 0, %1 ], [ %14, %3 ]
%17 = phi i32 [ %0, %1 ], [ 1, %3 ]
%18 = add nsw i32 %17, %16
ret i32 %18
}