#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
char *getenv(char *);
scalar_t__ mem_copy(char **, int *, char *);
int smm_config_path(int sysdir, char *path, char *fname, char *buf, int blen) {
  char *home;
  int len = 0;
  home = getenv("HOME");
  switch (sysdir) {
  case 1:
    if (home) {
      len += mem_copy(&buf, &blen, home);
      len += mem_copy(&buf, &blen, "/");
    }
    if (path) {
      len += mem_copy(&buf, &blen, path);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, fname);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "CONSOLE\\");
    if (path) {
      len += mem_copy(&buf, &blen, path);
    }
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "HKEY_CURRENT_USER");
    len += mem_copy(&buf, &blen, NULL);
    break;
  case 2:
    len += mem_copy(&buf, &blen, "/etc/");
    if (path) {
      len += mem_copy(&buf, &blen, path);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, fname);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "SOFTWARE\\");
    if (path) {
      len += mem_copy(&buf, &blen, path);
    }
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "HKEY_LOCAL_MACHINE");
    len += mem_copy(&buf, &blen, NULL);
    break;
  case 0:
    if (home) {
      len += mem_copy(&buf, &blen, home);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, ".config/");
    if (path) {
      len += mem_copy(&buf, &blen, path);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, fname);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "SOFTWARE\\");
    if (path) {
      len += mem_copy(&buf, &blen, path);
    }
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "HKEY_CURRENT_USER");
    len += mem_copy(&buf, &blen, NULL);
    break;
  case 3:
  default:
    if (path) {
      len += mem_copy(&buf, &blen, path);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, fname);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, NULL);
    break;
  }
  len += mem_copy(&buf, &blen, NULL);
  return len;
}


