xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ intHandler(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ serialWriteTry(char *, int);
void writeS(char c) {
  if (serialWriteTry(&c, 1) != 0) {
    printf("Error while sending!\n");
    intHandler(0);
  }
}


x86 assembly (clang, -O0):
<writeS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <serialWriteTry@plt>
cmp    $0x0,%rax
je     1169 <writeS+0x39>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <intHandler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeS>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1040 <serialWriteTry@plt>
test   %rax,%rax
je     115d <writeS+0x2d>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <intHandler@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Error while sending!\0A\00"
define void @writeS(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i64 @serialWriteTry(i8* %2, i32 1)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @intHandler(i32 0)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Error while sending!\00"
define void @writeS(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i64 @serialWriteTry(i8* %2, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%7 = call i32 @intHandler(i32 0)
br label %8
8: ; preds = %5, %1
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int putchar1(int c) {
  if (!(c >= 9 && c <= 13) && !(c >= 32 && c <= 126))
    return EOF;
  printf("%c", c);
  return c;
}


x86 assembly (clang, -O0):
<putchar1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jl     112f <putchar1+0x1f>
cmpl   $0xd,-0x8(%rbp)
jle    1154 <putchar1+0x44>
cmpl   $0x20,-0x8(%rbp)
jl     1143 <putchar1+0x33>
cmpl   $0x7e,-0x8(%rbp)
jle    1154 <putchar1+0x44>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <putchar1+0x59>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar1>:
push   %rbx
mov    %edi,%ebx
lea    -0x9(%rbx),%eax
cmp    $0x5,%eax
jb     112e <putchar1+0x1e>
lea    -0x20(%rbx),%eax
cmp    $0x5f,%eax
jb     112e <putchar1+0x1e>
mov    0x2ebe(%rip),%rax
mov    (%rax),%ebx
jmp    113c <putchar1+0x2c>
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [3 x i8] c"%c\00"
define i32 @putchar1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 9
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 13
br i1 %8, label %17, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 32
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 126
br i1 %14, label %17, label %15
15: ; preds = %12, %9
%16 = load i32, i32* @EOF
store i32 %16, i32* %2
br label %21
17: ; preds = %12, %6
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %3
store i32 %20, i32* %2
br label %21
21: ; preds = %17, %15
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [3 x i8] c"%c\00"
define i32 @putchar1(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = add i32 %0, -32
%5 = icmp ult i32 %4, 95
%6 = or i1 %3, %5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32, i32* @EOF
br label %11
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %0, %9 ], [ %8, %7 ]
ret i32 %12
}
/* Type definitions */
struct plugin_conf {
  int dummy;
};

/* Variables and functions */
scalar_t__ plugin_conf_pf_enabled_group(struct plugin_conf *);
scalar_t__ plugin_conf_pf_enabled_user(struct plugin_conf *);
int plugin_conf_pf_enabled(struct plugin_conf *conf) {
  if (plugin_conf_pf_enabled_user(conf) || plugin_conf_pf_enabled_group(conf))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<plugin_conf_pf_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <plugin_conf_pf_enabled_user@plt>
cmp    $0x0,%rax
jne    1152 <plugin_conf_pf_enabled+0x32>
mov    -0x10(%rbp),%rdi
call   1040 <plugin_conf_pf_enabled_group@plt>
cmp    $0x0,%rax
je     115e <plugin_conf_pf_enabled+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <plugin_conf_pf_enabled+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_conf_pf_enabled>:
push   %rbx
mov    %rdi,%rbx
call   1030 <plugin_conf_pf_enabled_user@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <plugin_conf_pf_enabled+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <plugin_conf_pf_enabled_group@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.plugin_conf = type { i32 }
define i32 @plugin_conf_pf_enabled(%struct.plugin_conf* %0) {
%2 = alloca i32
%3 = alloca %struct.plugin_conf*
store %struct.plugin_conf* %0, %struct.plugin_conf** %3
%4 = load %struct.plugin_conf*, %struct.plugin_conf** %3
%5 = call i64 @plugin_conf_pf_enabled_user(%struct.plugin_conf* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load %struct.plugin_conf*, %struct.plugin_conf** %3
%9 = call i64 @plugin_conf_pf_enabled_group(%struct.plugin_conf* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.plugin_conf = type { i32 }
define i32 @plugin_conf_pf_enabled(%struct.plugin_conf* %0) {
%2 = tail call i64 @plugin_conf_pf_enabled_user(%struct.plugin_conf* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @plugin_conf_pf_enabled_group(%struct.plugin_conf* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
long I2STxDataPutNonBlocking(unsigned long ulBase, unsigned long ulData) {
  ;
  if ((*((volatile unsigned long *)(ulBase + 0x00000018))) < 16) {
    (*((volatile unsigned long *)(ulBase + 0x00000000))) = ulData;
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<I2STxDataPutNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
cmp    $0x10,%rax
jae    1136 <I2STxDataPutNonBlocking+0x36>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    113e <I2STxDataPutNonBlocking+0x3e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxDataPutNonBlocking>:
mov    0x18(%rdi),%rax
cmp    $0xf,%rax
ja     1113 <I2STxDataPutNonBlocking+0x13>
mov    %rsi,(%rdi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @I2STxDataPutNonBlocking(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = add i64 %6, 24
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = icmp ult i64 %9, 16
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* %5
%13 = load i64, i64* %4
%14 = add i64 %13, 0
%15 = inttoptr i64 %14 to i64*
store volatile i64 %12, i64* %15
store i64 1, i64* %3
br label %17
16: ; preds = %2
store i64 0, i64* %3
br label %17
17: ; preds = %16, %11
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @I2STxDataPutNonBlocking(i64 %0, i64 %1) {
%3 = add i64 %0, 24
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = icmp ult i64 %5, 16
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %8
br label %9
9: ; preds = %2, %7
%10 = phi i64 [ 1, %7 ], [ 0, %2 ]
ret i64 %10
}
void Rename_CheckIntegrity(int *_rep, int print_flag) { *_rep = 0; }


x86 assembly (clang, -O0):
<Rename_CheckIntegrity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rename_CheckIntegrity>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @Rename_CheckIntegrity(i32* nocapture writeonly %0, i32 %1) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int isalpha(char);
bool valid_word_first_char(char ch) { return isalpha(ch); }


x86 assembly (clang, -O0):
<valid_word_first_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @valid_word_first_char(i8 signext %0) {
%2 = tail call i32 @isalpha(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _s2_priv_textab(float, float, float, int /*<<< orphan*/, int,
                                   int, int, char *);
void s2textxy(float ix, float iy, float iz, char *itext) {
  _s2_priv_textab(ix, iy, iz, 0, 1, 1., 1., itext);
}


x86 assembly (clang, -O0):
<s2textxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mov    -0x18(%rbp),%r8
xor    %edi,%edi
mov    $0x1,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <_s2_priv_textab@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2textxy>:
mov    %rdi,%r8
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
jmp    1030 <_s2_priv_textab@plt>

LLVM IR (-O0):
define void @s2textxy(float %0, float %1, float %2, i8* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i8*
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store i8* %3, i8** %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load i8*, i8** %8
%13 = call i32 @_s2_priv_textab(float %9, float %10, float %11, i32 0, i32 1, i32 1, i32 1, i8* %12)
ret void
}

LLVM IR (-O2):
define void @s2textxy(float %0, float %1, float %2, i8* %3) {
%5 = tail call i32 @_s2_priv_textab(float %0, float %1, float %2, i32 0, i32 1, i32 1, i32 1, i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
void *kore_malloc(size_t);
int /*<<< orphan*/ kore_mem_tag(void *, int /*<<< orphan*/);
void *kore_malloc_tagged(size_t len, u_int32_t tag) {
  void *ptr;
  ptr = kore_malloc(len);
  kore_mem_tag(ptr, tag);
  return (ptr);
}


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

x86 assembly (clang, -O2):
<kore_malloc_tagged>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <kore_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <kore_mem_tag@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @kore_malloc_tagged(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8*
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = call i8* @kore_malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = call i32 @kore_mem_tag(i8* %8, i32 %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @kore_malloc_tagged(i64 %0, i32 %1) {
%3 = tail call i8* @kore_malloc(i64 %0)
%4 = tail call i32 @kore_mem_tag(i8* %3, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ vider();
int vol_demonter();
int demonter(void) {
  if (vol_demonter() == -1)
    return -1;
  vider();
  return 0;
}


x86 assembly (clang, -O0):
<demonter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <vol_demonter@plt>
cmp    $0xffffffff,%eax
jne    1144 <demonter+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <demonter+0x32>
mov    $0x0,%al
call   1040 <vider@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<demonter>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <vol_demonter@plt>
cmp    $0xffffffff,%eax
je     1138 <demonter+0x18>
xor    %eax,%eax
call   1040 <vider@plt>
jmp    113d <demonter+0x1d>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @demonter() {
%1 = alloca i32
%2 = call i32 (...) @vol_demonter()
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 (...) @vider()
store i32 0, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @demonter() {
%1 = tail call i32 (...) @vol_demonter()
%2 = icmp eq i32 %1, -1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @vider()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ acc_free(void *);
void *acc_malloc(int const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  const int N = 512;
  void *d;
  d = acc_malloc(N);
  if (d == NULL)
    abort();
  fprintf(stderr, "CheCKpOInT\n");
  acc_free((void *)((uintptr_t)d + (uintptr_t)(N >> 1)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x200,-0x14(%rbp)
mov    $0x200,%edi
call   1040 <acc_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    117d <main+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
add    $0x100,%rdi
call   1060 <acc_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x200,%edi
call   1040 <acc_malloc@plt>
test   %rax,%rax
je     117b <main+0x3b>
mov    %rax,%rbx
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x100,%rbx
mov    %rbx,%rdi
call   1060 <acc_free@plt>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 512, i32* %6
%8 = call i8* @acc_malloc(i32 512)
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %7
%17 = ptrtoint i8* %16 to i64
%18 = add i64 %17, 256
%19 = inttoptr i64 %18 to i8*
%20 = call i32 @acc_free(i8* %19)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @acc_malloc(i32 512)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = ptrtoint i8* %3 to i64
%11 = add i64 %10, 256
%12 = inttoptr i64 %11 to i8*
%13 = tail call i32 @acc_free(i8* %12)
ret i32 0
}
double __dsign(double a, double b) {
  register double x = a;
  if (x <= 0.0)
    x = -x;
  if (b < 0.0)
    x = -x;
  return (x);
}


x86 assembly (clang, -O0):
<__dsign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1147 <__dsign+0x47>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1176 <__dsign+0x76>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dsign>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm4
cmpnlesd %xmm3,%xmm4
movapd %xmm4,%xmm5
andpd  %xmm0,%xmm4
xorpd  %xmm2,%xmm0
andnpd %xmm0,%xmm5
orpd   %xmm5,%xmm4
xorpd  %xmm4,%xmm2
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm4,%xmm1
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @__dsign(double %0, double %1) {
%3 = fcmp ugt double %0, 0.000000e+00
%4 = fneg double %0
%5 = select i1 %3, double %0, double %4
%6 = fcmp olt double %1, 0.000000e+00
%7 = fneg double %5
%8 = select i1 %6, double %7, double %5
ret double %8
}
unsigned kol_system_end(unsigned param) {
  asm("int $0x40" ::"a"(18), "b"(9), "c"(param));
}


x86 assembly (clang, -O0):
<kol_system_end>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x12,%eax
mov    $0x9,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_system_end>:
push   %rbx
mov    %edi,%ecx
mov    $0x12,%eax
mov    $0x9,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_system_end(i32 %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 18, i32 9, i32 %0)
ret i32 undef
}
/* Variables and functions */
char *strdup2(char *);
char *get_windows_path() { return strdup2("/"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @get_windows_path() {
%1 = call i8* @strdup2(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @get_windows_path() {
%1 = tail call i8* @strdup2(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char x = 'd' - '#';
  printf("%c (%d)\n", x, (int)x);
  puts("we expected to see A and 65");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
mov    -0x5(%rbp),%al
movsbl -0x5(%rbp),%edx
lea    0xebf(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x41,%esi
mov    $0x41,%edx
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%c (%d)\0A\00"
@.str.1 = [28 x i8] c"we expected to see A and 65\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 65, i8* %2
%3 = load i8, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %3, i32 %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%c (%d)\0A\00"
@.str.1 = [28 x i8] c"we expected to see A and 65\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext 65, i32 65)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgetwc(int /*<<< orphan*/ *);
wint_t getwc(FILE *f) { return fgetwc(f); }


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

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

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

LLVM IR (-O2):
define i32 @getwc(i32* %0) {
%2 = tail call i32 @fgetwc(i32* %0)
ret i32 %2
}
/* Type definitions */
struct map_type {
  int dummy;
};

/* Variables and functions */
struct map_type *addition(struct map_type *, struct map_type *);
int /*<<< orphan*/ deallocate(struct map_type *);
struct map_type *multiplicate_on_value(int, struct map_type *);
struct map_type *subtraction(struct map_type *map, struct map_type *map_2) {
  struct map_type *tmp, *result;
  tmp = multiplicate_on_value(-1, map_2);
  result = addition(map, tmp);
  deallocate(tmp);
  return result;
}


x86 assembly (clang, -O0):
<subtraction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edi
call   1050 <multiplicate_on_value@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <addition@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <deallocate@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtraction>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffff,%edi
call   1050 <multiplicate_on_value@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <addition@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <deallocate@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.map_type = type { i32 }
define %struct.map_type* @subtraction(%struct.map_type* %0, %struct.map_type* %1) {
%3 = alloca %struct.map_type*
%4 = alloca %struct.map_type*
%5 = alloca %struct.map_type*
%6 = alloca %struct.map_type*
store %struct.map_type* %0, %struct.map_type** %3
store %struct.map_type* %1, %struct.map_type** %4
%7 = load %struct.map_type*, %struct.map_type** %4
%8 = call %struct.map_type* @multiplicate_on_value(i32 -1, %struct.map_type* %7)
store %struct.map_type* %8, %struct.map_type** %5
%9 = load %struct.map_type*, %struct.map_type** %3
%10 = load %struct.map_type*, %struct.map_type** %5
%11 = call %struct.map_type* @addition(%struct.map_type* %9, %struct.map_type* %10)
store %struct.map_type* %11, %struct.map_type** %6
%12 = load %struct.map_type*, %struct.map_type** %5
%13 = call i32 @deallocate(%struct.map_type* %12)
%14 = load %struct.map_type*, %struct.map_type** %6
ret %struct.map_type* %14
}

LLVM IR (-O2):
%struct.map_type = type { i32 }
define %struct.map_type* @subtraction(%struct.map_type* %0, %struct.map_type* %1) {
%3 = tail call %struct.map_type* @multiplicate_on_value(i32 -1, %struct.map_type* %1)
%4 = tail call %struct.map_type* @addition(%struct.map_type* %0, %struct.map_type* %3)
%5 = tail call i32 @deallocate(%struct.map_type* %3)
ret %struct.map_type* %4
}
/* Variables and functions */
unsigned char USBNRead(int);
void _USBNAlternateEvent(void) {
  unsigned char event;
  event = USBNRead(0x08);
}


x86 assembly (clang, -O0):
<_USBNAlternateEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <USBNRead@plt>
mov    %al,-0x1(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_USBNAlternateEvent>:
mov    $0x8,%edi
jmp    1030 <USBNRead@plt>

LLVM IR (-O0):
define void @_USBNAlternateEvent() {
%1 = alloca i8
%2 = call zeroext i8 @USBNRead(i32 8)
store i8 %2, i8* %1
ret void
}

LLVM IR (-O2):
define void @_USBNAlternateEvent() {
%1 = tail call zeroext i8 @USBNRead(i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die_errno(char *, int, int);
int shutdown(int, int);
void xshutdown(int socketfd, int how) {
  if (shutdown(socketfd, how) == -1)
    die_errno("shutdown(%d, %d)", socketfd, how);
}


x86 assembly (clang, -O0):
<xshutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <shutdown@plt>
cmp    $0xffffffff,%eax
jne    1154 <xshutdown+0x34>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb1(%rip),%rdi
call   1040 <die_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xshutdown>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <shutdown@plt>
cmp    $0xffffffff,%eax
je     1138 <xshutdown+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <die_errno@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"shutdown(%d, %d)\00"
define void @xshutdown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die_errno(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sounder(int, int);
void tapDit() { sounder(1, (1200 * 1 / 8)); }


x86 assembly (clang, -O0):
<tapDit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x96,%esi
call   1030 <sounder@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tapDit>:
mov    $0x1,%edi
mov    $0x96,%esi
jmp    1030 <sounder@plt>

LLVM IR (-O0):
define void @tapDit() {
%1 = call i32 @sounder(i32 1, i32 150)
ret void
}

LLVM IR (-O2):
define void @tapDit() {
%1 = tail call i32 @sounder(i32 1, i32 150)
ret void
}
/* Variables and functions */
long long foo();
int /*<<< orphan*/ setjmp();
long long sub1() {
  char junk[10000];
  register long long a, b, c;
  b = foo();
  setjmp();
  a = foo();
  c = a - b;
  return c;
}


x86 assembly (clang, -O0):
<sub1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2730,%rsp
mov    $0x0,%al
call   1030 <foo@plt>
mov    %rax,-0x2720(%rbp)
mov    $0x0,%al
call   1040 <setjmp@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    %rax,-0x2718(%rbp)
mov    -0x2718(%rbp),%rax
sub    -0x2720(%rbp),%rax
mov    %rax,-0x2728(%rbp)
mov    -0x2728(%rbp),%rax
add    $0x2730,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub1>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
mov    %eax,%ebx
call   1030 <foo@plt>
mov    %rax,%r14
mov    %ebx,%eax
call   1040 <setjmp@plt>
mov    %ebx,%eax
call   1030 <foo@plt>
sub    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @sub1() {
%1 = alloca [10000 x i8]
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = call i64 (...) @foo()
store i64 %5, i64* %3
%6 = call i32 (...) @setjmp()
%7 = call i64 (...) @foo()
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = sub nsw i64 %8, %9
store i64 %10, i64* %4
%11 = load i64, i64* %4
ret i64 %11
}

LLVM IR (-O2):
define i64 @sub1() {
%1 = call i64 (...) @foo()
%2 = call i32 (...) @setjmp()
%3 = call i64 (...) @foo()
%4 = sub nsw i64 %3, %1
ret i64 %4
}
void RTR3InitExeNoArguments(void) {}


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

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

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

LLVM IR (-O2):
define void @RTR3InitExeNoArguments() {
ret void
}
int budweiser(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @budweiser(i32 returned %0) {
ret i32 %0
}
unsigned long hash_func_val(const int table_size, void *data) {
  return (unsigned long)data % table_size;
}


x86 assembly (clang, -O0):
<hash_func_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func_val>:
mov    %rsi,%rax
movslq %edi,%rcx
mov    %rsi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     111b <hash_func_val+0x1b>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @hash_func_val(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = ptrtoint i8* %5 to i64
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = urem i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @hash_func_val(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = sext i32 %0 to i64
%5 = urem i64 %3, %4
ret i64 %5
}
void main() {
  void search(float(*p)[4], int n);
  float score[3][4] = {{65, 57, 70, 60}, {58, 87, 90, 81}, {90, 99, 100, 98}};
  search(score, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
call   1030 <search@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <search@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.score = [3 x [4 x float]] [[4 x float] [float 6.500000e+01, float 5.700000e+01, float 7.000000e+01, float 6.000000e+01], [4 x float] [float 5.800000e+01, float 8.700000e+01, float 9.000000e+01, float 8.100000e+01], [4 x float] [float 9.000000e+01, float 9.900000e+01, float 1.000000e+02, float 9.800000e+01]]
define void @main() {
%1 = alloca [3 x [4 x float]]
%2 = bitcast [3 x [4 x float]]* %1 to i8*
%3 = getelementptr inbounds [3 x [4 x float]], [3 x [4 x float]]* %1, i64 0, i64 0
ret void
}

LLVM IR (-O2):
@__const.main.score = [3 x [4 x float]] [[4 x float] [float 6.500000e+01, float 5.700000e+01, float 7.000000e+01, float 6.000000e+01], [4 x float] [float 5.800000e+01, float 8.700000e+01, float 9.000000e+01, float 8.100000e+01], [4 x float] [float 9.000000e+01, float 9.900000e+01, float 1.000000e+02, float 9.800000e+01]]
define void @main() {
%1 = alloca [3 x [4 x float]]
%2 = bitcast [3 x [4 x float]]* %1 to i8*
%3 = getelementptr inbounds [3 x [4 x float]], [3 x [4 x float]]* %1, i64 0, i64 0
ret void
}
/* Variables and functions */
int __builtin_arm_crc32b(int, char);
int crc32b(int a, char b) { return __builtin_arm_crc32b(a, b); }


x86 assembly (clang, -O0):
<crc32b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
movsbl -0x5(%rbp),%esi
call   1030 <__builtin_arm_crc32b@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @crc32b(i32 %0, i8 signext %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 @__builtin_arm_crc32b(i32 %5, i8 signext %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @crc32b(i32 %0, i8 signext %1) {
%3 = tail call i32 @__builtin_arm_crc32b(i32 %0, i8 signext %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m136_setParams4100(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m172doBitRev(int /*<<< orphan*/);
void m172_setParams4100(uint16_t addr, uint8_t val) {
  m136_setParams4100(addr, m172doBitRev(val));
}


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

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <m172doBitRev@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <m136_setParams4100@plt>

LLVM IR (-O0):
define void @m172_setParams4100(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @m172doBitRev(i32 %6)
%8 = call i32 @m136_setParams4100(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @m172_setParams4100(i32 %0, i32 %1) {
%3 = tail call i32 @m172doBitRev(i32 %1)
%4 = tail call i32 @m136_setParams4100(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int creat_prime();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *const argv[]) {
  printf("%d ", creat_prime());
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <creat_prime@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @creat_prime()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @creat_prime()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
void RTStrStrip(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrStrip() {
ret void
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char const *);
int strtol(char const *, char **, int);
mode_t a_mask(const char *s) {
  int rv;
  char *ep;
  rv = strtol(s, &ep, 8);
  if (s == ep || *ep || rv < 0)
    errx(1, "invalid file mode: %s", s);
  return rv;
}


x86 assembly (clang, -O0):
<a_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1040 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1169 <a_mask+0x49>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1169 <a_mask+0x49>
cmpl   $0x0,-0xc(%rbp)
jge    117e <a_mask+0x5e>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xe87(%rip),%rsi
call   1030 <errx@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_mask>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0x8,%edx
call   1040 <strtol@plt>
mov    %eax,%ebp
mov    (%rsp),%rax
cmp    %rbx,%rax
je     1147 <a_mask+0x27>
cmpb   $0x0,(%rax)
jne    1147 <a_mask+0x27>
test   %ebp,%ebp
jns    115b <a_mask+0x3b>
lea    0xeb2(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1030 <errx@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"invalid file mode: %s\00"
define i32 @a_mask(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strtol(i8* %5, i8** %4, i32 8)
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %4
%9 = icmp eq i8* %7, %8
br i1 %9, label %18, label %10
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %10
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15, %10, %1
%19 = load i8*, i8** %2
%20 = call i32 @errx(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [22 x i8] c"invalid file mode: %s\00"
define i32 @a_mask(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtol(i8* %0, i8** %2, i32 8)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, %0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8, i8* %5
%9 = icmp ne i8 %8, 0
%10 = icmp slt i32 %4, 0
%11 = select i1 %9, i1 true, i1 %10
br i1 %11, label %12, label %14
12: ; preds = %7, %1
%13 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %14
14: ; preds = %7, %12
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap16(int /*<<< orphan*/);
uint16_t cpu_to_be16(uint16_t v) { return bswap16(v); }


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

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

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

LLVM IR (-O2):
define i32 @cpu_to_be16(i32 %0) {
%2 = tail call i32 @bswap16(i32 %0)
ret i32 %2
}
/* Variables and functions */
#define ARGP_KEY_HELP_EXTRA 128
int /*<<< orphan*/ gettext(char *);
char *strdup(int /*<<< orphan*/);
char *more_help(int key, const char *text, void *input) {
  switch (key) {
  case ARGP_KEY_HELP_EXTRA:
    return strdup(
        gettext("For bug reporting instructions, please "
                "see:\n<http://www.gnu.org/software/libc/bugs.html>.\n"));
  default:
    break;
  }
  return (char *)text;
}


x86 assembly (clang, -O0):
<more_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    1162 <more_help+0x42>
jmp    1146 <more_help+0x26>
lea    0xeb3(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    116f <more_help+0x4f>
jmp    1167 <more_help+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<more_help>:
cmp    $0x80,%edi
jne    113d <more_help+0x1d>
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <strdup@plt>
mov    %rsi,%rax
ret

LLVM IR (-O0):
@.str = [91 x i8] c"For bug reporting instructions, please see:\0A<http://www.gnu.org/software/libc/bugs.html>.\0A\00"
define i8* @more_help(i32 %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
switch i32 %8, label %12 [
i32 128, label %9
]
9: ; preds = %3
%10 = call i32 @gettext(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
%11 = call i8* @strdup(i32 %10)
store i8* %11, i8** %4
br label %15
12: ; preds = %3
br label %13
13: ; preds = %12
%14 = load i8*, i8** %6
store i8* %14, i8** %4
br label %15
15: ; preds = %13, %9
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
@.str = [91 x i8] c"For bug reporting instructions, please see:\0A<http://www.gnu.org/software/libc/bugs.html>.\0A\00"
define i8* @more_help(i32 %0, i8* readnone %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %0, 128
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i32 @gettext(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
%7 = tail call i8* @strdup(i32 %6)
br label %8
8: ; preds = %3, %5
%9 = phi i8* [ %7, %5 ], [ %1, %3 ]
ret i8* %9
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_userdata_project2(void) { return GppcFinfoV1(); }


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

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

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

LLVM IR (-O2):
define i8* @pg_finfo_userdata_project2() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
swapstk() { ol("XCHG [SP],AX"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"XCHG [SP],AX\00"
define i32 @swapstk() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ getAddress(char *);
int /*<<< orphan*/ oldStyleAbbreviation(char *);
int main(int argc, const char *argv[]) {
  char address[100];
  getAddress(address);
  oldStyleAbbreviation(address);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <getAddress@plt>
mov    %rbx,%rdi
call   1040 <oldStyleAbbreviation@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%8 = call i32 @getAddress(i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%10 = call i32 @oldStyleAbbreviation(i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @getAddress(i8* %4)
%6 = call i32 @oldStyleAbbreviation(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: pat [-S] -s size -p byte\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: pat [-S] -s size -p byte\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: pat [-S] -s size -p byte\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}