xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ ulong;
struct timeval {
  long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
ulong time_usec() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return (ulong)(now.tv_sec * 1000000L + now.tv_usec);
}


x86 assembly (clang, -O0):
<time_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_usec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%eax
add    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @time_usec() {
%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 i64, i64* %3
%5 = mul nsw i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @time_usec() {
%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 i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}
void vec3_project(const float a[3], const float b[3], float out[3]) {
  vec3_mul(b, vec3_dot(a, b) / vec3_dot(b, b), out);
}


x86 assembly (clang, -O0):
<vec3_project>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <vec3_dot@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <vec3_dot@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <vec3_mul@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_project>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <vec3_dot@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <vec3_dot@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <vec3_mul@plt>

LLVM IR (-O0):
define void @vec3_project(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = load float*, float** %4
%9 = load float*, float** %5
%10 = call i32 (float*, float*, ...) bitcast (i32 (...)* @vec3_dot to i32 (float*, float*, ...)*)(float* %8, float* %9)
%11 = load float*, float** %5
%12 = load float*, float** %5
%13 = call i32 (float*, float*, ...) bitcast (i32 (...)* @vec3_dot to i32 (float*, float*, ...)*)(float* %11, float* %12)
%14 = sdiv i32 %10, %13
%15 = load float*, float** %6
%16 = call i32 (float*, i32, float*, ...) bitcast (i32 (...)* @vec3_mul to i32 (float*, i32, float*, ...)*)(float* %7, i32 %14, float* %15)
ret void
}

LLVM IR (-O2):
define void @vec3_project(float* %0, float* %1, float* %2) {
%4 = tail call i32 (float*, float*, ...) bitcast (i32 (...)* @vec3_dot to i32 (float*, float*, ...)*)(float* %0, float* %1)
%5 = tail call i32 (float*, float*, ...) bitcast (i32 (...)* @vec3_dot to i32 (float*, float*, ...)*)(float* %1, float* %1)
%6 = sdiv i32 %4, %5
%7 = tail call i32 (float*, i32, float*, ...) bitcast (i32 (...)* @vec3_mul to i32 (float*, i32, float*, ...)*)(float* %1, i32 %6, float* %2)
ret void
}
void gtk_text_iter_set_visible_line_index() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_set_visible_line_index() {
ret void
}
/* Variables and functions */
short read_ZIGBEE_short(int);
int /*<<< orphan*/ write_ZIGBEE_short(int, int);
void set_RSSI_mode(short int RSSI_mode) {
  short int temp = 0;
  switch (RSSI_mode) {
  case 1: {
    temp = read_ZIGBEE_short(0x3E);
    temp = temp | 0x80;
    write_ZIGBEE_short(0x3E, temp);
  } break;
  case 2:
    write_ZIGBEE_short(0x3E, 0x40);
    break;
  }
}


x86 assembly (clang, -O0):
<set_RSSI_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     115b <set_RSSI_mode+0x3b>
jmp    114a <set_RSSI_mode+0x2a>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1189 <set_RSSI_mode+0x69>
jmp    1198 <set_RSSI_mode+0x78>
mov    $0x3e,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
or     $0x80,%eax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%esi
mov    $0x3e,%edi
call   1040 <write_ZIGBEE_short@plt>
jmp    1198 <set_RSSI_mode+0x78>
mov    $0x3e,%edi
mov    $0x40,%esi
call   1040 <write_ZIGBEE_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_RSSI_mode>:
cmp    $0x2,%edi
je     114b <set_RSSI_mode+0x2b>
cmp    $0x1,%edi
jne    115a <set_RSSI_mode+0x3a>
push   %rax
mov    $0x3e,%edi
call   1030 <read_ZIGBEE_short@plt>
or     $0x80,%eax
movswl %ax,%esi
add    $0x8,%rsp
mov    $0x3e,%edi
jmp    1040 <write_ZIGBEE_short@plt>
mov    $0x40,%esi
mov    $0x3e,%edi
jmp    1040 <write_ZIGBEE_short@plt>
ret

LLVM IR (-O0):
define void @set_RSSI_mode(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
store i16 0, i16* %3
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
switch i32 %5, label %17 [
i32 1, label %6
i32 2, label %15
]
6: ; preds = %1
%7 = call signext i16 @read_ZIGBEE_short(i32 62)
store i16 %7, i16* %3
%8 = load i16, i16* %3
%9 = sext i16 %8 to i32
%10 = or i32 %9, 128
%11 = trunc i32 %10 to i16
store i16 %11, i16* %3
%12 = load i16, i16* %3
%13 = sext i16 %12 to i32
%14 = call i32 @write_ZIGBEE_short(i32 62, i32 %13)
br label %17
15: ; preds = %1
%16 = call i32 @write_ZIGBEE_short(i32 62, i32 64)
br label %17
17: ; preds = %1, %15, %6
ret void
}

LLVM IR (-O2):
define void @set_RSSI_mode(i16 signext %0) {
%2 = sext i16 %0 to i32
switch i32 %2, label %10 [
i32 1, label %3
i32 2, label %7
]
3: ; preds = %1
%4 = tail call signext i16 @read_ZIGBEE_short(i32 62)
%5 = or i16 %4, 128
%6 = sext i16 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 64, %1 ]
%9 = tail call i32 @write_ZIGBEE_short(i32 62, i32 %8)
br label %10
10: ; preds = %7, %1
ret void
}
int IsNewline(int enc __attribute__((unused)), int c) {
  if (c == 0x0a)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsNewline>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1120 <IsNewline+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1127 <IsNewline+0x27>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsNewline>:
xor    %eax,%eax
cmp    $0xa,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @IsNewline(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 eq i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %10
9: ; preds = %2
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @IsNewline(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void term_cbne() { system("stty cbreak -echo"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"stty cbreak -echo\00"
define void @term_cbne() {
%1 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"stty cbreak -echo\00"
define void @term_cbne() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
void exynos_mif_notify_power_status(const char *pd_name, unsigned int turn_on) {
}


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

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

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

LLVM IR (-O2):
define void @exynos_mif_notify_power_status(i8* nocapture %0, i32 %1) {
ret void
}
void EVP_EncryptInit_ex(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_EncryptInit_ex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
int open(const char *buf, int flags, int mode) {
  (void)buf;
  (void)flags;
  (void)mode;
  errno = EIO;
  return (-1);
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EIO = global i32 0
@errno = global i32 0
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* @EIO
store i32 %10, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EIO = global i32 0
@errno = global i32 0
define i32 @open(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EIO
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
__attribute__((weak)) extern void __aeabi_memcpy4(void *dest, void *src,
                                                  unsigned int n) {
  memcpy(dest, src, n);
}


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

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

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

LLVM IR (-O2):
define weak void @__aeabi_memcpy4(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int errno;
int getErrno() { return errno; }


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

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

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @getErrno() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Type definitions */
struct obstcp_client_ctx {
  int dummy;
};
struct iovec {
  scalar_t__ iov_len;
};

/* Variables and functions */
int __attribute__((visibility("default")))
obstcp_client_prefix(struct obstcp_client_ctx *ctx, struct iovec *prefix) {
  prefix->iov_len = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<obstcp_client_prefix>:
movq   $0x0,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.obstcp_client_ctx = type { i32 }
%struct.iovec = type { i64 }
define i32 @obstcp_client_prefix(%struct.obstcp_client_ctx* %0, %struct.iovec* %1) {
%3 = alloca %struct.obstcp_client_ctx*
%4 = alloca %struct.iovec*
store %struct.obstcp_client_ctx* %0, %struct.obstcp_client_ctx** %3
store %struct.iovec* %1, %struct.iovec** %4
%5 = load %struct.iovec*, %struct.iovec** %4
%6 = getelementptr inbounds %struct.iovec, %struct.iovec* %5, i32 0, i32 0
store i64 0, i64* %6
ret i32 0
}

LLVM IR (-O2):
%struct.obstcp_client_ctx = type { i32 }
%struct.iovec = type { i64 }
define i32 @obstcp_client_prefix(%struct.obstcp_client_ctx* nocapture readnone %0, %struct.iovec* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.iovec, %struct.iovec* %1, i64 0, i32 0
store i64 0, i64* %3
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(char);
int main(void) {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == ' ' || c == '\n' || c == '\t')
      putchar('\n');
    else
      putchar('*');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1184 <main+0x64>
cmpl   $0x20,-0x8(%rbp)
je     1166 <main+0x46>
cmpl   $0xa,-0x8(%rbp)
je     1166 <main+0x46>
cmpl   $0x9,-0x8(%rbp)
jne    1175 <main+0x55>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    117f <main+0x5f>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%rbx
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
movabs $0x100000600,%r14
jmp    1165 <main+0x45>
nopl   0x0(%rax)
mov    $0x2a,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1136 <main+0x16>
cmp    $0x20,%eax
ja     1150 <main+0x30>
mov    $0xa,%cl
mov    %eax,%eax
bt     %rax,%r14
jb     1152 <main+0x32>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %20, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %21
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 32
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 10
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 9
br i1 %15, label %16, label %18
16: ; preds = %13, %10, %7
%17 = call i32 @putchar(i8 signext 10)
br label %20
18: ; preds = %13
%19 = call i32 @putchar(i8 signext 42)
br label %20
20: ; preds = %18, %16
br label %3
21: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %7
%5 = phi i32 [ %10, %7 ], [ %1, %0 ]
switch i32 %5, label %6 [
i32 32, label %7
i32 10, label %7
i32 9, label %7
]
6: ; preds = %4
br label %7
7: ; preds = %4, %4, %4, %6
%8 = phi i8 [ 42, %6 ], [ 10, %4 ], [ 10, %4 ], [ 10, %4 ]
%9 = tail call i32 @putchar(i8 signext %8)
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int exp(double const);
double loggy_activate(const double x) { return 2. / (1. + exp(-x)) - 1; }


x86 assembly (clang, -O0):
<loggy_activate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loggy_activate>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
addsd  0xee7(%rip),%xmm1
movsd  0xee7(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xee3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @loggy_activate(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @exp(double %4)
%6 = sitofp i32 %5 to double
%7 = fadd double 1.000000e+00, %6
%8 = fdiv double 2.000000e+00, %7
%9 = fsub double %8, 1.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @loggy_activate(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = sitofp i32 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 2.000000e+00, %5
%7 = fadd double %6, -1.000000e+00
ret double %7
}
/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdin;
int main() {
  char buf[BUFSIZ * 2];
  setbuf(stdin, buf);
  printf("hello\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x18(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <setbuf@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
mov    %rsp,%rsi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <setbuf@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@stdin = global i32 0
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 0, i32* %1
%4 = load i32, i32* @BUFSIZ
%5 = mul nsw i32 %4, 2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i8, i64 %6
store i64 %6, i64* %3
%9 = load i32, i32* @stdin
%10 = call i32 @setbuf(i32 %9, i8* %8)
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
%12 = load i8*, i8** %2
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@stdin = global i32 0
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = load i32, i32* @BUFSIZ
%2 = shl nsw i32 %1, 1
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = load i32, i32* @stdin
%6 = call i32 @setbuf(i32 %5, i8* %4)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void YUY2ToUV422Row_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToUV422Row_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *ret = malloc(size);
  if (ret == NULL)
    fatal("safe_malloc: Out of memory");
  return ret;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <safe_malloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <safe_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"safe_malloc: Out of memory\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"safe_malloc: Out of memory\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int read_standard_target_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(761, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_standard_target_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2f9,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_standard_target_Laurent_system>:
mov    $0x2f9,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @read_standard_target_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 761, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_standard_target_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 761, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void debug_print_rmap(const struct cpu_rmap *rmap, const char *prefix) {}


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

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

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

LLVM IR (-O2):
%struct.cpu_rmap = type opaque
define void @debug_print_rmap(%struct.cpu_rmap* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: rtas_dbg [-l] <rtas token | rtas name>\n");
  fprintf(stderr, "\t-l    Print the specified rtas token or all tokens if not "
                  "specified\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xef6(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf00(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Usage: rtas_dbg [-l] <rtas token | rtas name>\0A\00"
@.str.1 = [70 x i8] c"\09-l Print the specified rtas token or all tokens if not specified\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Usage: rtas_dbg [-l] <rtas token | rtas name>\0A\00"
@.str.1 = [70 x i8] c"\09-l Print the specified rtas token or all tokens if not specified\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void extern_undeclared2(void) {}


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

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

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

LLVM IR (-O2):
define void @extern_undeclared2() {
ret void
}
void wmb(void) { asm volatile("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @wmb() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
char *basename(char const *);
int /*<<< orphan*/ printf(char *, char *, char *);
void version(const char *cmd) {
  printf("%s version %s\n", basename(cmd), "0.8");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
lea    0xec9(%rip),%rdx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
call   1040 <basename@plt>
lea    0xed3(%rip),%rdi
lea    0xedb(%rip),%rdx
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"%s version %s\0A\00"
@.str.1 = [4 x i8] c"0.8\00"
define void @version(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call(char *);
com() { call("cccom"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"cccom\00"
define i32 @com() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int contNum(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("O digito 2 ocorre %d vezes no numero %d", contNum(762021192, 2, 0),
         762021192);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2d6b8548,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <contNum@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
mov    $0x2d6b8548,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"O digito 2 ocorre %d vezes no numero %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @contNum(i32 762021192, i32 2, i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %2, i32 762021192)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"O digito 2 ocorre %d vezes no numero %d\00"
define i32 @main() {
%1 = tail call i32 @contNum(i32 762021192, i32 2, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1, i32 762021192)
ret i32 0
}
/* Variables and functions */
unsigned short islower(char c) { return (c >= 'a' && c <= 'z'); }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <islower+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define zeroext i16 @islower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @islower(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i16
ret i16 %4
}
unsigned addval_394(unsigned x) { return x + 3286272332U; }


x86 assembly (clang, -O0):
<addval_394>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc3e0894c,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addval_394>:
lea    -0x3c1f76b4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @addval_394(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1008694964
ret i32 %4
}

LLVM IR (-O2):
define i32 @addval_394(i32 %0) {
%2 = add i32 %0, -1008694964
ret i32 %2
}
long foo(int i) {
  float x;
  x = i;
  return __builtin_lroundf(x);
}


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

x86 assembly (clang, -O2):
<foo>:
cvtsi2ss %edi,%xmm0
jmp    1030 <lroundf@plt>

LLVM IR (-O0):
define i64 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
store float %5, float* %3
%6 = load float, float* %3
%7 = call i64 @lroundf(float %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @foo(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = tail call i64 @lroundf(float %2)
ret i64 %3
}
float F_fabs(float x) {
  if (x >= 0) {
    return x;
  }
  return 0.0f - x;
}


x86 assembly (clang, -O0):
<F_fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <F_fabs+0x29>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <F_fabs+0x36>
xorps  %xmm0,%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_fabs>:
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
subss  %xmm0,%xmm2
cmpnless %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @F_fabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %3
store float %7, float* %2
br label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = fsub float 0.000000e+00, %9
store float %10, float* %2
br label %11
11: ; preds = %8, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @F_fabs(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = fsub float 0.000000e+00, %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ __actions;
};
typedef TYPE_1__ posix_spawn_file_actions_t;

/* Variables and functions */
int posix_spawn_file_actions_init(posix_spawn_file_actions_t *fa) {
  fa->__actions = 0;
  return 0;
}


x86 assembly (clang, -O0):
<posix_spawn_file_actions_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawn_file_actions_init>:
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i32 @posix_spawn_file_actions_init(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 0, i64* %4
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define i32 @posix_spawn_file_actions_init(%struct.TYPE_3__* nocapture writeonly %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i64 0, i64* %2
ret i32 0
}
int iscons(int fdnum) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @iscons(i32 %0) {
ret i32 1
}
/* Variables and functions */
int omap_rev();
int is_omap34xx(void) { return ((omap_rev() & 0xff) == (0x34)) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_omap34xx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
and    $0xff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x34,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap34xx>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
xor    %ecx,%ecx
cmp    $0x34,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap34xx() {
%1 = call i32 (...) @omap_rev()
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 52
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_omap34xx() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 52
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int rand();
void fill_chunk(unsigned char *chunk, int len) {
  int i;
  for (i = 0; i < len; i++) {
    chunk[i] = rand() % 256;
  }
}


x86 assembly (clang, -O0):
<fill_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <fill_chunk+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fill_chunk+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_chunk>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <fill_chunk+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fill_chunk+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fill_chunk(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_pkey_free;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  int ret;
  ret = syscall(__NR_pkey_free, 0);
  (void)ret;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <syscall@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__NR_pkey_free = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @__NR_pkey_free
%4 = call i32 @syscall(i32 %3, i32 0)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 0
}

LLVM IR (-O2):
@__NR_pkey_free = global i32 0
define i32 @main() {
%1 = load i32, i32* @__NR_pkey_free
%2 = tail call i32 @syscall(i32 %1, i32 0)
ret i32 0
}
/* Type definitions */
struct arg_file {
  int dummy;
};

/* Variables and functions */
struct arg_file *arg_filen(char const *, char const *, char const *,
                           int /*<<< orphan*/, int, char const *);
struct arg_file *arg_file0(const char *shortopts, const char *longopts,
                           const char *datatype, const char *glossary) {
  return arg_filen(shortopts, longopts, datatype, 0, 1, glossary);
}


x86 assembly (clang, -O0):
<arg_file0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r9
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <arg_filen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_file0>:
mov    %rcx,%r9
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <arg_filen@plt>

LLVM IR (-O0):
%struct.arg_file = type { i32 }
define %struct.arg_file* @arg_file0(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call %struct.arg_file* @arg_filen(i8* %9, i8* %10, i8* %11, i32 0, i32 1, i8* %12)
ret %struct.arg_file* %13
}

LLVM IR (-O2):
%struct.arg_file = type { i32 }
define %struct.arg_file* @arg_file0(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call %struct.arg_file* @arg_filen(i8* %0, i8* %1, i8* %2, i32 0, i32 1, i8* %3)
ret %struct.arg_file* %5
}
int charadd(long long int x) {
  int sum = 0;
  while (x != 0) {
    sum += x % 10;
    x = x / 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<charadd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <charadd+0x49>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
movslq -0xc(%rbp),%rax
add    %rdx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    110f <charadd+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charadd>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     114d <charadd+0x4d>
movabs $0x6666666666666667,%r8
66 66 66
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
imul   %r8
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %edi,%esi
sub    %eax,%esi
add    %esi,%ecx
add    $0x9,%rdi
cmp    $0x12,%rdi
mov    %rdx,%rdi
ja     1120 <charadd+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @charadd(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = srem i64 %5, 10
%7 = trunc i64 %6 to i32
%8 = add i32 %4, %7
%9 = sdiv i64 %5, 10
%10 = add i64 %5, 9
%11 = icmp ult i64 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
long int cast_ulong_long_fast(unsigned long int x) { return (long int)x; }


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

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

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

LLVM IR (-O2):
define i64 @cast_ulong_long_fast(i64 returned %0) {
ret i64 %0
}
struct dbcomplex *herwig6_addressdc_(struct dbcomplex *arg) {
  return arg;
}


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

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

LLVM IR (-O0):
%struct.dbcomplex = type opaque
define %struct.dbcomplex* @herwig6_addressdc_(%struct.dbcomplex* %0) {
%2 = alloca %struct.dbcomplex*
store %struct.dbcomplex* %0, %struct.dbcomplex** %2
%3 = load %struct.dbcomplex*, %struct.dbcomplex** %2
ret %struct.dbcomplex* %3
}

LLVM IR (-O2):
%struct.dbcomplex = type opaque
define %struct.dbcomplex* @herwig6_addressdc_(%struct.dbcomplex* readnone returned %0) {
ret %struct.dbcomplex* %0
}
/* Variables and functions */
int getChar();
int getInt() { return getChar(); }


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

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

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

LLVM IR (-O2):
define i32 @getInt() {
%1 = tail call i32 (...) @getChar()
ret i32 %1
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int stricmp(const char *s1, const char *s2) { return strcasecmp(s1, s2); }


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

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

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

LLVM IR (-O2):
define i32 @stricmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
unsigned short int f53(unsigned short int x, int y) {
  return (x << ((-y) & (8 * 2 - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f53>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0xf,%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f53>:
mov    %esi,%ecx
neg    %cl
and    $0xf,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @f53(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub nsw i32 0, %1
%5 = and i32 %4, 15
%6 = shl nuw nsw i32 %3, %5
%7 = lshr i32 %3, %1
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Type definitions */
struct winsize {
  int dummy;
};

/* Variables and functions */
void fix_loc(void) {
  struct winsize winsz;
  int new_width, new_height;
}


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

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

LLVM IR (-O0):
%struct.winsize = type { i32 }
define void @fix_loc() {
%1 = alloca %struct.winsize
%2 = alloca i32
%3 = alloca i32
ret void
}

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