xunge/DecIR huggingface dataset:
void write16le(int in, unsigned char *buf) {
  buf[0] = in & 0xff;
  buf[1] = (in >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<write16le>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write16le>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @write16le(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 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @write16le(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
ft_tablerecwrite() {}


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

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

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

LLVM IR (-O2):
define i32 @ft_tablerecwrite() {
ret i32 undef
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double now(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + tv.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVBUF;
int api_error_translate(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int api_socket_recv_buffer_size(int fd, int size) {
  if (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)))
    return 0;
  return api_error_translate(errno);
}


x86 assembly (clang, -O0):
<api_socket_recv_buffer_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    116c <api_socket_recv_buffer_size+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    117d <api_socket_recv_buffer_size+0x5d>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <api_error_translate@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<api_socket_recv_buffer_size>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %rax,%rax
je     115c <api_socket_recv_buffer_size+0x3c>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <api_error_translate@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
@errno = global i32 0
define i32 @api_socket_recv_buffer_size(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_RCVBUF
%9 = call i64 @setsockopt(i32 %6, i32 %7, i32 %8, i32* %5, i32 4)
%10 = icmp eq i64 0, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %15
12: ; preds = %2
%13 = load i32, i32* @errno
%14 = call i32 @api_error_translate(i32 %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
@errno = global i32 0
define i32 @api_socket_recv_buffer_size(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_RCVBUF
%6 = call i64 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %3, i32 4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* @errno
%10 = call i32 @api_error_translate(i32 %9)
br label %11
11: ; preds = %2, %8
%12 = phi i32 [ %10, %8 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int params__is_sign_char(char);
int params__is_data_char(char c) {
  int ret = 0;
  ret |= (c >= '0' && c <= '9');
  ret |= params__is_sign_char(c);
  return ret;
}


x86 assembly (clang, -O0):
<params__is_data_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     1144 <params__is_data_char+0x34>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <params__is_sign_char@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<params__is_data_char>:
push   %rbx
lea    -0x30(%rdi),%eax
xor    %ebx,%ebx
cmp    $0xa,%al
setb   %bl
call   1030 <params__is_sign_char@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @params__is_data_char(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i8, i8* %2
%17 = call i32 @params__is_sign_char(i8 signext %16)
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @params__is_data_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
%5 = tail call i32 @params__is_sign_char(i8 signext %0)
%6 = or i32 %5, %4
ret i32 %6
}
int getGroup(int base2) {
  if (base2 == 4) {
    return 2;
  } else if (base2 == 8) {
    return 3;
  } else if (base2 == 16) {
    return 4;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<getGroup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    111d <getGroup+0x1d>
movl   $0x2,-0x4(%rbp)
jmp    1150 <getGroup+0x50>
cmpl   $0x8,-0x8(%rbp)
jne    1133 <getGroup+0x33>
movl   $0x3,-0x4(%rbp)
jmp    1150 <getGroup+0x50>
cmpl   $0x10,-0x8(%rbp)
jne    1149 <getGroup+0x49>
movl   $0x4,-0x4(%rbp)
jmp    1150 <getGroup+0x50>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGroup>:
cmp    $0x4,%edi
je     1115 <getGroup+0x15>
cmp    $0x10,%edi
je     111b <getGroup+0x1b>
cmp    $0x8,%edi
jne    1121 <getGroup+0x21>
mov    $0x3,%eax
ret
mov    $0x2,%eax
ret
mov    $0x4,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @getGroup(i32 %0) {
switch i32 %0, label %4 [
i32 4, label %5
i32 8, label %2
i32 16, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 3, %2 ], [ 4, %3 ], [ 1, %4 ], [ 2, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int double_t;

/* Variables and functions */
float duration_to_degrees(double_t ms, double_t RPM) {
  return (ms / 1000) * 6 * RPM;
}


x86 assembly (clang, -O0):
<duration_to_degrees>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x6,%eax,%eax
imul   -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<duration_to_degrees>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   %esi,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @duration_to_degrees(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 = sdiv i32 %5, 1000
%7 = mul nsw i32 %6, 6
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @duration_to_degrees(i32 %0, i32 %1) {
%3 = sdiv i32 %0, 1000
%4 = mul nsw i32 %3, 6
%5 = mul nsw i32 %4, %1
%6 = sitofp i32 %5 to float
ret float %6
}
/* Variables and functions */
char *StrDup(char *);
int /*<<< orphan*/ itos(int);
int /*<<< orphan*/ val_exist(char *, int /*<<< orphan*/, char *);
int val2id(char *valist, int num, char *delm) {
  char *id;
  int i;
  id = StrDup(valist);
  if (!val_exist(id, itos(num), delm))
    return num;
  else
    return 0;
}


x86 assembly (clang, -O0):
<val2id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <StrDup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <itos@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
call   1030 <val_exist@plt>
cmp    $0x0,%eax
jne    1183 <val2id+0x53>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118a <val2id+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<val2id>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
call   1040 <StrDup@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1050 <itos@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
call   1030 <val_exist@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmove  %ebp,%ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @val2id(i8* %0, i32 %1, i8* %2) {
%4 = tail call i8* @StrDup(i8* %0)
%5 = tail call i32 @itos(i32 %1)
%6 = tail call i32 @val_exist(i8* %4, i32 %5, i8* %2)
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 %1, i32 0
ret i32 %8
}
/* Type definitions */
struct spwd {
  int dummy;
};

/* Variables and functions */
int __sgetspent_r(char const *, struct spwd *, char *, size_t);
int sgetspent_r(const char *string, struct spwd *spwd, char *buff,
                size_t buflen, struct spwd **crap) {
  return (__sgetspent_r(string, spwd, buff, buflen));
}


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

x86 assembly (clang, -O2):
<sgetspent_r>:
jmp    1030 <__sgetspent_r@plt>

LLVM IR (-O0):
%struct.spwd = type { i32 }
define i32 @sgetspent_r(i8* %0, %struct.spwd* %1, i8* %2, i64 %3, %struct.spwd** %4) {
%6 = alloca i8*
%7 = alloca %struct.spwd*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca %struct.spwd**
store i8* %0, i8** %6
store %struct.spwd* %1, %struct.spwd** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store %struct.spwd** %4, %struct.spwd*** %10
%11 = load i8*, i8** %6
%12 = load %struct.spwd*, %struct.spwd** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = call i32 @__sgetspent_r(i8* %11, %struct.spwd* %12, i8* %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.spwd = type { i32 }
define i32 @sgetspent_r(i8* %0, %struct.spwd* %1, i8* %2, i64 %3, %struct.spwd** nocapture readnone %4) {
%6 = tail call i32 @__sgetspent_r(i8* %0, %struct.spwd* %1, i8* %2, i64 %3)
ret i32 %6
}
int init() {
  BCLMarkFunc(__PRETTY_FUNCTION__, __FUNCTION__);
  initRaspberryConnections();
  return 0;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1040 <BCLMarkFunc@plt>
mov    $0x0,%al
call   1030 <initRaspberryConnections@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1040 <BCLMarkFunc@plt>
xor    %eax,%eax
call   1030 <initRaspberryConnections@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__PRETTY_FUNCTION__.init = [11 x i8] c"int init()\00"
@__FUNCTION__.init = [5 x i8] c"init\00"
define i32 @init() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @BCLMarkFunc to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__PRETTY_FUNCTION__.init, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.init, i64 0, i64 0))
%2 = call i32 (...) @initRaspberryConnections()
ret i32 0
}

LLVM IR (-O2):
@__PRETTY_FUNCTION__.init = [11 x i8] c"int init()\00"
@__FUNCTION__.init = [5 x i8] c"init\00"
define i32 @init() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @BCLMarkFunc to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__PRETTY_FUNCTION__.init, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.init, i64 0, i64 0))
%2 = tail call i32 (...) @initRaspberryConnections()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cmd_help(int /*<<< orphan*/ *);
void cmd_help_help(void) { cmd_help(NULL); }


x86 assembly (clang, -O0):
<cmd_help_help>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <cmd_help@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cmd_help_help() {
%1 = call i32 @cmd_help(i32* null)
ret void
}

LLVM IR (-O2):
define void @cmd_help_help() {
%1 = tail call i32 @cmd_help(i32* null)
ret void
}
/* Variables and functions */
scalar_t__ posix_memalign(void **, size_t, size_t);
void *align_malloc(size_t size, size_t alignment) {
  void *ptr = NULL;
  if (alignment < sizeof(void *)) {
    alignment = sizeof(void *);
  }
  if (0 == posix_memalign(&ptr, alignment, size))
    return ptr;
  return NULL;
}


x86 assembly (clang, -O0):
<align_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x8,-0x18(%rbp)
jae    113b <align_malloc+0x2b>
movq   $0x8,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
call   1030 <posix_memalign@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1167 <align_malloc+0x57>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <align_malloc+0x5f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_malloc>:
push   %rax
mov    %rdi,%rdx
movq   $0x0,(%rsp)
cmp    $0x9,%rsi
mov    $0x8,%eax
cmovb  %rax,%rsi
mov    %rsp,%rdi
call   1030 <posix_memalign@plt>
test   %rax,%rax
jne    113c <align_malloc+0x2c>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @align_malloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = icmp ugt i64 %1, 8
%6 = select i1 %5, i64 %1, i64 8
%7 = call i64 @posix_memalign(i8** %3, i64 %6, i64 %0)
%8 = icmp eq i64 %7, 0
%9 = load i8*, i8** %3
%10 = select i1 %8, i8* %9, i8* null
ret i8* %10
}
extern void vscp_ps_access_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @vscp_ps_access_init() {
ret void
}
/* Variables and functions */
scalar_t__ pow(double, double);
float powf(const float x, const float y) {
  return (float)(pow((double)x, (double)y));
}


x86 assembly (clang, -O0):
<powf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <pow@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powf>:
push   %rax
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @powf(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fpext float %1 to double
%5 = tail call i64 @pow(double %3, double %4)
%6 = sitofp i64 %5 to float
ret float %6
}
void compilerAssert(void) { return; }


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

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

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

LLVM IR (-O2):
define void @compilerAssert() {
ret void
}
void RTLockValidatorRecExclInit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecExclInit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;
typedef int /*<<< orphan*/ char32_t;

/* Variables and functions */
size_t wcrtomb(char *, int /*<<< orphan*/, int /*<<< orphan*/ *);
size_t c32rtomb(char *restrict s, char32_t c32, mbstate_t *restrict ps) {
  return wcrtomb(s, c32, ps);
}


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

x86 assembly (clang, -O2):
<c32rtomb>:
jmp    1030 <wcrtomb@plt>

LLVM IR (-O0):
define i64 @c32rtomb(i8* noalias %0, i32 %1, i32* noalias %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 i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i64 @wcrtomb(i8* %7, i32 %8, i32* %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @c32rtomb(i8* noalias %0, i32 %1, i32* noalias %2) {
%4 = tail call i64 @wcrtomb(i8* %0, i32 %1, i32* %2)
ret i64 %4
}
void free_dynamic_vector_matrix(m, nrl, nrh, ncl,
                                nch) struct dynamic_vector ***m;
long nch, ncl, nrh, nrl;
{
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_dynamic_vector_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dynamic_vector_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.dynamic_vector = type opaque
define void @free_dynamic_vector_matrix(%struct.dynamic_vector*** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca %struct.dynamic_vector***
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store %struct.dynamic_vector*** %0, %struct.dynamic_vector**** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load %struct.dynamic_vector***, %struct.dynamic_vector**** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %11, i64 %12
%14 = load %struct.dynamic_vector**, %struct.dynamic_vector*** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %14, i64 %15
%17 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %16, i64 -1
%18 = bitcast %struct.dynamic_vector** %17 to i8*
%19 = load %struct.dynamic_vector***, %struct.dynamic_vector**** %6
%20 = load i64, i64* %7
%21 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %19, i64 %20
%22 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %21, i64 -1
%23 = bitcast %struct.dynamic_vector*** %22 to i8*
ret void
}

LLVM IR (-O2):
%struct.dynamic_vector = type opaque
define void @free_dynamic_vector_matrix(%struct.dynamic_vector*** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %0, i64 %1
%7 = load %struct.dynamic_vector**, %struct.dynamic_vector*** %6
%8 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %7, i64 %3
%9 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %8, i64 -1
%10 = bitcast %struct.dynamic_vector** %9 to i8*
tail call void @free(i8* %10)
%11 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %6, i64 -1
%12 = bitcast %struct.dynamic_vector*** %11 to i8*
tail call void @free(i8* %12)
ret void
}
int fun317() { return 317; }


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

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

LLVM IR (-O0):
define i32 @fun317() {
ret i32 317
}

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

/* Variables and functions */
uint32_t sb_hash_lang(uint32_t h, uint32_t lang) {
  h ^= (h << 5) + lang + (h >> 2);
  return h;
}


x86 assembly (clang, -O0):
<sb_hash_lang>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
add    %ecx,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_hash_lang>:
mov    %edi,%ecx
shl    $0x5,%ecx
add    %esi,%ecx
mov    %edi,%eax
sar    $0x2,%eax
add    %ecx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @sb_hash_lang(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 = shl i32 %5, 5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = ashr i32 %9, 2
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %3
%13 = xor i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @sb_hash_lang(i32 %0, i32 %1) {
%3 = shl i32 %0, 5
%4 = add nsw i32 %3, %1
%5 = ashr i32 %0, 2
%6 = add nsw i32 %4, %5
%7 = xor i32 %6, %0
ret i32 %7
}
void ssh_glue_randomize(void) {}


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

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

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

LLVM IR (-O2):
define void @ssh_glue_randomize() {
ret void
}
long long int llabs(i)
long long int i;
{ return i < 0 ? -i : i; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <llabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *page) {
  return 0;
}


x86 assembly (clang, -O0):
<f2fs_init_acl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.page = type opaque
define i32 @f2fs_init_acl(%struct.inode* %0, %struct.inode* %1, %struct.page* %2) {
%4 = alloca %struct.inode*
%5 = alloca %struct.inode*
%6 = alloca %struct.page*
store %struct.inode* %0, %struct.inode** %4
store %struct.inode* %1, %struct.inode** %5
store %struct.page* %2, %struct.page** %6
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.page = type opaque
define i32 @f2fs_init_acl(%struct.inode* nocapture readnone %0, %struct.inode* nocapture readnone %1, %struct.page* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgstoriw(void) { ngen("%s\t%%eax,(%%edx)", "movl", 0); }


x86 assembly (clang, -O0):
<cgstoriw>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstoriw>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s\09%%eax,(%%edx)\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgstoriw() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s\09%%eax,(%%edx)\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgstoriw() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
void swapint(unsigned int *l) {}


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

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

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

LLVM IR (-O2):
define void @swapint(i32* nocapture %0) {
ret void
}
int test_imm_4Dint64_highword_reg(long long val) {
  return ((val >> 32) & (0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Dint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x4d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Dint64_highword_reg>:
movabs $0x4d00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Dint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 77
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_4Dint64_highword_reg(i64 %0) {
%2 = and i64 %0, 330712481792
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void advanceCursor(char **pLine, int amount) {
  for (; amount > 0; amount--) {
    (*pLine)++;
  }
}


x86 assembly (clang, -O0):
<advanceCursor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1131 <advanceCursor+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <advanceCursor+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<advanceCursor>:
test   %esi,%esi
jle    1114 <advanceCursor+0x14>
mov    (%rdi),%rax
add    $0xffffffff,%esi
add    %rsi,%rax
add    $0x1,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @advanceCursor(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i8*, i8** %0
%6 = add nsw i32 %1, -1
%7 = zext i32 %6 to i64
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr i8, i8* %5, i64 %8
store i8* %9, i8** %0
br label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
size_t slen(char *s) {
  size_t i;
  for (i = 0; *s; i++, s++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<slen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <slen+0x3f>
jmp    1122 <slen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <slen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slen>:
cmpb   $0x0,(%rdi)
je     111f <slen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <slen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @slen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add i64 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %7, %4 ]
ret i64 %12
}
/* Variables and functions */
scalar_t__ is_attr_val(char const);
char *__skip_attr_val(const char *s) {
  while (is_attr_val(*s))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<__skip_attr_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_attr_val@plt>
cmp    $0x0,%rax
je     1143 <__skip_attr_val+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <__skip_attr_val+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__skip_attr_val>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <is_attr_val@plt>
test   %rax,%rax
jne    1120 <__skip_attr_val+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @__skip_attr_val(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @is_attr_val(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
unsigned long long __real___umoddi3(unsigned long long, unsigned long long);
unsigned long long __wrap___umoddi3(unsigned long long a,
                                    unsigned long long b) {
  return __real___umoddi3(a, b);
}


x86 assembly (clang, -O0):
<__wrap___umoddi3>:
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 <__real___umoddi3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap___umoddi3>:
jmp    1030 <__real___umoddi3@plt>

LLVM IR (-O0):
define i64 @__wrap___umoddi3(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 i64 @__real___umoddi3(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__wrap___umoddi3(i64 %0, i64 %1) {
%3 = tail call i64 @__real___umoddi3(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unindent() { printf(".in 0\n"); }


x86 assembly (clang, -O0):
<unindent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [6 x i8] c".in 0\00"
define i32 @unindent() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef long time_t;

/* Variables and functions */
int time(int /*<<< orphan*/ *);
void delayFunction(int delayTime) {
  time_t now;
  now = time(0);
  time_t future = time(NULL) + delayTime;
  long futureInt = future;
  while (now < futureInt) {
    now = time(0);
  }
}


x86 assembly (clang, -O0):
<delayFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
cltq
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
add    -0x4(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1166 <delayFunction+0x56>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
cltq
mov    %rax,-0x10(%rbp)
jmp    1144 <delayFunction+0x34>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayFunction>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ebx
add    %r14d,%ebx
cmp    %ebx,%ebp
jge    113b <delayFunction+0x2b>
xor    %edi,%edi
call   1030 <time@plt>
cmp    %ebx,%eax
jl     1130 <delayFunction+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @delayFunction(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @time(i32* null)
%4 = add nsw i32 %3, %0
%5 = icmp slt i32 %2, %4
br i1 %5, label %6, label %9
6: ; preds = %1, %6
%7 = tail call i32 @time(i32* null)
%8 = icmp slt i32 %7, %4
br i1 %8, label %6, label %9
9: ; preds = %6, %1
ret void
}
void pttsetdcd(struct pttio *state, int dcd) {}


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

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

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

LLVM IR (-O2):
%struct.pttio = type opaque
define void @pttsetdcd(%struct.pttio* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ die_(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
char *strdup(char const *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
char *xstrdup(const char *str) {
  assert(str);
  if (!(str = strdup(str)))
    die_("("
         "util.c"
         ":"
         "56"
         "): "
         "Insufficient memory for string allocation"
         ": %s\n",
         strerror(errno));
  return (char *)str;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1188 <xstrdup+0x48>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%esi
lea    0xe7d(%rip),%rdi
call   1040 <die_@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1175 <xstrdup+0x35>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
call   1040 <die_@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"(util.c:56): Insufficient memory for string allocation: %s\0A\00"
@errno = global i32 0
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @die_(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [60 x i8] c"(util.c:56): Insufficient memory for string allocation: %s\0A\00"
@errno = global i32 0
define noalias i8* @xstrdup(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i8* @strdup(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @die_(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %1
ret i8* %3
}
/* Type definitions */
struct crypt_options {
  int dummy;
};

/* Variables and functions */
int crypt_create_and_update_device(struct crypt_options *, int);
int crypt_update_device(struct crypt_options *options) {
  return crypt_create_and_update_device(options, 1);
}


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

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

LLVM IR (-O0):
%struct.crypt_options = type { i32 }
define i32 @crypt_update_device(%struct.crypt_options* %0) {
%2 = alloca %struct.crypt_options*
store %struct.crypt_options* %0, %struct.crypt_options** %2
%3 = load %struct.crypt_options*, %struct.crypt_options** %2
%4 = call i32 @crypt_create_and_update_device(%struct.crypt_options* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.crypt_options = type { i32 }
define i32 @crypt_update_device(%struct.crypt_options* %0) {
%2 = tail call i32 @crypt_create_and_update_device(%struct.crypt_options* %0, i32 1)
ret i32 %2
}
/* Type definitions */
struct irk_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct irk_entry *);
void irk_entry_free(void *data) {
  struct irk_entry *irk = data;
  free(irk);
}


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

x86 assembly (clang, -O2):
<irk_entry_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.irk_entry = type { i32 }
define void @irk_entry_free(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.irk_entry*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.irk_entry*
store %struct.irk_entry* %5, %struct.irk_entry** %3
%6 = load %struct.irk_entry*, %struct.irk_entry** %3
%7 = call i32 @free(%struct.irk_entry* %6)
ret void
}

LLVM IR (-O2):
%struct.irk_entry = type { i32 }
define void @irk_entry_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.irk_entry*
%3 = tail call i32 @free(%struct.irk_entry* %2)
ret void
}
/* Variables and functions */
int syscall2(int, unsigned int);
int chdir(const char *path) { return syscall2(12, (unsigned int)path); }


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

x86 assembly (clang, -O2):
<chdir>:
mov    %rdi,%rsi
mov    $0xc,%edi
jmp    1030 <syscall2@plt>

LLVM IR (-O0):
define i32 @chdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @syscall2(i32 12, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @chdir(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @syscall2(i32 12, i32 %3)
ret i32 %4
}
signed long signedlong_ignoring_unsignedshortint(signed long x,
                                                 unsigned short int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @signedlong_ignoring_unsignedshortint(i64 returned %0, i16 zeroext %1) {
ret i64 %0
}
float conv_batt(int node_no, int raw_batt) {
  return ((raw_batt * 16.0) * 2.5 / 4096) / (3.3 / (3.3 + 10));
}


x86 assembly (clang, -O0):
<conv_batt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xf01(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeed(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_batt>:
cvtsi2sd %esi,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @conv_batt(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 = sitofp i32 %5 to double
%7 = fmul double %6, 1.600000e+01
%8 = fmul double %7, 2.500000e+00
%9 = fdiv double %8, 4.096000e+03
%10 = fdiv double %9, 0x3FCFC267F099FC26
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @conv_batt(i32 %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fmul double %3, 1.600000e+01
%5 = fmul double %4, 2.500000e+00
%6 = fmul double %5, 0x3F30000000000000
%7 = fdiv double %6, 0x3FCFC267F099FC26
%8 = fptrunc double %7 to float
ret float %8
}