xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gui_chat_prefix_build_empty();
int /*<<< orphan*/ gui_color_pre_init();
void gui_main_pre_init(int *argc, char **argv[]) {
  (void)argc;
  (void)argv;
  gui_color_pre_init();
  gui_chat_prefix_build_empty();
}


x86 assembly (clang, -O0):
<gui_main_pre_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <gui_color_pre_init@plt>
mov    $0x0,%al
call   1030 <gui_chat_prefix_build_empty@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gui_main_pre_init(i32* %0, i8*** %1) {
%3 = alloca i32*
%4 = alloca i8***
store i32* %0, i32** %3
store i8*** %1, i8**** %4
%5 = load i32*, i32** %3
%6 = load i8***, i8**** %4
%7 = call i32 (...) @gui_color_pre_init()
%8 = call i32 (...) @gui_chat_prefix_build_empty()
ret void
}

LLVM IR (-O2):
define void @gui_main_pre_init(i32* nocapture readnone %0, i8*** nocapture readnone %1) {
%3 = tail call i32 (...) @gui_color_pre_init()
%4 = tail call i32 (...) @gui_chat_prefix_build_empty()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int /*<<< orphan*/ reverse_memcpy(void *, void *, int);
void int16_to_bytes(int16_t source, unsigned char bytes[2], int switch_endian) {
  void *dest_ptr = (void *)bytes;
  void *source_ptr = (void *)&source;
  if (switch_endian) {
    reverse_memcpy(dest_ptr, source_ptr, 2);
  } else {
    memcpy(dest_ptr, source_ptr, 2);
  }
}


x86 assembly (clang, -O0):
<int16_to_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1163 <int16_to_bytes+0x43>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x2,%edx
call   1030 <reverse_memcpy@plt>
jmp    1175 <int16_to_bytes+0x55>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int16_to_bytes>:
push   %rax
mov    %rsi,%rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
test   %edx,%edx
je     1140 <int16_to_bytes+0x20>
mov    $0x2,%edx
call   1030 <reverse_memcpy@plt>
pop    %rax
ret
mov    $0x2,%edx
call   1040 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @int16_to_bytes(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = bitcast i32* %4 to i8*
%6 = icmp eq i32 %2, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = call i32 @reverse_memcpy(i8* %1, i8* %5, i32 2)
br label %11
9: ; preds = %3
%10 = call i32 @memcpy(i8* %1, i8* %5, i32 2)
br label %11
11: ; preds = %9, %7
ret void
}
unsigned long int set_period(unsigned long int ttmr, unsigned long int period) {
  ttmr &= ~0x0fffffff;
  ttmr |= period & 0x0fffffff;
  return ttmr;
}


x86 assembly (clang, -O0):
<set_period>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffff0000000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffff,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_period>:
and    $0xfffffffff0000000,%rdi
and    $0xfffffff,%esi
lea    (%rsi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @set_period(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = and i64 %5, -268435456
store i64 %6, i64* %3
%7 = load i64, i64* %4
%8 = and i64 %7, 268435455
%9 = load i64, i64* %3
%10 = or i64 %9, %8
store i64 %10, i64* %3
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
define i64 @set_period(i64 %0, i64 %1) {
%3 = and i64 %0, -268435456
%4 = and i64 %1, 268435455
%5 = or i64 %4, %3
ret i64 %5
}
int test_imm_D5int64_midword_reg(long long val) {
  return ((val >> 16) & (0xD5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D5int64_midword_reg>:
test   $0xd50000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D5int64_midword_reg(i64 %0) {
%2 = and i64 %0, 13959168
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int IsCoreResidue(int res) {
  switch (res) {
  case 3:
  case 5:
  case 7:
  case 13:
  case 15:
  case 17:
  case 21:
  case 23:
  case 26:
  case 30:
  case 36:
  case 41:
  case 43:
  case 45:
  case 50:
  case 56:
  case 61:
  case 67:
  case 69:
    return 1;
  default:
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<IsCoreResidue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x42,%eax
ja     113c <IsCoreResidue+0x3c>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1143 <IsCoreResidue+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsCoreResidue>:
add    $0xfffffffd,%edi
cmp    $0x42,%edi
ja     111e <IsCoreResidue+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @IsCoreResidue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 3, label %5
i32 5, label %5
i32 7, label %5
i32 13, label %5
i32 15, label %5
i32 17, label %5
i32 21, label %5
i32 23, label %5
i32 26, label %5
i32 30, label %5
i32 36, label %5
i32 41, label %5
i32 43, label %5
i32 45, label %5
i32 50, label %5
i32 56, label %5
i32 61, label %5
i32 67, label %5
i32 69, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @IsCoreResidue(i32 %0) {
switch i32 %0, label %2 [
i32 3, label %3
i32 5, label %3
i32 7, label %3
i32 13, label %3
i32 15, label %3
i32 17, label %3
i32 21, label %3
i32 23, label %3
i32 26, label %3
i32 30, label %3
i32 36, label %3
i32 41, label %3
i32 43, label %3
i32 45, label %3
i32 50, label %3
i32 56, label %3
i32 61, label %3
i32 67, label %3
i32 69, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ vfork();
void main() { vfork(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
call   1030 <vfork@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 @vfork()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = call i32 @vfork()
ret void
}
/* Variables and functions */
int strlen(char *);
char CDP_lastchr(char *str) { return str[strlen(str) - 1]; }


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

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

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

LLVM IR (-O2):
define signext i8 @CDP_lastchr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
ret i8 %6
}
void st_overflow_001() {
  double buf[1048576];
  buf[0] = 1.0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x7fff80,%rsp
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x800000(%rbp)
ff
add    $0x7fff80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
define void @st_overflow_001() {
%1 = alloca [1048576 x double]
%2 = getelementptr inbounds [1048576 x double], [1048576 x double]* %1, i64 0, i64 0
store double 1.000000e+00, double* %2
ret void
}

LLVM IR (-O2):
define void @st_overflow_001() {
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_float4func1(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_float4func1() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_float4func1() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ seL4_DebugPutChar(char const);
void seL4_DebugPuts(const char *str) {
  for (; *str != '\0'; str++) {
    seL4_DebugPutChar(*str);
  }
}


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

x86 assembly (clang, -O2):
<seL4_DebugPuts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <seL4_DebugPuts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <seL4_DebugPutChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <seL4_DebugPuts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @seL4_DebugPuts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @seL4_DebugPutChar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msock_get_socket();
int /*<<< orphan*/ msock_is_ssl_on();
int sockPuts(int /*<<< orphan*/, char *);
int msock_puts(char *str) {
  if (!msock_is_ssl_on()) {
    return (sockPuts(msock_get_socket(), str));
  } else {
  }
  return (-1);
}


x86 assembly (clang, -O0):
<msock_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <msock_is_ssl_on@plt>
cmp    $0x0,%eax
jne    1166 <msock_puts+0x36>
mov    $0x0,%al
call   1040 <msock_get_socket@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1050 <sockPuts@plt>
mov    %eax,-0x4(%rbp)
jmp    1172 <msock_puts+0x42>
jmp    116b <msock_puts+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msock_puts>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <msock_is_ssl_on@plt>
test   %eax,%eax
je     1146 <msock_puts+0x16>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1040 <msock_get_socket@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <sockPuts@plt>

LLVM IR (-O0):
define i32 @msock_puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @msock_is_ssl_on()
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 (...) @msock_get_socket()
%8 = load i8*, i8** %3
%9 = call i32 @sockPuts(i32 %7, i8* %8)
store i32 %9, i32* %2
br label %12
10: ; preds = %1
br label %11
11: ; preds = %10
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @msock_puts(i8* %0) {
%2 = tail call i32 (...) @msock_is_ssl_on()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (...) @msock_get_socket()
%6 = tail call i32 @sockPuts(i32 %5, i8* %0)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
void str_copy(char *dst, const char *src, int dst_size) {
  strncpy(dst, src, dst_size);
  dst[dst_size - 1] = 0;
}


x86 assembly (clang, -O0):
<str_copy>:
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 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copy>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @str_copy(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 @strncpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @str_copy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%5 = add nsw i32 %2, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret void
}
void current_rounding(void) {
  int ROUND_MODE;
  char round_str[15];
  ROUND_MODE = fegetround();
  printf("Current Round Mode = %s \n", ROUND_MODE);
}


x86 assembly (clang, -O0):
<current_rounding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <fegetround@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [26 x i8] c"Current Round Mode = %s \0A\00"
define void @current_rounding() {
%1 = tail call i32 (...) @fegetround()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void enable_irq(void) { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_irq() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
int /*<<< orphan*/ ifContainsFive(int /*<<< orphan*/);
int dontGiveMeFive(int start, int end) {
  int counter = 0;
  for (int i = start; i <= end; i++)
    if (!ifContainsFive(abs(i)))
      counter++;
  return counter;
}


x86 assembly (clang, -O0):
<dontGiveMeFive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     117b <dontGiveMeFive+0x5b>
mov    -0x10(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <ifContainsFive@plt>
cmp    $0x0,%eax
jne    1168 <dontGiveMeFive+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <dontGiveMeFive+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113b <dontGiveMeFive+0x1b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dontGiveMeFive>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
cmp    %esi,%edi
jg     114a <dontGiveMeFive+0x3a>
mov    %esi,%r14d
mov    %edi,%ebp
add    $0x1,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
neg    %edi
cmovs  %ebp,%edi
call   1030 <ifContainsFive@plt>
cmp    $0x1,%eax
adc    $0x0,%ebx
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1130 <dontGiveMeFive+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dontGiveMeFive(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = phi i32 [ 0, %2 ], [ %13, %6 ]
ret i32 %5
6: ; preds = %2, %6
%7 = phi i32 [ %14, %6 ], [ %0, %2 ]
%8 = phi i32 [ %13, %6 ], [ 0, %2 ]
%9 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%10 = tail call i32 @ifContainsFive(i32 %9)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %8, %12
%14 = add i32 %7, 1
%15 = icmp eq i32 %7, %1
br i1 %15, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getBraceParam();
void CmdHyphenation(int code) {
  char *hyphenparameter = getBraceParam();
  free(hyphenparameter);
}


x86 assembly (clang, -O0):
<CmdHyphenation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdHyphenation>:
push   %rax
xor    %eax,%eax
call   1040 <getBraceParam@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @CmdHyphenation(i32 %0) {
%2 = tail call i8* (...) @getBraceParam()
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, char *, int);
int shim_klogctl(int type, char *bufp, int len) {
  return (int)shim_enosys(0, type, bufp, len);
}


x86 assembly (clang, -O0):
<shim_klogctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_klogctl>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_klogctl(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i64 @shim_enosys(i32 0, i32 %7, i8* %8, i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @shim_klogctl(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @shim_enosys(i32 0, i32 %0, i8* %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
void faac_fixed_init() {}


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

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

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

LLVM IR (-O2):
define void @faac_fixed_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *, size_t);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    fail("cannot allocate %u bytes", size);
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <fail@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"cannot allocate %u bytes\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 ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @fail(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"cannot allocate %u bytes\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 %6
4: ; preds = %1
%5 = tail call i32 @fail(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void make32bit(unsigned char *p, unsigned long i) {
  p[3] = i;
  p[2] = i >> 8;
  p[1] = i >> 16;
  p[0] = i >> 24;
}


x86 assembly (clang, -O0):
<make32bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<make32bit>:
bswap  %esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @make32bit(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i64 %1, 24
%12 = trunc i64 %11 to i8
store i8 %12, i8* %0
ret void
}
int CG_OwnerDrawWidth(int ownerDraw, float scale) {
  switch (ownerDraw) {
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<CG_OwnerDrawWidth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
jmp    1111 <CG_OwnerDrawWidth+0x11>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @CG_OwnerDrawWidth(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
switch i32 %5, label %6 [
]
6: ; preds = %2
br label %7
7: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @CG_OwnerDrawWidth(i32 %0, float %1) {
ret i32 0
}
void copyString(char *a, char *b) {
  while (*a != '\0') {
    *b++ = *a++;
  }
  *b = '\0';
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <copyString+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <copyString+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
mov    (%rdi),%al
test   %al,%al
je     1121 <copyString+0x21>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rsi)
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <copyString+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @copyString(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GENERAL_NAMES;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ GENERAL_NAMES_it;
GENERAL_NAMES *d2i_GENERAL_NAMES(GENERAL_NAMES **a, const unsigned char **in,
                                 long len) {
  return (GENERAL_NAMES *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                        &GENERAL_NAMES_it);
}


x86 assembly (clang, -O0):
<d2i_GENERAL_NAMES>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_GENERAL_NAMES>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@GENERAL_NAMES_it = global i32 0
define i32* @d2i_GENERAL_NAMES(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @GENERAL_NAMES_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@GENERAL_NAMES_it = global i32 0
define i32* @d2i_GENERAL_NAMES(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @GENERAL_NAMES_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ brk(int *);
int /*<<< orphan*/ printf(char *, int *);
int *sbrk(int /*<<< orphan*/);
int main(void) {
  int *p = sbrk(0);
  printf("%p\n", p);
  brk(p + 4);
  *p = 100;
  brk(p);
  *p = 200;
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1050 <sbrk@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
add    $0x10,%rdi
call   1040 <brk@plt>
mov    -0x10(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <brk@plt>
mov    -0x10(%rbp),%rax
movl   $0xc8,(%rax)
jmp    1184 <main+0x54>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <sbrk@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0x10(%rbx),%rdi
call   1040 <brk@plt>
movl   $0x64,(%rbx)
mov    %rbx,%rdi
call   1040 <brk@plt>
movl   $0xc8,(%rbx)
nopw   0x0(%rax,%rax,1)
jmp    1170 <main+0x40>

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @sbrk(i32 0)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 4
%8 = call i32 @brk(i32* %7)
%9 = load i32*, i32** %2
store i32 100, i32* %9
%10 = load i32*, i32** %2
%11 = call i32 @brk(i32* %10)
%12 = load i32*, i32** %2
store i32 200, i32* %12
br label %13
13: ; preds = %0, %13
br label %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = tail call i32* @sbrk(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = getelementptr inbounds i32, i32* %1, i64 4
%4 = tail call i32 @brk(i32* %3)
store i32 100, i32* %1
%5 = tail call i32 @brk(i32* %1)
store i32 200, i32* %1
br label %6
6: ; preds = %6, %0
br label %6
}
__attribute__((always_)) int ccc() {
  asm("ccc_label: .globl ccc_label");
  return ddd() + 1;
}


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

x86 assembly (clang, -O2):
<ccc>:
push   %rax

LLVM IR (-O0):
define i32 @ccc() {
%1 = call i32 (...) @ddd()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @ccc() {
tail call void asm sideeffect "ccc_label: .globl ccc_label", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @ddd()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ soc_css_init_nic400();
int /*<<< orphan*/ soc_css_init_pcie();
void soc_css_security_setup(void) {
  soc_css_init_nic400();
  soc_css_init_pcie();
}


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

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

LLVM IR (-O0):
define void @soc_css_security_setup() {
%1 = call i32 (...) @soc_css_init_nic400()
%2 = call i32 (...) @soc_css_init_pcie()
ret void
}

LLVM IR (-O2):
define void @soc_css_security_setup() {
%1 = tail call i32 (...) @soc_css_init_nic400()
%2 = tail call i32 (...) @soc_css_init_pcie()
ret void
}
/* Variables and functions */
char *StrError(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ stderr;
void *ContainerRaiseError(const char *fnname, int errcode, ...) {
  fprintf(stderr, "Container library: Error '%s' in function %s\n",
          StrError(errcode), fnname);
  return NULL;
}


x86 assembly (clang, -O0):
<ContainerRaiseError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <StrError@plt>
mov    -0x10(%rbp),%edi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ContainerRaiseError>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    %esi,%edi
call   1040 <StrError@plt>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Container library: Error '%s' in function %s\0A\00"
define i8* @ContainerRaiseError(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %4
%7 = call i8* @StrError(i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Container library: Error '%s' in function %s\0A\00"
define noalias i8* @ContainerRaiseError(i8* %0, i32 %1, ...) {
%3 = load i32, i32* @stderr
%4 = tail call i8* @StrError(i32 %1)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void fgreen(void) { fputs("\033[0;32m", stdout); }


x86 assembly (clang, -O0):
<fgreen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgreen>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;32m\00"
@stdout = global i32 0
define void @fgreen() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;32m\00"
@stdout = global i32 0
define void @fgreen() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_byte(int);
void emit_return(void) { write_byte(0xC3); }


x86 assembly (clang, -O0):
<emit_return>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc3,%edi
call   1030 <write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_return>:
mov    $0xc3,%edi
jmp    1030 <write_byte@plt>

LLVM IR (-O0):
define void @emit_return() {
%1 = call i32 @write_byte(i32 195)
ret void
}

LLVM IR (-O2):
define void @emit_return() {
%1 = tail call i32 @write_byte(i32 195)
ret void
}
double triangleFilter(double t) {
  if (t < 0.0)
    t = -t;
  if (t < 1.0)
    return (1.0 - t);
  return 0.0;
}


x86 assembly (clang, -O0):
<triangleFilter>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1138 <triangleFilter+0x38>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec0(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1162 <triangleFilter+0x62>
movsd  0xead(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116a <triangleFilter+0x6a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangleFilter>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movsd  0xee3(%rip),%xmm0
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
cmpltsd %xmm0,%xmm1
andpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @triangleFilter(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %3
br label %9
9: ; preds = %6, %1
%10 = load double, double* %3
%11 = fcmp olt double %10, 1.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %3
%14 = fsub double 1.000000e+00, %13
store double %14, double* %2
br label %16
15: ; preds = %9
store double 0.000000e+00, double* %2
br label %16
16: ; preds = %15, %12
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @triangleFilter(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fcmp olt double %4, 1.000000e+00
%6 = fsub double 1.000000e+00, %4
%7 = select i1 %5, double %6, double 0.000000e+00
ret double %7
}
void beep() { return; }


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

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

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

LLVM IR (-O2):
define void @beep() {
ret void
}
/* Variables and functions */
int printf(char *);
int print_usage(void) {
  return printf(
      "\x1b[32m"
      "[KB_PM]"
      "\x1b[0m"
      ": a CLI tool (like supervisor and pm2) keep a group of program running "
      "continuously.\n"
      "   Usage  :  kbpm [cmd] app\n"
      "       service  start                start the KB_PM service\n"
      "       service  clean                resolve the KB_PM service "
      "unexpectedly exit.\n"
      "       start    <file|app_name|id>   start the program and run forever\n"
      "       restart  <app_name|id>        restart the program\n"
      "       stop     <app_name|id>        stop the program\n"
      "       remove   <app_name|id>        remove the program form list\n"
      "       startall                      start all program(s)\n"
      "       stopall                       stop all the program(s)\n"
      "       version                       show KB_PM version\n");
}


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

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

LLVM IR (-O0):
@.str = [696 x i8] c"\1B[32m[KB_PM]\1B[0m: a CLI tool (like supervisor and pm2) keep a group of program running continuously.\0A Usage : kbpm [cmd] app\0A service start start the KB_PM service\0A service clean resolve the KB_PM service unexpectedly exit.\0A start <file|app_name|id> start the program and run forever\0A restart <app_name|id> restart the program\0A stop <app_name|id> stop the program\0A remove <app_name|id> remove the program form list\0A startall start all program(s)\0A stopall stop all the program(s)\0A version show KB_PM version\0A\00"
define i32 @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([696 x i8], [696 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [696 x i8] c"\1B[32m[KB_PM]\1B[0m: a CLI tool (like supervisor and pm2) keep a group of program running continuously.\0A Usage : kbpm [cmd] app\0A service start start the KB_PM service\0A service clean resolve the KB_PM service unexpectedly exit.\0A start <file|app_name|id> start the program and run forever\0A restart <app_name|id> restart the program\0A stop <app_name|id> stop the program\0A remove <app_name|id> remove the program form list\0A startall start all program(s)\0A stopall stop all the program(s)\0A version show KB_PM version\0A\00"
define i32 @print_usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([696 x i8], [696 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ val;
typedef int uint64_t;

/* Variables and functions */
uint64_t __fswab64(uint64_t val) {
  return (
      (uint64_t)((((uint64_t)(val) & (uint64_t)0x00000000000000ffULL) << 56) |
                 (((uint64_t)(val) & (uint64_t)0x000000000000ff00ULL) << 40) |
                 (((uint64_t)(val) & (uint64_t)0x0000000000ff0000ULL) << 24) |
                 (((uint64_t)(val) & (uint64_t)0x00000000ff000000ULL) << 8) |
                 (((uint64_t)(val) & (uint64_t)0x000000ff00000000ULL) >> 8) |
                 (((uint64_t)(val) & (uint64_t)0x0000ff0000000000ULL) >> 24) |
                 (((uint64_t)(val) & (uint64_t)0x00ff000000000000ULL) >> 40) |
                 (((uint64_t)(val) & (uint64_t)0xff00000000000000ULL) >> 56)));
}


x86 assembly (clang, -O0):
<__fswab64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
and    $0xff00,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x38,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__fswab64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 56
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 40
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = shl i32 %11, 24
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = shl i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 0
%20 = ashr i32 %19, 8
%21 = or i32 %17, %20
%22 = load i32, i32* %2
%23 = and i32 %22, 0
%24 = ashr i32 %23, 24
%25 = or i32 %21, %24
%26 = load i32, i32* %2
%27 = and i32 %26, 0
%28 = ashr i32 %27, 40
%29 = or i32 %25, %28
%30 = load i32, i32* %2
%31 = and i32 %30, 0
%32 = ashr i32 %31, 56
%33 = or i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @__fswab64(i32 %0) {
ret i32 poison
}
unsigned int calibrateHash(char *string) {
  unsigned int temp = 0;
  char *pString = string;
  while (*pString) {
    temp += *pString;
    pString++;
  }
  return temp;
}


x86 assembly (clang, -O0):
<calibrateHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <calibrateHash+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <calibrateHash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calibrateHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <calibrateHash+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <calibrateHash+0x10>
ret
xor    %eax,%eax
ret

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

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