x86 assembly (clang, -O0):
<smm_config_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movl   $0x0,-0x34(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x40(%rbp)
sub    $0x3,%rax
ja     15e8 <smm_config_path+0x4c8>
mov    -0x40(%rbp),%rax
lea    0xe92(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpq   $0x0,-0x30(%rbp)
je     11c1 <smm_config_path+0xa1>
mov    -0x30(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xe85(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     120b <smm_config_path+0xeb>
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xe3b(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xdbf(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1291 <smm_config_path+0x171>
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xd60(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
jmp    16aa <smm_config_path+0x58a>
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xd2e(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     135e <smm_config_path+0x23e>
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xce8(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xc8d(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     13e4 <smm_config_path+0x2c4>
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xc2f(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
jmp    16aa <smm_config_path+0x58a>
cmpq   $0x0,-0x30(%rbp)
je     1490 <smm_config_path+0x370>
mov    -0x30(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xbb6(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xbb4(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     14fb <smm_config_path+0x3db>
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xb4b(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xaf0(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1581 <smm_config_path+0x461>
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xa70(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
jmp    16aa <smm_config_path+0x58a>
jmp    15e8 <smm_config_path+0x4c8>
cmpq   $0x0,-0x10(%rbp)
je     1632 <smm_config_path+0x512>
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    0xa14(%rip),%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smm_config_path>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebx
mov    %rcx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0xeb9(%rip),%rdi
call   1030 <getenv@plt>
test   %ebx,%ebx
je     127b <smm_config_path+0x15b>
cmp    $0x2,%ebx
je     12bb <smm_config_path+0x19b>
cmp    $0x1,%ebx
jne    13b6 <smm_config_path+0x296>
test   %rax,%rax
je     13f6 <smm_config_path+0x2d6>
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rax,%rdx
call   1040 <mem_copy@plt>
mov    %rax,%r13
lea    0xe93(%rip),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rbp
add    %r13d,%ebp
test   %r15,%r15
je     11d7 <smm_config_path+0xb7>
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%r13
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1040 <mem_copy@plt>
add    %eax,%ebp
lea    0xe5c(%rip),%rdx
mov    %r12,%rdi
mov    %r13,%rsi
call   1040 <mem_copy@plt>
add    %ebp,%eax
mov    %eax,%ebp
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%r13
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %ebp,%ebx
mov    %r12,%rdi
mov    %r13,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rbp
add    %ebx,%ebp
lea    0xdf8(%rip),%rdx
mov    %r12,%rdi
mov    %r13,%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %ebp,%ebx
test   %r15,%r15
je     1236 <smm_config_path+0x116>
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %r15,%rdx
call   1040 <mem_copy@plt>
add    %eax,%ebx
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rbp
add    %ebx,%ebp
lea    0xdb5(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %ebp,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
jmp    155b <smm_config_path+0x43b>
test   %rax,%rax
je     1406 <smm_config_path+0x2e6>
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%rbp
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %rax,%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rbx
lea    0xd7e(%rip),%rdx
mov    %r12,%rdi
mov    %rbp,%rsi
call   1040 <mem_copy@plt>
add    %ebx,%eax
movslq %eax,%rbp
jmp    1408 <smm_config_path+0x2e8>
lea    0xd5e(%rip),%rdx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rbp
test   %r15,%r15
je     130b <smm_config_path+0x1eb>
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1040 <mem_copy@plt>
add    %eax,%ebp
lea    0xd2a(%rip),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <mem_copy@plt>
movslq %ebp,%rbp
add    %rax,%rbp
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%r12
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %rbp,%rbx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rbp
add    %rbx,%rbp
lea    0xce3(%rip),%rdx
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %rbp,%rbx
test   %r15,%r15
je     1371 <smm_config_path+0x251>
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %r15,%rdx
call   1040 <mem_copy@plt>
movslq %ebx,%rbx
add    %rax,%rbx
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
add    %eax,%ebx
lea    0xc9f(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rbp
add    %ebx,%ebp
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
movslq %ebp,%rbx
jmp    155b <smm_config_path+0x43b>
test   %r15,%r15
je     150b <smm_config_path+0x3eb>
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%rbp
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rbx
lea    0xc43(%rip),%rdx
mov    %r12,%rdi
mov    %rbp,%rsi
call   1040 <mem_copy@plt>
add    %ebx,%eax
movslq %eax,%rbx
jmp    150d <smm_config_path+0x3ed>
xor    %ebp,%ebp
test   %r15,%r15
jne    11a7 <smm_config_path+0x87>
jmp    11d7 <smm_config_path+0xb7>
xor    %ebp,%ebp
lea    0xc34(%rip),%rdx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %rbp,%rbx
test   %r15,%r15
je     145b <smm_config_path+0x33b>
lea    0x10(%rsp),%rbp
lea    0xc(%rsp),%r12
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1040 <mem_copy@plt>
add    %eax,%ebx
lea    0xbda(%rip),%rdx
mov    %rbp,%rdi
mov    %r12,%rsi
call   1040 <mem_copy@plt>
movslq %ebx,%rbx
add    %rax,%rbx
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%r12
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1040 <mem_copy@plt>
mov    %rax,%rbp
add    %rbx,%rbp
mov    %r13,%rdi
mov    %r12,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %rbp,%rbx
lea    0xb93(%rip),%rdx
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rbp
add    %rbx,%rbp
test   %r15,%r15
je     14c1 <smm_config_path+0x3a1>
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %r15,%rdx
call   1040 <mem_copy@plt>
movslq %ebp,%rbp
add    %rax,%rbp
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %rbp,%rbx
lea    0xb29(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <mem_copy@plt>
mov    %rax,%rbp
add    %rbx,%rbp
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %rbp,%rbx
jmp    155e <smm_config_path+0x43e>
xor    %ebx,%ebx
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%r15
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <mem_copy@plt>
add    %eax,%ebx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rbp
add    %ebx,%ebp
mov    %r12,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
mov    %rax,%rbx
add    %ebp,%ebx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
movslq %ebx,%rbx
add    %rax,%rbx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
xor    %edx,%edx
call   1040 <mem_copy@plt>
add    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [9 x i8] c"CONSOLE\\\00"
@.str.3 = [18 x i8] c"HKEY_CURRENT_USER\00"
@.str.4 = [6 x i8] c"/etc/\00"
@.str.5 = [10 x i8] c"SOFTWARE\\\00"
@.str.6 = [19 x i8] c"HKEY_LOCAL_MACHINE\00"
@.str.7 = [9 x i8] c".config/\00"
define i32 @smm_config_path(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
store i32 0, i32* %12
%13 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %13, i8** %11
%14 = load i32, i32* %6
switch i32 %14, label %227 [
i32 1, label %15
i32 2, label %87
i32 0, label %149
i32 3, label %226
]
15: ; preds = %5
%16 = load i8*, i8** %11
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %30
18: ; preds = %15
%19 = load i8*, i8** %11
%20 = call i64 @mem_copy(i8** %9, i32* %10, i8* %19)
%21 = load i32, i32* %12
%22 = sext i32 %21 to i64
%23 = add nsw i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %12
%25 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%26 = load i32, i32* %12
%27 = sext i32 %26 to i64
%28 = add nsw i64 %27, %25
%29 = trunc i64 %28 to i32
store i32 %29, i32* %12
br label %30
30: ; preds = %18, %15
%31 = load i8*, i8** %7
%32 = icmp ne i8* %31, null
br i1 %32, label %33, label %45
33: ; preds = %30
%34 = load i8*, i8** %7
%35 = call i64 @mem_copy(i8** %9, i32* %10, i8* %34)
%36 = load i32, i32* %12
%37 = sext i32 %36 to i64
%38 = add nsw i64 %37, %35
%39 = trunc i64 %38 to i32
store i32 %39, i32* %12
%40 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%41 = load i32, i32* %12
%42 = sext i32 %41 to i64
%43 = add nsw i64 %42, %40
%44 = trunc i64 %43 to i32
store i32 %44, i32* %12
br label %45
45: ; preds = %33, %30
%46 = load i8*, i8** %8
%47 = call i64 @mem_copy(i8** %9, i32* %10, i8* %46)
%48 = load i32, i32* %12
%49 = sext i32 %48 to i64
%50 = add nsw i64 %49, %47
%51 = trunc i64 %50 to i32
store i32 %51, i32* %12
%52 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%53 = load i32, i32* %12
%54 = sext i32 %53 to i64
%55 = add nsw i64 %54, %52
%56 = trunc i64 %55 to i32
store i32 %56, i32* %12
%57 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%58 = load i32, i32* %12
%59 = sext i32 %58 to i64
%60 = add nsw i64 %59, %57
%61 = trunc i64 %60 to i32
store i32 %61, i32* %12
%62 = load i8*, i8** %7
%63 = icmp ne i8* %62, null
br i1 %63, label %64, label %71
64: ; preds = %45
%65 = load i8*, i8** %7
%66 = call i64 @mem_copy(i8** %9, i32* %10, i8* %65)
%67 = load i32, i32* %12
%68 = sext i32 %67 to i64
%69 = add nsw i64 %68, %66
%70 = trunc i64 %69 to i32
store i32 %70, i32* %12
br label %71
71: ; preds = %64, %45
%72 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%73 = load i32, i32* %12
%74 = sext i32 %73 to i64
%75 = add nsw i64 %74, %72
%76 = trunc i64 %75 to i32
store i32 %76, i32* %12
%77 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%78 = load i32, i32* %12
%79 = sext i32 %78 to i64
%80 = add nsw i64 %79, %77
%81 = trunc i64 %80 to i32
store i32 %81, i32* %12
%82 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%83 = load i32, i32* %12
%84 = sext i32 %83 to i64
%85 = add nsw i64 %84, %82
%86 = trunc i64 %85 to i32
store i32 %86, i32* %12
br label %264
87: ; preds = %5
%88 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%89 = load i32, i32* %12
%90 = sext i32 %89 to i64
%91 = add nsw i64 %90, %88
%92 = trunc i64 %91 to i32
store i32 %92, i32* %12
%93 = load i8*, i8** %7
%94 = icmp ne i8* %93, null
br i1 %94, label %95, label %107
95: ; preds = %87
%96 = load i8*, i8** %7
%97 = call i64 @mem_copy(i8** %9, i32* %10, i8* %96)
%98 = load i32, i32* %12
%99 = sext i32 %98 to i64
%100 = add nsw i64 %99, %97
%101 = trunc i64 %100 to i32
store i32 %101, i32* %12
%102 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%103 = load i32, i32* %12
%104 = sext i32 %103 to i64
%105 = add nsw i64 %104, %102
%106 = trunc i64 %105 to i32
store i32 %106, i32* %12
br label %107
107: ; preds = %95, %87
%108 = load i8*, i8** %8
%109 = call i64 @mem_copy(i8** %9, i32* %10, i8* %108)
%110 = load i32, i32* %12
%111 = sext i32 %110 to i64
%112 = add nsw i64 %111, %109
%113 = trunc i64 %112 to i32
store i32 %113, i32* %12
%114 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%115 = load i32, i32* %12
%116 = sext i32 %115 to i64
%117 = add nsw i64 %116, %114
%118 = trunc i64 %117 to i32
store i32 %118, i32* %12
%119 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%120 = load i32, i32* %12
%121 = sext i32 %120 to i64
%122 = add nsw i64 %121, %119
%123 = trunc i64 %122 to i32
store i32 %123, i32* %12
%124 = load i8*, i8** %7
%125 = icmp ne i8* %124, null
br i1 %125, label %126, label %133
126: ; preds = %107
%127 = load i8*, i8** %7
%128 = call i64 @mem_copy(i8** %9, i32* %10, i8* %127)
%129 = load i32, i32* %12
%130 = sext i32 %129 to i64
%131 = add nsw i64 %130, %128
%132 = trunc i64 %131 to i32
store i32 %132, i32* %12
br label %133
133: ; preds = %126, %107
%134 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%135 = load i32, i32* %12
%136 = sext i32 %135 to i64
%137 = add nsw i64 %136, %134
%138 = trunc i64 %137 to i32
store i32 %138, i32* %12
%139 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%140 = load i32, i32* %12
%141 = sext i32 %140 to i64
%142 = add nsw i64 %141, %139
%143 = trunc i64 %142 to i32
store i32 %143, i32* %12
%144 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%145 = load i32, i32* %12
%146 = sext i32 %145 to i64
%147 = add nsw i64 %146, %144
%148 = trunc i64 %147 to i32
store i32 %148, i32* %12
br label %264
149: ; preds = %5
%150 = load i8*, i8** %11
%151 = icmp ne i8* %150, null
br i1 %151, label %152, label %164
152: ; preds = %149
%153 = load i8*, i8** %11
%154 = call i64 @mem_copy(i8** %9, i32* %10, i8* %153)
%155 = load i32, i32* %12
%156 = sext i32 %155 to i64
%157 = add nsw i64 %156, %154
%158 = trunc i64 %157 to i32
store i32 %158, i32* %12
%159 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%160 = load i32, i32* %12
%161 = sext i32 %160 to i64
%162 = add nsw i64 %161, %159
%163 = trunc i64 %162 to i32
store i32 %163, i32* %12
br label %164
164: ; preds = %152, %149
%165 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%166 = load i32, i32* %12
%167 = sext i32 %166 to i64
%168 = add nsw i64 %167, %165
%169 = trunc i64 %168 to i32
store i32 %169, i32* %12
%170 = load i8*, i8** %7
%171 = icmp ne i8* %170, null
br i1 %171, label %172, label %184
172: ; preds = %164
%173 = load i8*, i8** %7
%174 = call i64 @mem_copy(i8** %9, i32* %10, i8* %173)
%175 = load i32, i32* %12
%176 = sext i32 %175 to i64
%177 = add nsw i64 %176, %174
%178 = trunc i64 %177 to i32
store i32 %178, i32* %12
%179 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%180 = load i32, i32* %12
%181 = sext i32 %180 to i64
%182 = add nsw i64 %181, %179
%183 = trunc i64 %182 to i32
store i32 %183, i32* %12
br label %184
184: ; preds = %172, %164
%185 = load i8*, i8** %8
%186 = call i64 @mem_copy(i8** %9, i32* %10, i8* %185)
%187 = load i32, i32* %12
%188 = sext i32 %187 to i64
%189 = add nsw i64 %188, %186
%190 = trunc i64 %189 to i32
store i32 %190, i32* %12
%191 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%192 = load i32, i32* %12
%193 = sext i32 %192 to i64
%194 = add nsw i64 %193, %191
%195 = trunc i64 %194 to i32
store i32 %195, i32* %12
%196 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%197 = load i32, i32* %12
%198 = sext i32 %197 to i64
%199 = add nsw i64 %198, %196
%200 = trunc i64 %199 to i32
store i32 %200, i32* %12
%201 = load i8*, i8** %7
%202 = icmp ne i8* %201, null
br i1 %202, label %203, label %210
203: ; preds = %184
%204 = load i8*, i8** %7
%205 = call i64 @mem_copy(i8** %9, i32* %10, i8* %204)
%206 = load i32, i32* %12
%207 = sext i32 %206 to i64
%208 = add nsw i64 %207, %205
%209 = trunc i64 %208 to i32
store i32 %209, i32* %12
br label %210
210: ; preds = %203, %184
%211 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%212 = load i32, i32* %12
%213 = sext i32 %212 to i64
%214 = add nsw i64 %213, %211
%215 = trunc i64 %214 to i32
store i32 %215, i32* %12
%216 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%217 = load i32, i32* %12
%218 = sext i32 %217 to i64
%219 = add nsw i64 %218, %216
%220 = trunc i64 %219 to i32
store i32 %220, i32* %12
%221 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%222 = load i32, i32* %12
%223 = sext i32 %222 to i64
%224 = add nsw i64 %223, %221
%225 = trunc i64 %224 to i32
store i32 %225, i32* %12
br label %264
226: ; preds = %5
br label %227
227: ; preds = %5, %226
%228 = load i8*, i8** %7
%229 = icmp ne i8* %228, null
br i1 %229, label %230, label %242
230: ; preds = %227
%231 = load i8*, i8** %7
%232 = call i64 @mem_copy(i8** %9, i32* %10, i8* %231)
%233 = load i32, i32* %12
%234 = sext i32 %233 to i64
%235 = add nsw i64 %234, %232
%236 = trunc i64 %235 to i32
store i32 %236, i32* %12
%237 = call i64 @mem_copy(i8** %9, i32* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%238 = load i32, i32* %12
%239 = sext i32 %238 to i64
%240 = add nsw i64 %239, %237
%241 = trunc i64 %240 to i32
store i32 %241, i32* %12
br label %242
242: ; preds = %230, %227
%243 = load i8*, i8** %8
%244 = call i64 @mem_copy(i8** %9, i32* %10, i8* %243)
%245 = load i32, i32* %12
%246 = sext i32 %245 to i64
%247 = add nsw i64 %246, %244
%248 = trunc i64 %247 to i32
store i32 %248, i32* %12
%249 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%250 = load i32, i32* %12
%251 = sext i32 %250 to i64
%252 = add nsw i64 %251, %249
%253 = trunc i64 %252 to i32
store i32 %253, i32* %12
%254 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%255 = load i32, i32* %12
%256 = sext i32 %255 to i64
%257 = add nsw i64 %256, %254
%258 = trunc i64 %257 to i32
store i32 %258, i32* %12
%259 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%260 = load i32, i32* %12
%261 = sext i32 %260 to i64
%262 = add nsw i64 %261, %259
%263 = trunc i64 %262 to i32
store i32 %263, i32* %12
br label %264
264: ; preds = %242, %210, %133, %71
%265 = call i64 @mem_copy(i8** %9, i32* %10, i8* null)
%266 = load i32, i32* %12
%267 = sext i32 %266 to i64
%268 = add nsw i64 %267, %265
%269 = trunc i64 %268 to i32
store i32 %269, i32* %12
%270 = load i32, i32* %12
ret i32 %270
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [9 x i8] c"CONSOLE\\\00"
@.str.3 = [18 x i8] c"HKEY_CURRENT_USER\00"
@.str.4 = [6 x i8] c"/etc/\00"
@.str.5 = [10 x i8] c"SOFTWARE\\\00"
@.str.6 = [19 x i8] c"HKEY_LOCAL_MACHINE\00"
@.str.7 = [9 x i8] c".config/\00"
define i32 @smm_config_path(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
store i8* %3, i8** %6
store i32 %4, i32* %7
%8 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %0, label %126 [
i32 1, label %9
i32 2, label %52
i32 0, label %85
]
9: ; preds = %5
%10 = icmp eq i8* %8, null
br i1 %10, label %16, label %11
11: ; preds = %9
%12 = call i64 @mem_copy(i8** %6, i32* %7, i8* %8)
%13 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = add i64 %13, %12
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %11, %9
%17 = phi i32 [ %15, %11 ], [ 0, %9 ]
%18 = icmp eq i8* %1, null
br i1 %18, label %26, label %19
19: ; preds = %16
%20 = call i64 @mem_copy(i8** %6, i32* %7, i8* %1)
%21 = trunc i64 %20 to i32
%22 = add i32 %17, %21
%23 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = trunc i64 %23 to i32
%25 = add i32 %22, %24
br label %26
26: ; preds = %19, %16
%27 = phi i32 [ %25, %19 ], [ %17, %16 ]
%28 = call i64 @mem_copy(i8** %6, i32* %7, i8* %2)
%29 = trunc i64 %28 to i32
%30 = add i32 %27, %29
%31 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%32 = trunc i64 %31 to i32
%33 = add i32 %30, %32
%34 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%35 = trunc i64 %34 to i32
%36 = add i32 %33, %35
br i1 %18, label %41, label %37
37: ; preds = %26
%38 = call i64 @mem_copy(i8** %6, i32* %7, i8* %1)
%39 = trunc i64 %38 to i32
%40 = add i32 %36, %39
br label %41
41: ; preds = %37, %26
%42 = phi i32 [ %40, %37 ], [ %36, %26 ]
%43 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%44 = trunc i64 %43 to i32
%45 = add i32 %42, %44
%46 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%47 = trunc i64 %46 to i32
%48 = add i32 %45, %47
%49 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%50 = zext i32 %48 to i64
%51 = add i64 %49, %50
br label %146
52: ; preds = %5
%53 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%54 = icmp eq i8* %1, null
br i1 %54, label %62, label %55
55: ; preds = %52
%56 = call i64 @mem_copy(i8** %6, i32* %7, i8* %1)
%57 = add i64 %56, %53
%58 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%59 = shl i64 %57, 32
%60 = ashr exact i64 %59, 32
%61 = add nsw i64 %60, %58
br label %62
62: ; preds = %55, %52
%63 = phi i64 [ %61, %55 ], [ %53, %52 ]
%64 = call i64 @mem_copy(i8** %6, i32* %7, i8* %2)
%65 = add i64 %64, %63
%66 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%67 = add i64 %65, %66
%68 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%69 = add i64 %67, %68
br i1 %54, label %75, label %70
70: ; preds = %62
%71 = call i64 @mem_copy(i8** %6, i32* %7, i8* %1)
%72 = shl i64 %69, 32
%73 = ashr exact i64 %72, 32
%74 = add nsw i64 %71, %73
br label %75
75: ; preds = %70, %62
%76 = phi i64 [ %74, %70 ], [ %69, %62 ]
%77 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%78 = add i64 %77, %76
%79 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%80 = add i64 %78, %79
%81 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%82 = shl i64 %80, 32
%83 = ashr exact i64 %82, 32
%84 = add nsw i64 %83, %81
br label %146
85: ; preds = %5
%86 = icmp eq i8* %8, null
br i1 %86, label %93, label %87
87: ; preds = %85
%88 = call i64 @mem_copy(i8** %6, i32* %7, i8* %8)
%89 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%90 = add i64 %89, %88
%91 = shl i64 %90, 32
%92 = ashr exact i64 %91, 32
br label %93
93: ; preds = %87, %85
%94 = phi i64 [ %92, %87 ], [ 0, %85 ]
%95 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%96 = add nsw i64 %95, %94
%97 = icmp eq i8* %1, null
br i1 %97, label %105, label %98
98: ; preds = %93
%99 = call i64 @mem_copy(i8** %6, i32* %7, i8* %1)
%100 = add i64 %99, %96
%101 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%102 = shl i64 %100, 32
%103 = ashr exact i64 %102, 32
%104 = add nsw i64 %103, %101
br label %105
105: ; preds = %98, %93
%106 = phi i64 [ %104, %98 ], [ %96, %93 ]
%107 = call i64 @mem_copy(i8** %6, i32* %7, i8* %2)
%108 = add i64 %107, %106
%109 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%110 = add i64 %108, %109
%111 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%112 = add i64 %110, %111
br i1 %97, label %118, label %113
113: ; preds = %105
%114 = call i64 @mem_copy(i8** %6, i32* %7, i8* %1)
%115 = shl i64 %112, 32
%116 = ashr exact i64 %115, 32
%117 = add nsw i64 %114, %116
br label %118
118: ; preds = %113, %105
%119 = phi i64 [ %117, %113 ], [ %112, %105 ]
%120 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%121 = add i64 %120, %119
%122 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%123 = add i64 %121, %122
%124 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%125 = add i64 %123, %124
br label %146
126: ; preds = %5
%127 = icmp eq i8* %1, null
br i1 %127, label %134, label %128
128: ; preds = %126
%129 = call i64 @mem_copy(i8** %6, i32* %7, i8* %1)
%130 = call i64 @mem_copy(i8** %6, i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%131 = add i64 %130, %129
%132 = shl i64 %131, 32
%133 = ashr exact i64 %132, 32
br label %134
134: ; preds = %128, %126
%135 = phi i64 [ %133, %128 ], [ 0, %126 ]
%136 = call i64 @mem_copy(i8** %6, i32* %7, i8* %2)
%137 = add nsw i64 %136, %135
%138 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%139 = add i64 %137, %138
%140 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%141 = add i64 %139, %140
%142 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%143 = shl i64 %141, 32
%144 = ashr exact i64 %143, 32
%145 = add nsw i64 %144, %142
br label %146
146: ; preds = %134, %118, %75, %41
%147 = phi i64 [ %145, %134 ], [ %125, %118 ], [ %84, %75 ], [ %51, %41 ]
%148 = call i64 @mem_copy(i8** %6, i32* %7, i8* null)
%149 = add i64 %148, %147
%150 = trunc i64 %149 to i32
ret i32 %150
}