xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};
typedef int int64_t;

/* Variables and functions */
int64_t convert_to_microseconds(struct timespec *tms) {
  int64_t micros = tms->tv_sec * 1000000;
  micros += tms->tv_nsec / 1000;
  if (tms->tv_nsec % 1000 >= 500) {
    ++micros;
  }
  return micros;
}


x86 assembly (clang, -O0):
<convert_to_microseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cmp    $0x1f4,%edx
jl     114e <convert_to_microseconds+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_microseconds>:
imul   $0xf4240,(%rdi),%ecx
movslq 0x4(%rdi),%rdx
imul   $0x10624dd3,%rdx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x26,%rax
add    %esi,%eax
add    %eax,%ecx
imul   $0x3e8,%eax,%eax
sub    %eax,%edx
xor    %eax,%eax
cmp    $0x1f4,%edx
setge  %al
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @convert_to_microseconds(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca i32
store %struct.timespec* %0, %struct.timespec** %2
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
store i32 %7, i32* %3
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load %struct.timespec*, %struct.timespec** %2
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = srem i32 %16, 1000
%18 = icmp sge i32 %17, 500
br i1 %18, label %19, label %22
19: ; preds = %1
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %22
22: ; preds = %19, %1
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @convert_to_microseconds(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = add nsw i32 %7, %4
%9 = srem i32 %6, 1000
%10 = icmp sgt i32 %9, 499
%11 = zext i1 %10 to i32
%12 = add nsw i32 %8, %11
ret i32 %12
}
/* Variables and functions */
int INT_MAX;
int stbi__addsizes_valid(int a, int b) {
  if (b < 0)
    return 0;
  return a <= INT_MAX - b;
}


x86 assembly (clang, -O0):
<stbi__addsizes_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1120 <stbi__addsizes_valid+0x20>
movl   $0x0,-0x4(%rbp)
jmp    113c <stbi__addsizes_valid+0x3c>
mov    -0x8(%rbp),%eax
mov    0x2ebe(%rip),%rcx
mov    (%rcx),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__addsizes_valid>:
test   %esi,%esi
setns  %al
mov    0x2edc(%rip),%rcx
mov    (%rcx),%ecx
sub    %esi,%ecx
cmp    %edi,%ecx
setge  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @stbi__addsizes_valid(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* %5
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %16
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* @INT_MAX
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
%14 = icmp sle i32 %10, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @stbi__addsizes_valid(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
%4 = load i32, i32* @INT_MAX
%5 = sub nsw i32 %4, %1
%6 = icmp sge i32 %5, %0
%7 = select i1 %3, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *__crypt_r(char const *, char const *, void *);
char *crypt(const char *clear, const char *salt) {
  static char buf[128];
  return __crypt_r(clear, salt, (void *)buf);
}


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

x86 assembly (clang, -O2):
<crypt>:
lea    0x2f29(%rip),%rdx
jmp    1030 <__crypt_r@plt>

LLVM IR (-O0):
@crypt.buf = internal global [128 x i8] zeroinitializer
define i8* @crypt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @__crypt_r(i8* %5, i8* %6, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @crypt.buf, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@crypt.buf = internal global [128 x i8] zeroinitializer
define i8* @crypt(i8* %0, i8* %1) {
%3 = tail call i8* @__crypt_r(i8* %0, i8* %1, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @crypt.buf, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ networking_initialized(int /*<<< orphan*/, int);
int networking_cleanup() {
  if (!networking_initialized(0, 1)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<networking_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <networking_initialized@plt>
cmp    $0x0,%eax
jne    1139 <networking_cleanup+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1140 <networking_cleanup+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<networking_cleanup>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <networking_initialized@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @networking_cleanup() {
%1 = tail call i32 @networking_initialized(i32 0, i32 1)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ left_encoder_pin_config();
int /*<<< orphan*/ right_encoder_pin_config();
void encoder_pin_config(void) {
  left_encoder_pin_config();
  right_encoder_pin_config();
}


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

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

LLVM IR (-O0):
define void @encoder_pin_config() {
%1 = call i32 (...) @left_encoder_pin_config()
%2 = call i32 (...) @right_encoder_pin_config()
ret void
}

LLVM IR (-O2):
define void @encoder_pin_config() {
%1 = tail call i32 (...) @left_encoder_pin_config()
%2 = tail call i32 (...) @right_encoder_pin_config()
ret void
}
/* Variables and functions */
int hbidx_16(unsigned int);
int hbidx_32(unsigned int value) {
  int test = hbidx_16(value >> 16);
  if (test > 0)
    return test + 16;
  else
    return hbidx_16(value & 0xFFFF);
}


x86 assembly (clang, -O0):
<hbidx_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shr    $0x10,%edi
call   1030 <hbidx_16@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1141 <hbidx_32+0x31>
mov    -0xc(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <hbidx_32+0x42>
mov    -0x8(%rbp),%edi
and    $0xffff,%edi
call   1030 <hbidx_16@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hbidx_32>:
push   %rbx
mov    %edi,%ebx
shr    $0x10,%edi
call   1030 <hbidx_16@plt>
test   %eax,%eax
jle    1124 <hbidx_32+0x14>
add    $0x10,%eax
pop    %rbx
ret
movzwl %bx,%edi
pop    %rbx
jmp    1030 <hbidx_16@plt>

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

LLVM IR (-O2):
define i32 @hbidx_32(i32 %0) {
%2 = lshr i32 %0, 16
%3 = tail call i32 @hbidx_16(i32 %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nuw nsw i32 %3, 16
br label %10
7: ; preds = %1
%8 = and i32 %0, 65535
%9 = tail call i32 @hbidx_16(i32 %8)
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ libc_isdigit(char);
char libc_tolower(char);
char libc_from_hex(char ch) {
  return libc_isdigit(ch) ? ch - '0' : libc_tolower(ch) - 'a' + 10;
}


x86 assembly (clang, -O0):
<libc_from_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <libc_isdigit@plt>
cmp    $0x0,%rax
je     1150 <libc_from_hex+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <libc_from_hex+0x45>
movsbl -0x1(%rbp),%edi
call   1030 <libc_tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_from_hex>:
push   %rbx
mov    %edi,%ebx
call   1040 <libc_isdigit@plt>
test   %rax,%rax
je     1132 <libc_from_hex+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <libc_tolower@plt>
add    $0xa9,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @libc_from_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @libc_isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @libc_tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @libc_from_hex(i8 signext %0) {
%2 = tail call i64 @libc_isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %9
6: ; preds = %1
%7 = tail call signext i8 @libc_tolower(i8 signext %0)
%8 = add i8 %7, -87
br label %9
9: ; preds = %6, %4
%10 = phi i8 [ %5, %4 ], [ %8, %6 ]
ret i8 %10
}
double *add3(double *p, int x) { return p + x; }


x86 assembly (clang, -O0):
<add3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add3>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define double* @add3(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %5, i64 %7
ret double* %8
}

LLVM IR (-O2):
define double* @add3(double* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds double, double* %0, i64 %3
ret double* %4
}
/* Variables and functions */
int strlen(char *);
void strip_last_char(char *str) { *(str + (strlen(str) - 1)) = '\0'; }


x86 assembly (clang, -O0):
<strip_last_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_last_char>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @strip_last_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @strip_last_char(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
int getMax(int number) {
  while (number > 9) {
    number /= 10;
  }
  return number;
}


x86 assembly (clang, -O0):
<getMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    1124 <getMax+0x24>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1107 <getMax+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMax>:
cmp    $0xa,%edi
jl     1122 <getMax+0x22>
mov    $0xcccccccd,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
imul   %rcx,%rax
shr    $0x23,%rax
cmp    $0x63,%edi
mov    %eax,%edi
ja     1110 <getMax+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @getMax(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = udiv i32 %4, 10
%6 = icmp ugt i32 %4, 99
br i1 %6, label %3, label %7
7: ; preds = %3, %1
%8 = phi i32 [ %0, %1 ], [ %5, %3 ]
ret i32 %8
}
void avpriv_set_pts_info() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_set_pts_info() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ exit_steplib();
int /*<<< orphan*/ printf(char *);
void sighandler(int sig) {
  printf("\nshutting down motor and quitting.\n");
  exit_steplib();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <exit_steplib@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <exit_steplib@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0Ashutting down motor and quitting.\0A\00"
@EXIT_FAILURE = global i32 0
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @exit_steplib()
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [35 x i8] c"\0Ashutting down motor and quitting.\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @exit_steplib()
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
void numa_setlocal_memory(void *start, size_t size) {}


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

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

LLVM IR (-O0):
define void @numa_setlocal_memory(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @numa_setlocal_memory(i8* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int S_IRGRP;
int S_IROTH;
int S_IRWXU;
int S_IXGRP;
int S_IXOTH;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ stdout;
void CreaContenedor(char *nombre) {
  mkdir(nombre, (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH));
  fprintf(stdout, "Contenedor creado:\n %s \n", nombre);
  return;
}


x86 assembly (clang, -O0):
<CreaContenedor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e88(%rip),%rax
or     (%rax),%esi
mov    0x2e8f(%rip),%rax
or     (%rax),%esi
mov    0x2e6e(%rip),%rax
or     (%rax),%esi
mov    0x2e85(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreaContenedor>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    0x2e99(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9e(%rip),%rax
or     (%rax),%esi
mov    0x2e7d(%rip),%rax
or     (%rax),%esi
mov    %rdi,%rbx
mov    0x2e91(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@S_IRWXU = global i32 0
@S_IRGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
@stdout = global i32 0
@.str = [25 x i8] c"Contenedor creado:\0A %s \0A\00"
define void @CreaContenedor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRWXU
%5 = load i32, i32* @S_IRGRP
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IXGRP
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IROTH
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IXOTH
%12 = or i32 %10, %11
%13 = call i32 @mkdir(i8* %3, i32 %12)
%14 = load i32, i32* @stdout
%15 = load i8*, i8** %2
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@S_IRGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
@stdout = global i32 0
@.str = [25 x i8] c"Contenedor creado:\0A %s \0A\00"
define void @CreaContenedor(i8* %0) {
%2 = load i32, i32* @S_IRWXU
%3 = load i32, i32* @S_IRGRP
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IXGRP
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IROTH
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IXOTH
%10 = or i32 %8, %9
%11 = tail call i32 @mkdir(i8* %0, i32 %10)
%12 = load i32, i32* @stdout
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 2;
  while (i > 0) {
    printf("%d ", i);
    i *= 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    %ebx,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 2
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 2, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = shl nsw i32 %2, 1
br label %1
}
void nseel_asm_assign_fromfp_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_assign_fromfp_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_units_fromfile(int /*<<< orphan*/);
void fgmvwrite_units_fromfile_(char filnam[]) {
  gmvwrite_units_fromfile(fortchartoc(filnam));
}


x86 assembly (clang, -O0):
<fgmvwrite_units_fromfile_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fortchartoc@plt>
mov    %eax,%edi
call   1040 <gmvwrite_units_fromfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_units_fromfile_>:
push   %rax
call   1030 <fortchartoc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <gmvwrite_units_fromfile@plt>

LLVM IR (-O0):
define void @fgmvwrite_units_fromfile_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fortchartoc(i8* %3)
%5 = call i32 @gmvwrite_units_fromfile(i32 %4)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_units_fromfile_(i8* %0) {
%2 = tail call i32 @fortchartoc(i8* %0)
%3 = tail call i32 @gmvwrite_units_fromfile(i32 %2)
ret void
}
int test_imm_C4uint32_mem(unsigned int *val) {
  return ((*val) & (0xC4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C4uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xc4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C4uint32_mem>:
testb  $0xc4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C4uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 196
%6 = icmp ne i32 %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_C4uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 196
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void integrator_sei_synchronize(void) {}


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

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

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

LLVM IR (-O2):
define void @integrator_sei_synchronize() {
ret void
}
/* Variables and functions */
long strspn(char const *, char const *);
int portable(const char *path) {
  static const char charset[] = "abcdefghijklmnopqrstuvwxyz"
                                "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                "0123456789._-";
  long s;
  s = strspn(path, charset);
  if (path[s] != '\0')
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<portable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strspn@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <portable+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1158 <portable+0x48>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strspn@plt>
xor    %ecx,%ecx
cmpb   $0x0,(%rbx,%rax,1)
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@portable.charset = internal constant [66 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-\00"
define i32 @portable(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strspn(i8* %5, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @portable.charset, i64 0, i64 0))
store i64 %6, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 0, i32* %2
br label %15
14: ; preds = %1
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@portable.charset = internal constant [66 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-\00"
define i32 @portable(i8* nocapture %0) {
%2 = tail call i64 @strspn(i8* %0, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @portable.charset, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ testDouble();
int main() {
  testDouble();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testDouble@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testDouble@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testDouble()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testDouble()
ret i32 0
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
scalar_t__ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, struct winsize *);
__attribute__((pure)) int getLineWidth(void) {
  struct winsize w;
  if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w)) {
    return 80;
  }
  return w.ws_col;
}


x86 assembly (clang, -O0):
<getLineWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1149 <getLineWidth+0x39>
movl   $0x50,-0x4(%rbp)
jmp    114f <getLineWidth+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLineWidth>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    %rax,%rcx
mov    $0x50,%eax
test   %rcx,%rcx
jne    113b <getLineWidth+0x2b>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @getLineWidth() {
%1 = alloca i32
%2 = alloca %struct.winsize
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i64 @ioctl(i32 %3, i32 %4, %struct.winsize* %2)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 80, i32* %1
br label %11
8: ; preds = %0
%9 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @getLineWidth() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i64 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = select i1 %6, i32 %8, i32 80
ret i32 %9
}
int truth_table(char cache, char *strhld) {
  int count = 0;
  while (strhld[count] != '\0')
    if (cache == strhld[count++])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<truth_table>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115d <truth_table+0x5d>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1158 <truth_table+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1164 <truth_table+0x64>
jmp    1115 <truth_table+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<truth_table>:
movzbl (%rsi),%eax
test   %al,%al
je     1116 <truth_table+0x16>
add    $0x1,%rsi
cmp    %dil,%al
jne    1100 <truth_table>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @truth_table(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i64 [ %9, %8 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = add nuw i64 %4, 1
%10 = icmp eq i8 %6, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %8
%12 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ delay_us(int);
int /*<<< orphan*/ led(int);
int /*<<< orphan*/ ps2sim_send(unsigned char);
void keyup(unsigned char keycode) {
  ps2sim_send(0xF0);
  delay_us(200);
  ps2sim_send(keycode);
  delay_us(300);
  led(0x01);
}


x86 assembly (clang, -O0):
<keyup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xf0,%edi
call   1040 <ps2sim_send@plt>
mov    $0xc8,%edi
call   1050 <delay_us@plt>
movzbl -0x1(%rbp),%edi
call   1040 <ps2sim_send@plt>
mov    $0x12c,%edi
call   1050 <delay_us@plt>
mov    $0x1,%edi
call   1030 <led@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyup>:
push   %rbx
mov    %edi,%ebx
mov    $0xf0,%edi
call   1040 <ps2sim_send@plt>
mov    $0xc8,%edi
call   1050 <delay_us@plt>
mov    %ebx,%edi
call   1040 <ps2sim_send@plt>
mov    $0x12c,%edi
call   1050 <delay_us@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1030 <led@plt>

LLVM IR (-O0):
define void @keyup(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @ps2sim_send(i8 zeroext -16)
%4 = call i32 @delay_us(i32 200)
%5 = load i8, i8* %2
%6 = call i32 @ps2sim_send(i8 zeroext %5)
%7 = call i32 @delay_us(i32 300)
%8 = call i32 @led(i32 1)
ret void
}

LLVM IR (-O2):
define void @keyup(i8 zeroext %0) {
%2 = tail call i32 @ps2sim_send(i8 zeroext -16)
%3 = tail call i32 @delay_us(i32 200)
%4 = tail call i32 @ps2sim_send(i8 zeroext %0)
%5 = tail call i32 @delay_us(i32 300)
%6 = tail call i32 @led(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void writes(const char *s) { write(2, s, strlen(s)); }


x86 assembly (clang, -O0):
<writes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writes>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @writes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @writes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
scalar_t__ ioctl(int, int /*<<< orphan*/, char *);
int zget_readable_count(int fd) {
  int count;
  return (ioctl(fd, FIONREAD, (char *)&count) < 0 ? -1 : count);
}


x86 assembly (clang, -O0):
<zget_readable_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1147 <zget_readable_count+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <zget_readable_count+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zget_readable_count>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1135 <zget_readable_count+0x25>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i32 @zget_readable_count(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONREAD
%6 = bitcast i32* %3 to i8*
%7 = call i64 @ioctl(i32 %4, i32 %5, i8* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ -1, %9 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @zget_readable_count(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @FIONREAD
%5 = call i64 @ioctl(i32 %0, i32 %4, i8* %3)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
unsigned char receive_byte_uart() {}


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

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

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

LLVM IR (-O2):
define zeroext i8 @receive_byte_uart() {
ret i8 undef
}
void g_type_plugin_unuse() {}


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

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

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

LLVM IR (-O2):
define void @g_type_plugin_unuse() {
ret void
}
void motor_tick(void) {}


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

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

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

LLVM IR (-O2):
define void @motor_tick() {
ret void
}
float ceilf(float x) { return __builtin_ceilf(x); }


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

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

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

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = tail call float @llvm.ceil.f32(float %0)
ret float %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void DAC_Out(uint32_t data) { (*((volatile uint32_t *)0x400053FC)) = data * 4; }


x86 assembly (clang, -O0):
<DAC_Out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
mov    $0x400053fc,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DAC_Out>:
shl    $0x2,%edi
mov    %edi,0x400053fc
ret

LLVM IR (-O0):
define void @DAC_Out(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 4
store volatile i32 %4, i32* inttoptr (i64 1073763324 to i32*)
ret void
}

LLVM IR (-O2):
define void @DAC_Out(i32 %0) {
%2 = shl nsw i32 %0, 2
store volatile i32 %2, i32* inttoptr (i64 1073763324 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeFile(char *file) { free(file); }


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

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

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

LLVM IR (-O2):
define void @FreeFile(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void initialize_hash_function(const unsigned char *pub_seed,
                              const unsigned char *sk_seed) {
  (void)pub_seed;
  (void)sk_seed;
}


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

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

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

LLVM IR (-O2):
define void @initialize_hash_function(i8* nocapture %0, i8* nocapture %1) {
ret void
}
__attribute__((always_)) void destroy_work_on_stack(struct work_struct *work) {}


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

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

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

LLVM IR (-O2):
%struct.work_struct = type opaque
define void @destroy_work_on_stack(%struct.work_struct* nocapture %0) {
ret void
}
void stack_array_access(unsigned int i) {
  char a[10];
  a[i] = 0;
}


x86 assembly (clang, -O0):
<stack_array_access>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movb   $0x0,-0xe(%rbp,%rax,1)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @stack_array_access(i32 %0) {
ret void
}
/* Variables and functions */
double M_PI;
double sin(double);
double dp_dx(double L, double a_px, double p_x, double x) {
  return -M_PI * a_px * p_x * sin(M_PI * a_px * x / L) / L;
}


x86 assembly (clang, -O0):
<dp_dx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e84(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dp_dx>:
sub    $0x28,%rsp
movapd %xmm0,%xmm4
movsd  %xmm0,0x8(%rsp)
mov    0x2ec3(%rip),%rax
movsd  (%rax),%xmm0
movapd 0xecf(%rip),%xmm5
xorpd  %xmm0,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm2,%xmm5
movapd %xmm5,0x10(%rsp)
mulsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm0
divsd  %xmm4,%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @dp_dx(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* @M_PI
%10 = fneg double %9
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = load double, double* @M_PI
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = load double, double* %5
%21 = fdiv double %19, %20
%22 = call double @sin(double %21)
%23 = fmul double %14, %22
%24 = load double, double* %5
%25 = fdiv double %23, %24
ret double %25
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @dp_dx(double %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fneg double %5
%7 = fmul double %6, %1
%8 = fmul double %7, %2
%9 = fmul double %5, %1
%10 = fmul double %9, %3
%11 = fdiv double %10, %0
%12 = tail call double @sin(double %11)
%13 = fmul double %12, %8
%14 = fdiv double %13, %0
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world!\n");
  printf("Hello world again!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [20 x i8] c"Hello world again!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
@str.2 = [19 x i8] c"Hello world again!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int security_sb_check_sb(struct vfsmount *mnt, struct nameidata *nd) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.vfsmount = type opaque
%struct.nameidata = type opaque
define i32 @security_sb_check_sb(%struct.vfsmount* nocapture readnone %0, %struct.nameidata* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int str_length(char *str) {
  if (str == NULL) {
    return -1;
  }
  int i;
  for (i = 0; str[i] != '\0'; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<str_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <str_length+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <str_length+0x54>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114e <str_length+0x4e>
jmp    1140 <str_length+0x40>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <str_length+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_length>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111c <str_length+0x1c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ -1, %1 ], [ %10, %9 ]
ret i32 %12
}