xunge/DecIR huggingface dataset:
int test1(int argc, char **argv) {
  unsigned char a = 0x11223344;
  unsigned char b = 0x11223344;
  __builtin_bzero(&a, sizeof(a));
  __builtin_memset(&a, 0, sizeof(a));
  __builtin_memcpy(&a, &b, sizeof(a));
  __builtin_memmove(&a, &b, sizeof(a));
  return 0;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x44,-0x11(%rbp)
movb   $0x44,-0x12(%rbp)
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test1(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void prool_version() {
  printf("Built by Prool %s %s "
         "proolix@gmail.com\nhttp://calculix.kharkov.org\nUse PROOL command in "
         "CGX main window for additional info\n",
         "Mar 18 2022", "23:23:05");
}


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

x86 assembly (clang, -O2):
<prool_version>:
lea    0xee9(%rip),%rdi
lea    0xf5f(%rip),%rsi
lea    0xf64(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [125 x i8] c"Built by Prool %s %s proolix@gmail.com\0Ahttp://calculix.kharkov.org\0AUse PROOL command in CGX main window for additional info\0A\00"
@.str.1 = [12 x i8] c"Mar 18 2022\00"
@.str.2 = [9 x i8] c"23:23:05\00"
define void @prool_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [125 x i8] c"Built by Prool %s %s proolix@gmail.com\0Ahttp://calculix.kharkov.org\0AUse PROOL command in CGX main window for additional info\0A\00"
@.str.1 = [12 x i8] c"Mar 18 2022\00"
@.str.2 = [9 x i8] c"23:23:05\00"
define void @prool_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int test_00(unsigned char *x, char *xx, int y, int z) {
  int b = x[0];
  xx[0] = b;
  return b ? y : z;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
cmpl   $0x0,-0x1c(%rbp)
je     113c <test_00+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1142 <test_00+0x42>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edx,%eax
mov    (%rdi),%dl
mov    %dl,(%rsi)
test   %dl,%dl
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_00(i8* nocapture %0, i8* nocapture writeonly %1, i32 %2, i32 %3) {
%5 = load i8, i8* %0
store i8 %5, i8* %1
%6 = icmp eq i8 %5, 0
%7 = select i1 %6, i32 %3, i32 %2
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_set_bitdepth_chroma_8(uint8_t *p, uint8_t val) {
  p[17] = 0xf8 | val;
}


x86 assembly (clang, -O0):
<h265hvcc_set_bitdepth_chroma_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
or     $0xf8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x44(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_set_bitdepth_chroma_8>:
or     $0xf8,%esi
mov    %esi,0x44(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_bitdepth_chroma_8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = or i32 248, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 17
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_bitdepth_chroma_8(i32* nocapture writeonly %0, i32 %1) {
%3 = or i32 %1, 248
%4 = getelementptr inbounds i32, i32* %0, i64 17
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void help(const char *progname) {
  fprintf(stderr,
          "Usage:\n"
          "\t%s [options] modulename ...\n"
          "Options:\n"
          "\t-f, --force       forces a module unload and may crash your\n"
          "\t                  machine. This requires Forced Module Removal\n"
          "\t                  option in your kernel. DANGEROUS\n"
          "\t-s, --syslog      print to syslog, not stderr\n"
          "\t-v, --verbose     enables more messages\n"
          "\t-V, --version     show version\n"
          "\t-w, --wait        begins module removal even if it is used and\n"
          "\t                  will stop new users from accessing it.\n"
          "\t-h, --help        show this help\n",
          progname);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [499 x i8] c"Usage:\0A\09%s [options] modulename ...\0AOptions:\0A\09-f, --force forces a module unload and may crash your\0A\09 machine. This requires Forced Module Removal\0A\09 option in your kernel. DANGEROUS\0A\09-s, --syslog print to syslog, not stderr\0A\09-v, --verbose enables more messages\0A\09-V, --version show version\0A\09-w, --wait begins module removal even if it is used and\0A\09 will stop new users from accessing it.\0A\09-h, --help show this help\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([499 x i8], [499 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [499 x i8] c"Usage:\0A\09%s [options] modulename ...\0AOptions:\0A\09-f, --force forces a module unload and may crash your\0A\09 machine. This requires Forced Module Removal\0A\09 option in your kernel. DANGEROUS\0A\09-s, --syslog print to syslog, not stderr\0A\09-v, --verbose enables more messages\0A\09-V, --version show version\0A\09-w, --wait begins module removal even if it is used and\0A\09 will stop new users from accessing it.\0A\09-h, --help show this help\0A\00"
define void @help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([499 x i8], [499 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_buffer();
void reset_buffer() {
  do {
  } while (0);
  init_buffer();
}


x86 assembly (clang, -O0):
<reset_buffer>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <reset_buffer+0x9>
jmp    111e <reset_buffer+0xe>
mov    $0x0,%al
call   1030 <init_buffer@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @reset_buffer() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
%3 = call i32 (...) @init_buffer()
ret void
}

LLVM IR (-O2):
define void @reset_buffer() {
%1 = tail call i32 (...) @init_buffer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CyBle_HidssOnDeviceConnected();
void CyBle_GattConnectReqHandler(void) { CyBle_HidssOnDeviceConnected(); }


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

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

LLVM IR (-O0):
define void @CyBle_GattConnectReqHandler() {
%1 = call i32 (...) @CyBle_HidssOnDeviceConnected()
ret void
}

LLVM IR (-O2):
define void @CyBle_GattConnectReqHandler() {
%1 = tail call i32 (...) @CyBle_HidssOnDeviceConnected()
ret void
}
void bnxt_unlock_napi(struct bnxt_napi *bnapi) {}


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

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

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

LLVM IR (-O2):
%struct.bnxt_napi = type opaque
define void @bnxt_unlock_napi(%struct.bnxt_napi* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void dream(int nivel) {
  if (nivel == 5)
    return;
  printf("Estoy durmiendo en el nivel %d\n", ++nivel);
  dream(nivel);
}


x86 assembly (clang, -O0):
<dream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    113a <dream+0x1a>
jmp    1157 <dream+0x37>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x4(%rbp)
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <dream@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dream>:
push   %r14
push   %rbx
push   %rax
cmp    $0x5,%edi
je     1142 <dream+0x32>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x6,%ebx
jne    1130 <dream+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Estoy durmiendo en el nivel %d\0A\00"
define void @dream(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 5
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Estoy durmiendo en el nivel %d\0A\00"
define void @dream(i32 %0) {
%2 = icmp eq i32 %0, 5
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp eq i32 %5, 5
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int FUNC2(int, int);
int FUNC1(int a) { return 10 + FUNC2(1, a); }


x86 assembly (clang, -O0):
<FUNC1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <FUNC2@plt>
add    $0xa,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FUNC1>:
push   %rax
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <FUNC2@plt>
add    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @FUNC1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @FUNC2(i32 1, i32 %3)
%5 = add nsw i32 10, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @FUNC1(i32 %0) {
%2 = tail call i32 @FUNC2(i32 1, i32 %0)
%3 = add nsw i32 %2, 10
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CompressLevel(char *);
int main(int argc, char *argv[]) { CompressLevel("level1"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"level1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @CompressLevel(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ioctl(int, int, int);
int /*<<< orphan*/ usleep(float);
void beep(int buz, float microsec) {
  ioctl(buz, 0, 1);
  usleep(microsec * 1000 * 1000);
  ioctl(buz, 1, 1);
}


x86 assembly (clang, -O0):
<beep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <ioctl@plt>
movss  0xeb9(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xeac(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1040 <usleep@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beep>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %edi,%ebx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <ioctl@plt>
movss  0xebf(%rip),%xmm0
movss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1040 <usleep@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
add    $0x10,%rsp
pop    %rbx
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
define void @beep(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
%6 = call i32 @ioctl(i32 %5, i32 0, i32 1)
%7 = load float, float* %4
%8 = fmul float %7, 1.000000e+03
%9 = fmul float %8, 1.000000e+03
%10 = call i32 @usleep(float %9)
%11 = load i32, i32* %3
%12 = call i32 @ioctl(i32 %11, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @beep(i32 %0, float %1) {
%3 = tail call i32 @ioctl(i32 %0, i32 0, i32 1)
%4 = fmul float %1, 1.000000e+03
%5 = fmul float %4, 1.000000e+03
%6 = tail call i32 @usleep(float %5)
%7 = tail call i32 @ioctl(i32 %0, i32 1, i32 1)
ret void
}
/* Variables and functions */
int spawnvpe(int, char const *, char const **, char const **);
int execvpe(const char *path, const char **argv, const char **envp) {
  return spawnvpe(3, path, argv, envp);
}


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

x86 assembly (clang, -O2):
<execvpe>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x3,%edi
jmp    1030 <spawnvpe@plt>

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

LLVM IR (-O2):
define i32 @execvpe(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @spawnvpe(i32 3, i8* %0, i8** %1, i8** %2)
ret i32 %4
}
void GenIsrEpilog(void) {}


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

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

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

LLVM IR (-O2):
define void @GenIsrEpilog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc20(void) {
  printf("Executing exitfunc20.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc20>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc20>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc20.\0A\00"
define void @exitfunc20() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc20.\00"
define void @exitfunc20() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int enviar(int sockfd, char *package) {
  if (send(sockfd, package, strlen(package), 0) == -1) {
    perror("send");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<enviar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
jne    1187 <enviar+0x57>
lea    0xe8a(%rip),%rdi
call   1050 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    118e <enviar+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enviar>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1161 <enviar+0x31>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe98(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
jmp    115a <enviar+0x2a>

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

LLVM IR (-O2):
@.str = [5 x i8] c"send\00"
define i32 @enviar(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *local_constructDataFileName(const char *outPrefix, const char *name) {
  char *fname = xmalloc(strlen(outPrefix) + strlen(name) + 6);
  sprintf(fname, "%s.%s.dat", outPrefix, name);
  return fname;
}


x86 assembly (clang, -O0):
<local_constructDataFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x6,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe83(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_constructDataFileName>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x6,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s.%s.dat\00"
define i8* @local_constructDataFileName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 6
%12 = call i8* @xmalloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s.%s.dat\00"
define i8* @local_constructDataFileName(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 6
%6 = add i64 %5, %4
%7 = tail call i8* @xmalloc(i64 %6)
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %7, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %7
}
void RTAssertSetMayPanic(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAssertSetMayPanic() {
ret void
}
/* Variables and functions */
int dup(int);
int dup_socket(int sd) { return dup(sd); }


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

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

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

LLVM IR (-O2):
define i32 @dup_socket(i32 %0) {
%2 = tail call i32 @dup(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void (*)());
int atexit(void (*func)(void)) {
  printf("Warning: atexit(%p) ignored\n", func);
  return 0;
}


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

x86 assembly (clang, -O2):
<atexit>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Warning: atexit(%p) ignored\0A\00"
define i32 @atexit(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), void (...)* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Warning: atexit(%p) ignored\0A\00"
define i32 @atexit(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), void (...)* %2)
ret i32 0
}
/* Variables and functions */
char *strrchr(char *, char);
char *stripext(char *fname) {
  char *ext = strrchr(fname, '.');
  if (ext)
    *ext = '\0';
  return fname;
}


x86 assembly (clang, -O0):
<stripext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <stripext+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripext>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1126 <stripext+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @stripext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @stripext(i8* returned %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret i8* %0
}
void McASPSerializerInactivate(unsigned int baseAddr, unsigned int serNum) {
  (*((volatile unsigned int *)(baseAddr + (0x180 + (serNum * 4))))) &=
      ~(0x00000003u);
}


x86 assembly (clang, -O0):
<McASPSerializerInactivate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    $0x180,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffc,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPSerializerInactivate>:
lea    (%rdi,%rsi,4),%eax
add    $0x180,%eax
andl   $0xfffffffc,(%rax)
ret

LLVM IR (-O0):
define void @McASPSerializerInactivate(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 = mul i32 %6, 4
%8 = add i32 384, %7
%9 = add i32 %5, %8
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, -4
store volatile i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @McASPSerializerInactivate(i32 %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = add i32 %0, 384
%5 = add i32 %4, %3
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, -4
store volatile i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, unsigned int, char *, int, double);
void __ghdl_snprintf_nf(char *buf, unsigned int len, int ndigits, double val) {
  snprintf(buf, len, "%.*f", ndigits, val);
}


x86 assembly (clang, -O0):
<__ghdl_snprintf_nf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
lea    0xec3(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ghdl_snprintf_nf>:
mov    %edx,%ecx
lea    0xee7(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%.*f\00"
define void @__ghdl_snprintf_nf(i8* %0, i32 %1, i32 %2, double %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double %3, double* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load double, double* %8
%13 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11, double %12)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.*f\00"
define void @__ghdl_snprintf_nf(i8* %0, i32 %1, i32 %2, double %3) {
%5 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2, double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Example:\n-d /dev/ttyS0\n-b /sbin/sh\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Example:\0A-d /dev/ttyS0\0A-b /sbin/sh\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"Example:\0A-d /dev/ttyS0\0A-b /sbin/sh\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
void c_irq_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @c_irq_handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void search_match_handler(void *ctx, char *title, size_t title_len) {
  printf("%s\n", title);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @search_match_handler(i8* nocapture readnone %0, i8* %1, i64 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void INT_Excep_RAM_RAMERR(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_2_2_2_1() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint16_t load16(const void *in) {
  uint16_t v;
  memcpy(&v, in, sizeof v);
  return v;
}


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

x86 assembly (clang, -O2):
<load16>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @load16(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
int fun1267() { return 1267; }


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

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

LLVM IR (-O0):
define i32 @fun1267() {
ret i32 1267
}

LLVM IR (-O2):
define i32 @fun1267() {
ret i32 1267
}
/* Variables and functions */
int tolower(char const);
int str_to_hash(const char *str) {
  int hash = 0;
  const char *p;
  for (p = str; *p; p++)
    hash = tolower(*p) + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<str_to_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <str_to_hash+0x5b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112b <str_to_hash+0x1b>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_hash>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114d <str_to_hash+0x3d>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <tolower@plt>
imul   $0x1003f,%ebp,%ebp
add    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <str_to_hash+0x20>
jmp    114f <str_to_hash+0x3f>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @str_to_hash(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 = %22, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = call i32 @tolower(i8 signext %12)
%14 = load i32, i32* %3
%15 = shl i32 %14, 6
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %3
%18 = shl i32 %17, 16
%19 = add nsw i32 %16, %18
%20 = load i32, i32* %3
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %3
br label %22
22: ; preds = %10
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %6
25: ; preds = %6
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @str_to_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @tolower(i8 signext %5)
%9 = mul i32 %7, 65599
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int is_empty(char *text) { return strcmp(text, "") == 0; }


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @is_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @is_empty(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void fd279(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
a : {
  typedef int(*f)[n];
P02A:
  goto P02A;
  {
    typedef int(*g)[n];
  P024A:
    goto P024A;
    0;
  };
P02B:
  goto P02B;
  {
    typedef int(*h)[n];
  P025A:
    goto P025A;
    0;
  };
P02C:
  goto P02C;
  ;
  typedef int(*i)[n];
P026A:
  goto P026A;
  0;
};
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
p03B:
  goto p03B;
  goto a;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd279>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd279+0x7>

x86 assembly (clang, -O2):
<fd279>:
jmp    1100 <fd279>

LLVM IR (-O0):
define void @fd279(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; No predecessors!
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
br label %25
25: ; preds = %25, %22
br label %25
26: ; No predecessors!
%27 = load i32, i32* %2
%28 = zext i32 %27 to i64
br label %29
29: ; preds = %29, %26
br label %29
30: ; preds = %30
br label %30
31: ; No predecessors!
%32 = load i32, i32* %2
%33 = zext i32 %32 to i64
br label %34
34: ; preds = %34, %31
br label %34
35: ; preds = %35
br label %35
36: ; No predecessors!
%37 = load i32, i32* %2
%38 = zext i32 %37 to i64
br label %39
39: ; preds = %39, %36
br label %39
40: ; preds = %40
br label %40
41: ; No predecessors!
%42 = load i32, i32* %2
%43 = zext i32 %42 to i64
br label %44
44: ; preds = %44, %41
br label %44
45: ; preds = %45
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd279(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void XCloseIM() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_scanner_input_file() {
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=401 REPO_URL=heads/master REVISION=-10df89e "
         "CHANGED_REVISION=10df89e CHANGE_DATE=2015-12-27 11:49:52 +0300 "
         "BUILD_DATE=Вт. дек. 29 18:28:50 MSK 2015 BUILD=debug "
         "TARGET_PLATFORM= MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [402 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/master REVISION=-10df89e CHANGED_REVISION=10df89e CHANGE_DATE=2015-12-27 11:49:52 +0300 BUILD_DATE=\D0\92\D1\82. \D0\B4\D0\B5\D0\BA. 29 18:28:50 MSK 2015 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([402 x i8], [402 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [402 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/master REVISION=-10df89e CHANGED_REVISION=10df89e CHANGE_DATE=2015-12-27 11:49:52 +0300 BUILD_DATE=\D0\92\D1\82. \D0\B4\D0\B5\D0\BA. 29 18:28:50 MSK 2015 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([402 x i8], [402 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
void *realloc(void *ptr) { return ptr; }


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

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

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

LLVM IR (-O2):
define i8* @realloc(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
double calc_tree(struct tree *);
double op_sub(struct tree *left, struct tree *right) {
  return calc_tree(left) - calc_tree(right);
}


x86 assembly (clang, -O0):
<op_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calc_tree@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <calc_tree@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_sub>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <calc_tree@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <calc_tree@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tree = type { i32 }
define double @op_sub(%struct.tree* %0, %struct.tree* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %3
store %struct.tree* %1, %struct.tree** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = call double @calc_tree(%struct.tree* %5)
%7 = load %struct.tree*, %struct.tree** %4
%8 = call double @calc_tree(%struct.tree* %7)
%9 = fsub double %6, %8
ret double %9
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define double @op_sub(%struct.tree* %0, %struct.tree* %1) {
%3 = tail call double @calc_tree(%struct.tree* %0)
%4 = tail call double @calc_tree(%struct.tree* %1)
%5 = fsub double %3, %4
ret double %5
}
const char *func_str() {
  return "x"
         " "
         "*"
         " "
         "x"
         " "
         "*"
         " "
         "x";
}


x86 assembly (clang, -O0):
<func_str>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"x * x * x\00"
define i8* @func_str() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"x * x * x\00"
define i8* @func_str() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
void strOut(const char *s, int (*f)(char, void *), void *p) {
  while (*s)
    f(*s++, p);
}


x86 assembly (clang, -O0):
<strOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <strOut+0x44>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    (%rcx),%cl
mov    -0x18(%rbp),%rsi
movsbl %cl,%edi
call   *%rax
jmp    1114 <strOut+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strOut>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1134 <strOut+0x34>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    %r14,%rsi
call   *%r15
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strOut+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @strOut(i8* nocapture %0, i32 (i8, i8*)* nocapture %1, i8* %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = tail call i32 %1(i8 signext %7, i8* %2)
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_hexstr() {
  printf("NOT IMPLEMENTED:"
         "pa_hexstr"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"NOT IMPLEMENTED:pa_hexstr\00"
define i32 @pa_hexstr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 undef
}