xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ LPUART1_transmit_string_len(void const *, size_t);
int /*<<< orphan*/ errno;
int _write(int fd, const void *buf, size_t count) {
  (void)fd;
  if (count == 0 || buf == 0) {
    errno = EINVAL;
    return -1;
  }
  LPUART1_transmit_string_len(buf, count);
  return 0;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1139 <_write+0x29>
cmpq   $0x0,-0x10(%rbp)
jne    1157 <_write+0x47>
mov    0x2e98(%rip),%rax
mov    (%rax),%ecx
mov    0x2e97(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <_write+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <LPUART1_transmit_string_len@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rax
test   %rsi,%rsi
je     112a <_write+0x1a>
test   %rdx,%rdx
je     112a <_write+0x1a>
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <LPUART1_transmit_string_len@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
mov    0x2ea6(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_write(i32 %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
%5 = icmp eq i8* %1, null
%6 = or i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = load i32, i32* @EINVAL
store i32 %8, i32* @errno
br label %11
9: ; preds = %3
%10 = tail call i32 @LPUART1_transmit_string_len(i8* %1, i64 %2)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ -1, %7 ], [ 0, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigprocmask(int how, const sigset_t *set, sigset_t *oset) { return -1; }


x86 assembly (clang, -O0):
<sigprocmask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sigprocmask(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sw_volume_from_dB() {
  printf("NOT IMPLEMENTED:"
         "pa_sw_volume_from_dB"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_sw_volume_from_dB\00"
define i32 @pa_sw_volume_from_dB() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
_Noreturn void f(int x) {
  if (x) {
    return;
  } else
    while (1)
      ;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1113 <f+0x13>
pop    %rbp
ret
jmp    1118 <f+0x18>
jmp    1118 <f+0x18>

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     1110 <f+0x10>
ret
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <f+0x10>

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

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1
ret void
4: ; preds = %1, %4
br label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ responseCode;

/* Variables and functions */
int /*<<< orphan*/ send(int, int *, int, int /*<<< orphan*/);
void handle_list(int fd) {
  int responseCode = 2;
  send(fd, &responseCode, sizeof(responseCode), 0);
}


x86 assembly (clang, -O0):
<handle_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_list>:
push   %rax
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @handle_list(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%4 = call i32 @send(i32 %0, i32* %2, i32 4, i32 0)
ret void
}
/* Type definitions */
struct t_weechat_plugin {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plugin_script_display_interpreter(struct t_weechat_plugin *,
                                                     int);
int plugin_script_signal_debug_libs_cb(const void *pointer, void *data,
                                       const char *signal,
                                       const char *type_data,
                                       void *signal_data) {
  struct t_weechat_plugin *plugin;
  (void)data;
  (void)signal;
  (void)type_data;
  (void)signal_data;
  plugin = (struct t_weechat_plugin *)pointer;
  plugin_script_display_interpreter(plugin, 1);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.t_weechat_plugin = type { i32 }
define i32 @plugin_script_signal_debug_libs_cb(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca %struct.t_weechat_plugin*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = load i8*, i8** %6
%17 = bitcast i8* %16 to %struct.t_weechat_plugin*
store %struct.t_weechat_plugin* %17, %struct.t_weechat_plugin** %11
%18 = load %struct.t_weechat_plugin*, %struct.t_weechat_plugin** %11
%19 = call i32 @plugin_script_display_interpreter(%struct.t_weechat_plugin* %18, i32 1)
ret i32 0
}

LLVM IR (-O2):
%struct.t_weechat_plugin = type { i32 }
define i32 @plugin_script_signal_debug_libs_cb(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = bitcast i8* %0 to %struct.t_weechat_plugin*
%7 = tail call i32 @plugin_script_display_interpreter(%struct.t_weechat_plugin* %6, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ initSmalltalkStubs();
_Bool parseKernelFiles(char *);
int /*<<< orphan*/ registerPrimitives();
_Bool bootstrap(char *kernelDir) {
  initSmalltalkStubs();
  registerPrimitives();
  return parseKernelFiles(kernelDir);
}


x86 assembly (clang, -O0):
<bootstrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <initSmalltalkStubs@plt>
mov    $0x0,%al
call   1050 <registerPrimitives@plt>
mov    -0x8(%rbp),%rdi
call   1030 <parseKernelFiles@plt>
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bootstrap>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <initSmalltalkStubs@plt>
xor    %eax,%eax
call   1050 <registerPrimitives@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <parseKernelFiles@plt>

LLVM IR (-O0):
define zeroext i1 @bootstrap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @initSmalltalkStubs()
%4 = call i32 (...) @registerPrimitives()
%5 = load i8*, i8** %2
%6 = call zeroext i1 @parseKernelFiles(i8* %5)
ret i1 %6
}

LLVM IR (-O2):
define zeroext i1 @bootstrap(i8* %0) {
%2 = tail call i32 (...) @initSmalltalkStubs()
%3 = tail call i32 (...) @registerPrimitives()
%4 = tail call zeroext i1 @parseKernelFiles(i8* %0)
ret i1 %4
}
/* Variables and functions */
int is_segment(int, char *, char *);
int count_segments(char *a, char *t) {
  int count = 0, n = 0;
  while (is_segment(n, a, t)) {
    count++;
    n = is_segment(n, a, t);
  }
  return count;
}


x86 assembly (clang, -O0):
<count_segments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <is_segment@plt>
cmp    $0x0,%eax
je     1168 <count_segments+0x58>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <is_segment@plt>
mov    %eax,-0x18(%rbp)
jmp    112e <count_segments+0x1e>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_segments>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebp,%ebp
xor    %edi,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <is_segment@plt>
test   %eax,%eax
je     1163 <count_segments+0x53>
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebp
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <is_segment@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <is_segment@plt>
test   %eax,%eax
jne    1140 <count_segments+0x30>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @count_segments(i8* %0, i8* %1) {
%3 = tail call i32 @is_segment(i32 0, i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 0, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
%9 = tail call i32 @is_segment(i32 %6, i8* %0, i8* %1)
%10 = tail call i32 @is_segment(i32 %9, i8* %0, i8* %1)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xda() {
  Assert_real((isalpha(218) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1095, ("isalpha should be 0 for 0xda"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xda>:
push   %rbp
mov    %rsp,%rbp
mov    $0xda,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x447,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xda>:
push   %rax
mov    $0xda,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x447,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xda\00"
define void @t_isalpha_0xda() {
%1 = call i64 @isalpha(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xda\00"
define void @t_isalpha_0xda() {
%1 = tail call i64 @isalpha(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo453(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo453(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *udp_usage();
void udp_showusage() { printf("usage : udp %s", udp_usage()); }


x86 assembly (clang, -O0):
<udp_showusage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <udp_usage@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_showusage>:
push   %rax
xor    %eax,%eax
call   1040 <udp_usage@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"usage : udp %s\00"
define void @udp_showusage() {
%1 = call i8* (...) @udp_usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"usage : udp %s\00"
define void @udp_showusage() {
%1 = tail call i8* (...) @udp_usage()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int __attribute__((target("arch=sandybridge"))) redecl1(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @redecl1() {
ret i32 2
}

LLVM IR (-O2):
define i32 @redecl1() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ msg_print(char *);
scalar_t__ target_set(int);
void do_cmd_look(void) {
  if (target_set(0x02)) {
    msg_print("Target Selected.");
  }
}


x86 assembly (clang, -O0):
<do_cmd_look>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <target_set@plt>
cmp    $0x0,%rax
je     1144 <do_cmd_look+0x24>
lea    0xec1(%rip),%rdi
call   1040 <msg_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_look>:
push   %rax
mov    $0x2,%edi
call   1030 <target_set@plt>
test   %rax,%rax
je     113d <do_cmd_look+0x1d>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <msg_print@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Target Selected.\00"
define void @do_cmd_look() {
%1 = call i64 @target_set(i32 2)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @msg_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Target Selected.\00"
define void @do_cmd_look() {
%1 = tail call i64 @target_set(i32 2)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @msg_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_subarchitecture(void) { printf("SICORTEX"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"SICORTEX\00"
define void @get_subarchitecture() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"SICORTEX\00"
define void @get_subarchitecture() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ write_log(char *, size_t);
void *xmalloc(size_t n) {
  void *a = malloc(n);
  if (a == NULL) {
    write_log("xmalloc(%d): virtual memory exhausted\n", n);
    abort();
  }
  return a;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <xmalloc+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <write_log@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <write_log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"xmalloc(%d): virtual memory exhausted\0A\00"
define i8* @xmalloc(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 %12
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @write_log(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [39 x i8] c"xmalloc(%d): virtual memory exhausted\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @write_log(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) {
  printf("%s: generates Lucent compatible WEP keys from a string\n", prog);
  printf("Usage:  %s [-s] keystring\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"%s: generates Lucent compatible WEP keys from a string\0A\00"
@.str.1 = [27 x i8] c"Usage: %s [-s] keystring\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [56 x i8] c"%s: generates Lucent compatible WEP keys from a string\0A\00"
@.str.1 = [27 x i8] c"Usage: %s [-s] keystring\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double exp(float);
float raw_sigmoid_derivative(float x) {
  float y = 1.0 / (1.0 + exp(-x));
  return y * (1.0 - y);
}


x86 assembly (clang, -O0):
<raw_sigmoid_derivative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
movsd  0xec4(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe91(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_sigmoid_derivative>:
push   %rax
xorpd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @raw_sigmoid_derivative(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fneg float %4
%6 = call double @exp(float %5)
%7 = fadd double 1.000000e+00, %6
%8 = fdiv double 1.000000e+00, %7
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fsub double 1.000000e+00, %13
%15 = fmul double %11, %14
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
define float @raw_sigmoid_derivative(float %0) {
%2 = fneg float %0
%3 = tail call double @exp(float %2)
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
%7 = fpext float %6 to double
%8 = fsub double 1.000000e+00, %7
%9 = fmul double %8, %7
%10 = fptrunc double %9 to float
ret float %10
}
void gtk_rc_get_im_module_file() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_get_im_module_file() {
ret void
}
void atexit(void *addr) {}


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

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

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

LLVM IR (-O2):
define void @atexit(i8* nocapture %0) {
ret void
}
unsigned xrop3_200_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk1 = S & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_200_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_200_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glPopMatrix();
void switch_to_perspective() {
  glEnable(GL_DEPTH_TEST);
  glMatrixMode(GL_PROJECTION);
  glPopMatrix();
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<switch_to_perspective>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glPopMatrix@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_to_perspective>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glPopMatrix@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glPopMatrix@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @switch_to_perspective() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_PROJECTION
%4 = call i32 @glMatrixMode(i32 %3)
%5 = call i32 (...) @glPopMatrix()
%6 = load i32, i32* @GL_MODELVIEW
%7 = call i32 @glMatrixMode(i32 %6)
%8 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @switch_to_perspective() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_PROJECTION
%4 = tail call i32 @glMatrixMode(i32 %3)
%5 = tail call i32 (...) @glPopMatrix()
%6 = load i32, i32* @GL_MODELVIEW
%7 = tail call i32 @glMatrixMode(i32 %6)
%8 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_ASYNCHRONOUS_IO;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
long sysconf(int /*<<< orphan*/);
int main(void) {
  if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L)
    exit(4);
  printf("lio_listio/6-1.c"
         " LIO_READ not defined\n");
  exit(1);
  printf("lio_listio/6-1.c"
         " LIO_WRITE not defined\n");
  exit(1);
  printf("lio_listio/6-1.c"
         " LIO_WRITE not defined\n");
  exit(1);
  printf("Test PASSED\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
cmp    $0x30db0,%rax
jge    1163 <main+0x33>
mov    $0x4,%edi
call   1050 <exit@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
cmp    $0x30daf,%rax
jg     1151 <main+0x21>
mov    $0x4,%edi
call   1050 <exit@plt>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@_SC_ASYNCHRONOUS_IO = global i32 0
@.str = [39 x i8] c"lio_listio/6-1.c LIO_READ not defined\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @_SC_ASYNCHRONOUS_IO
%3 = call i64 @sysconf(i32 %2)
%4 = icmp slt i64 %3, 200112
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @exit(i32 4)
unreachable
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@_SC_ASYNCHRONOUS_IO = global i32 0
@str = [38 x i8] c"lio_listio/6-1.c LIO_READ not defined\00"
define i32 @main() {
%1 = load i32, i32* @_SC_ASYNCHRONOUS_IO
%2 = tail call i64 @sysconf(i32 %1)
%3 = icmp slt i64 %2, 200112
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @exit(i32 4)
unreachable
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
int little_endian() {
  unsigned char *m = "\x00\x00\x00\x01";
  return (*((unsigned int *)(m)) >> 24);
}


x86 assembly (clang, -O0):
<little_endian>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shr    $0x18,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"\00\00\00\01\00"
define i32 @little_endian() {
%1 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = lshr i32 %4, 24
ret i32 %5
}

LLVM IR (-O2):
define i32 @little_endian() {
ret i32 1
}
/* Variables and functions */
int mfspr(scalar_t__);
int /*<<< orphan*/ mtspr(scalar_t__, int);
int int_disable(unsigned long irq) {
  if (irq >= 32)
    return -1;
  mtspr(((9 << (11)) + 0), mfspr(((9 << (11)) + 0)) & ~(0x00000001L << irq));
  return 0;
}


x86 assembly (clang, -O0):
<int_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x20,-0x10(%rbp)
jb     1143 <int_disable+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <int_disable+0x58>
mov    $0x4800,%edi
call   1030 <mfspr@plt>
cltq
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
mov    %eax,%esi
mov    $0x4800,%edi
call   1040 <mtspr@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_disable>:
mov    $0xffffffff,%eax
cmp    $0x1f,%rdi
ja     1154 <int_disable+0x34>
push   %rbx
mov    %rdi,%rbx
mov    $0x4800,%edi
call   1030 <mfspr@plt>
mov    $0x1,%esi
mov    %ebx,%ecx
shl    %cl,%rsi
not    %esi
and    %eax,%esi
mov    $0x4800,%edi
call   1040 <mtspr@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @int_disable(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp uge i64 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %16
7: ; preds = %1
%8 = call i32 @mfspr(i64 18432)
%9 = sext i32 %8 to i64
%10 = load i64, i64* %3
%11 = shl i64 1, %10
%12 = xor i64 %11, -1
%13 = and i64 %9, %12
%14 = trunc i64 %13 to i32
%15 = call i32 @mtspr(i64 18432, i32 %14)
store i32 0, i32* %2
br label %16
16: ; preds = %7, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @int_disable(i64 %0) {
%2 = icmp ugt i64 %0, 31
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @mfspr(i64 18432)
%5 = shl nuw nsw i64 1, %0
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
%9 = tail call i32 @mtspr(i64 18432, i32 %8)
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %11
}
float main(void) { return 0; }


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

x86 assembly (clang, -O2):
<main>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @main() {
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @main() {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_set_silence() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_set_silence"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_memblockq_set_silence\00"
define i32 @pa_memblockq_set_silence() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int ok() {
  printf("[OK]\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"[OK]\0A\00"
define i32 @ok() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"[OK]\00"
define i32 @ok() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int create_sign_gram(int *arry, unsigned int *sign1, unsigned int *sign2) {
  int *gram_sign = arry;
  *sign1 = 1000 * gram_sign[0];
  *sign2 = gram_sign[1];
  return 0;
}


x86 assembly (clang, -O0):
<create_sign_gram>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   $0x3e8,(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_sign_gram>:
imul   $0x3e8,(%rdi),%eax
mov    %eax,(%rsi)
mov    0x4(%rdi),%eax
mov    %eax,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @create_sign_gram(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
store i32* %8, i32** %7
%9 = load i32*, i32** %7
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = mul nsw i32 1000, %11
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32*, i32** %7
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = load i32*, i32** %6
store i32 %16, i32* %17
ret i32 0
}

LLVM IR (-O2):
define i32 @create_sign_gram(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = mul nsw i32 %4, 1000
store i32 %5, i32* %1
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
store i32 %7, i32* %2
ret i32 0
}
int XOR(int a, int b) {
  int output = a ^ b;
  return output;
}


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

x86 assembly (clang, -O2):
<XOR>:
mov    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @XOR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @XOR(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
void vec4_copy(double *v1, const double *v2) {
  v1[0] = v2[0];
  v1[1] = v2[1];
  v1[2] = v2[2];
  v1[3] = v2[3];
}


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

x86 assembly (clang, -O2):
<vec4_copy>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x18(%rdi)
ret

LLVM IR (-O0):
define void @vec4_copy(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 2
store double %17, double* %19
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 3
%22 = load double, double* %21
%23 = load double*, double** %3
%24 = getelementptr inbounds double, double* %23, i64 3
store double %22, double* %24
ret void
}

LLVM IR (-O2):
define void @vec4_copy(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 1
store double %5, double* %6
%7 = getelementptr inbounds double, double* %1, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %0, i64 2
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 3
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %0, i64 3
store double %11, double* %12
ret void
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
int /*<<< orphan*/ is_public_key(struct item *);
void check_is_public_key(struct item *item) {
  if (!is_public_key(item))
    abort_crypto_lib("Presented item is not a public key");
}


x86 assembly (clang, -O0):
<check_is_public_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_public_key@plt>
cmp    $0x0,%eax
jne    114a <check_is_public_key+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_is_public_key>:
push   %rax
call   1030 <is_public_key@plt>
test   %eax,%eax
je     112c <check_is_public_key+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <abort_crypto_lib@plt>

LLVM IR (-O0):
%struct.item = type { i32 }
@.str = [35 x i8] c"Presented item is not a public key\00"
define void @check_is_public_key(%struct.item* %0) {
%2 = alloca %struct.item*
store %struct.item* %0, %struct.item** %2
%3 = load %struct.item*, %struct.item** %2
%4 = call i32 @is_public_key(%struct.item* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.item = type { i32 }
@.str = [35 x i8] c"Presented item is not a public key\00"
define void @check_is_public_key(%struct.item* %0) {
%2 = tail call i32 @is_public_key(%struct.item* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
void debug_init_commands(void) {
  extern void debug_network_init(void);
  debug_network_init();
  extern void debug_kheap_init(void);
  debug_kheap_init();
  extern void debug_time_init(void);
  debug_time_init();
  extern void debug_cmdline_init(void);
  debug_cmdline_init();
  extern void debug_disk_init(void);
  debug_disk_init();
  extern void debug_fs_init(void);
  debug_fs_init();
  extern void debug_devices_init(void);
  debug_devices_init();
}


x86 assembly (clang, -O0):
<debug_init_commands>:
push   %rbp
mov    %rsp,%rbp
call   1030 <debug_network_init@plt>
call   1070 <debug_kheap_init@plt>
call   1090 <debug_time_init@plt>
call   1080 <debug_cmdline_init@plt>
call   1060 <debug_disk_init@plt>
call   1050 <debug_fs_init@plt>
call   1040 <debug_devices_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_init_commands>:
push   %rax
call   1030 <debug_network_init@plt>
call   1070 <debug_kheap_init@plt>
call   1090 <debug_time_init@plt>
call   1080 <debug_cmdline_init@plt>
call   1060 <debug_disk_init@plt>
call   1050 <debug_fs_init@plt>
pop    %rax
jmp    1040 <debug_devices_init@plt>

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

LLVM IR (-O2):
define void @debug_init_commands() {
tail call void @debug_network_init()
tail call void @debug_kheap_init()
tail call void @debug_time_init()
tail call void @debug_cmdline_init()
tail call void @debug_disk_init()
tail call void @debug_fs_init()
tail call void @debug_devices_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prt_(char const *, float *, char const *, int /*<<< orphan*/,
                        int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int main() {
  float val = 2.1828e0;
  char const *bef = "Start:";
  char const *aft = ":End";
  prt_(bef, &val, aft, strlen(bef), strlen(aft));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    %eax,%r8d
lea    -0x8(%rbp),%rsi
call   1040 <prt_@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x400bb2ff,0xc(%rsp)
40
lea    0xec9(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1040 <prt_@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Start:\00"
@.str.1 = [5 x i8] c":End\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
store float 0x4001765FE0000000, float* %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @prt_(i8* %5, float* %2, i8* %6, i32 %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Start:\00"
@.str.1 = [5 x i8] c":End\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0x4001765FE0000000, float* %1
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @prt_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int haspre(char *, char *);
bool command(char *command, char *data) { return haspre(command, data); }


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

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

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

LLVM IR (-O2):
define i32 @command(i8* %0, i8* %1) {
%3 = tail call i32 @haspre(i8* %0, i8* %1)
ret i32 %3
}