#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 */
int EINVAL;
int ENOMEM;
int /*<<< orphan*/ format_lun_number(char const *, char **);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ path_prepend(char **, char *, char *, char *);
char *strdup(char const *);
int strlen(char *);
int vdev_sysfs_get_parent_device(char *, char **, size_t *);
int vdev_sysfs_get_parent_with_subsystem_devtype(char const *, char *, char *,
                                                 char **, size_t *);
int vdev_sysfs_read_attr(char *, char *, char **, size_t *);
int handle_scsi_hyperv(char const *parent, char **path, char **new_parent) {
  char *hostdev = NULL;
  size_t hostdev_len = 0;
  char *vmbusdev = NULL;
  size_t vmbusdev_len = 0;
  char *guid_str = NULL;
  size_t guid_str_len = 0;
  char *lun = NULL;
  char guid[38];
  memset(guid, 0, 38);
  size_t i = 0;
  size_t k = 0;
  int rc = 0;
  rc = vdev_sysfs_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host",
                                                    &hostdev, &hostdev_len);
  if (rc != 0) {
    return rc;
  }
  rc = vdev_sysfs_get_parent_device(hostdev, &vmbusdev, &vmbusdev_len);
  if (rc != 0) {
    free(hostdev);
    return rc;
  }
  rc = vdev_sysfs_read_attr(vmbusdev, "device_id", &guid_str, &guid_str_len);
  free(hostdev);
  free(vmbusdev);
  if (rc != 0) {
    return rc;
  }
  if (strlen(guid_str) < 37 || guid_str[0] != '{' || guid_str[36] != '}') {
    return -EINVAL;
  }
  for (i = 0, k = 0; i < 36; i++) {
    if (guid_str[i] == '-') {
      continue;
    }
    guid[k] = guid_str[i];
    k++;
  }
  guid[k] = '\0';
  format_lun_number(parent, &lun);
  path_prepend(path, "vmbus-%s-%s", guid, lun);
  if (lun != NULL) {
    free(lun);
  }
  *new_parent = strdup(parent);
  if (*new_parent == NULL) {
    return -ENOMEM;
  }
  return 0;
}


x86 assembly (clang, -O0):
<handle_scsi_hyperv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x26,%edx
call   1060 <memset@plt>
movq   $0x0,-0x88(%rbp)
movq   $0x0,-0x90(%rbp)
movl   $0x0,-0x94(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xde6(%rip),%rsi
lea    0xde4(%rip),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
call   1070 <vdev_sysfs_get_parent_with_subsystem_devtype@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
je     124f <handle_scsi_hyperv+0xbf>
mov    -0x94(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    141e <handle_scsi_hyperv+0x28e>
mov    -0x28(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   10a0 <vdev_sysfs_get_parent_device@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
je     128a <handle_scsi_hyperv+0xfa>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0x94(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    141e <handle_scsi_hyperv+0x28e>
mov    -0x38(%rbp),%rdi
lea    0xd7a(%rip),%rsi
lea    -0x48(%rbp),%rdx
lea    -0x50(%rbp),%rcx
call   1080 <vdev_sysfs_read_attr@plt>
mov    %eax,-0x94(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0x38(%rbp),%rdi
call   1040 <free@plt>
cmpl   $0x0,-0x94(%rbp)
je     12d5 <handle_scsi_hyperv+0x145>
mov    -0x94(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    141e <handle_scsi_hyperv+0x28e>
mov    -0x48(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x25,%eax
jl     1308 <handle_scsi_hyperv+0x178>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7b,%eax
jne    1308 <handle_scsi_hyperv+0x178>
mov    -0x48(%rbp),%rax
movsbl 0x24(%rax),%eax
cmp    $0x7d,%eax
je     131b <handle_scsi_hyperv+0x18b>
xor    %eax,%eax
mov    0x2cc7(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    141e <handle_scsi_hyperv+0x28e>
movq   $0x0,-0x88(%rbp)
movq   $0x0,-0x90(%rbp)
cmpq   $0x24,-0x88(%rbp)
24
jae    139e <handle_scsi_hyperv+0x20e>
mov    -0x48(%rbp),%rax
mov    -0x88(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    135c <handle_scsi_hyperv+0x1cc>
jmp    1387 <handle_scsi_hyperv+0x1f7>
mov    -0x48(%rbp),%rax
mov    -0x88(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x90(%rbp),%rax
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    1331 <handle_scsi_hyperv+0x1a1>
mov    -0x90(%rbp),%rax
movb   $0x0,-0x80(%rbp,%rax,1)
mov    -0x10(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1090 <format_lun_number@plt>
mov    -0x18(%rbp),%rdi
lea    -0x80(%rbp),%rdx
mov    -0x58(%rbp),%rcx
lea    0xc4f(%rip),%rsi
call   1030 <path_prepend@plt>
cmpq   $0x0,-0x58(%rbp)
je     13e3 <handle_scsi_hyperv+0x253>
mov    -0x58(%rbp),%rdi
call   1040 <free@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1417 <handle_scsi_hyperv+0x287>
xor    %eax,%eax
mov    0x2bd3(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    141e <handle_scsi_hyperv+0x28e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_scsi_hyperv>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movq   $0x0,0x8(%rsp)
movq   $0x0,0x38(%rsp)
movq   $0x0,0x20(%rsp)
movq   $0x0,0x30(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x28(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x40(%rsp),%rdi
xor    %esi,%esi
mov    $0x26,%edx
call   1060 <memset@plt>
lea    0xe06(%rip),%rsi
lea    0xe04(%rip),%rdx
lea    0x8(%rsp),%rcx
lea    0x38(%rsp),%r8
mov    %rbx,%rdi
call   1070 <vdev_sysfs_get_parent_with_subsystem_devtype@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    12df <handle_scsi_hyperv+0x14f>
mov    0x8(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x30(%rsp),%rdx
call   10a0 <vdev_sysfs_get_parent_device@plt>
test   %eax,%eax
je     1246 <handle_scsi_hyperv+0xb6>
mov    %eax,%ebp
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
jmp    12df <handle_scsi_hyperv+0x14f>
mov    0x20(%rsp),%rdi
lea    0xdbd(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x28(%rsp),%rcx
call   1080 <vdev_sysfs_read_attr@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
mov    0x20(%rsp),%rdi
call   1040 <free@plt>
test   %ebp,%ebp
jne    12df <handle_scsi_hyperv+0x14f>
mov    0x18(%rsp),%rdi
call   1050 <strlen@plt>
cmp    $0x25,%eax
jl     12d4 <handle_scsi_hyperv+0x144>
mov    0x18(%rsp),%rsi
cmpb   $0x7b,(%rsi)
jne    12d4 <handle_scsi_hyperv+0x144>
cmpb   $0x7d,0x24(%rsi)
jne    12d4 <handle_scsi_hyperv+0x144>
mov    $0x7b,%al
mov    $0x2,%edx
xor    %ecx,%ecx
cmp    $0x2d,%al
je     12af <handle_scsi_hyperv+0x11f>
mov    %al,0x40(%rsp,%rcx,1)
add    $0x1,%rcx
movzbl -0x1(%rsi,%rdx,1),%eax
cmp    $0x2d,%al
je     12c0 <handle_scsi_hyperv+0x130>
mov    %al,0x40(%rsp,%rcx,1)
add    $0x1,%rcx
cmp    $0x24,%rdx
je     12ec <handle_scsi_hyperv+0x15c>
movzbl (%rsi,%rdx,1),%eax
add    $0x2,%rdx
cmp    $0x2d,%al
jne    12a7 <handle_scsi_hyperv+0x117>
jmp    12af <handle_scsi_hyperv+0x11f>
mov    0x2cfd(%rip),%rax
xor    %ebp,%ebp
sub    (%rax),%ebp
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
movb   $0x0,0x40(%rsp,%rcx,1)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <format_lun_number@plt>
mov    0x10(%rsp),%rcx
lea    0xd0f(%rip),%rsi
lea    0x40(%rsp),%rdx
mov    %r15,%rdi
call   1030 <path_prepend@plt>
mov    0x10(%rsp),%rdi
test   %rdi,%rdi
je     1326 <handle_scsi_hyperv+0x196>
call   1040 <free@plt>
mov    %rbx,%rdi
call   10b0 <strdup@plt>
mov    %rax,(%r14)
xor    %ebp,%ebp
test   %rax,%rax
jne    12df <handle_scsi_hyperv+0x14f>
mov    0x2ca1(%rip),%rax
jmp    12db <handle_scsi_hyperv+0x14b>

LLVM IR (-O0):
@.str = [5 x i8] c"scsi\00"
@.str.1 = [10 x i8] c"scsi_host\00"
@.str.2 = [10 x i8] c"device_id\00"
@EINVAL = global i32 0
@.str.3 = [12 x i8] c"vmbus-%s-%s\00"
@ENOMEM = global i32 0
define i32 @handle_scsi_hyperv(i8* %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca [38 x i8]
%16 = alloca i64
%17 = alloca i64
%18 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i8* null, i8** %8
store i64 0, i64* %9
store i8* null, i8** %10
store i64 0, i64* %11
store i8* null, i8** %12
store i64 0, i64* %13
store i8* null, i8** %14
%19 = getelementptr inbounds [38 x i8], [38 x i8]* %15, i64 0, i64 0
%20 = call i32 @memset(i8* %19, i32 0, i32 38)
store i64 0, i64* %16
store i64 0, i64* %17
store i32 0, i32* %18
%21 = load i8*, i8** %5
%22 = call i32 @vdev_sysfs_get_parent_with_subsystem_devtype(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %8, i64* %9)
store i32 %22, i32* %18
%23 = load i32, i32* %18
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %3
%26 = load i32, i32* %18
store i32 %26, i32* %4
br label %115
27: ; preds = %3
%28 = load i8*, i8** %8
%29 = call i32 @vdev_sysfs_get_parent_device(i8* %28, i8** %10, i64* %11)
store i32 %29, i32* %18
%30 = load i32, i32* %18
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %27
%33 = load i8*, i8** %8
%34 = call i32 @free(i8* %33)
%35 = load i32, i32* %18
store i32 %35, i32* %4
br label %115
36: ; preds = %27
%37 = load i8*, i8** %10
%38 = call i32 @vdev_sysfs_read_attr(i8* %37, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %12, i64* %13)
store i32 %38, i32* %18
%39 = load i8*, i8** %8
%40 = call i32 @free(i8* %39)
%41 = load i8*, i8** %10
%42 = call i32 @free(i8* %41)
%43 = load i32, i32* %18
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %36
%46 = load i32, i32* %18
store i32 %46, i32* %4
br label %115
47: ; preds = %36
%48 = load i8*, i8** %12
%49 = call i32 @strlen(i8* %48)
%50 = icmp slt i32 %49, 37
br i1 %50, label %63, label %51
51: ; preds = %47
%52 = load i8*, i8** %12
%53 = getelementptr inbounds i8, i8* %52, i64 0
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp ne i32 %55, 123
br i1 %56, label %63, label %57
57: ; preds = %51
%58 = load i8*, i8** %12
%59 = getelementptr inbounds i8, i8* %58, i64 36
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp ne i32 %61, 125
br i1 %62, label %63, label %66
63: ; preds = %57, %51, %47
%64 = load i32, i32* @EINVAL
%65 = sub nsw i32 0, %64
store i32 %65, i32* %4
br label %115
66: ; preds = %57
store i64 0, i64* %16
store i64 0, i64* %17
br label %67
67: ; preds = %87, %66
%68 = load i64, i64* %16
%69 = icmp ult i64 %68, 36
br i1 %69, label %70, label %90
70: ; preds = %67
%71 = load i8*, i8** %12
%72 = load i64, i64* %16
%73 = getelementptr inbounds i8, i8* %71, i64 %72
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 45
br i1 %76, label %77, label %78
77: ; preds = %70
br label %87
78: ; preds = %70
%79 = load i8*, i8** %12
%80 = load i64, i64* %16
%81 = getelementptr inbounds i8, i8* %79, i64 %80
%82 = load i8, i8* %81
%83 = load i64, i64* %17
%84 = getelementptr inbounds [38 x i8], [38 x i8]* %15, i64 0, i64 %83
store i8 %82, i8* %84
%85 = load i64, i64* %17
%86 = add i64 %85, 1
store i64 %86, i64* %17
br label %87
87: ; preds = %78, %77
%88 = load i64, i64* %16
%89 = add i64 %88, 1
store i64 %89, i64* %16
br label %67
90: ; preds = %67
%91 = load i64, i64* %17
%92 = getelementptr inbounds [38 x i8], [38 x i8]* %15, i64 0, i64 %91
store i8 0, i8* %92
%93 = load i8*, i8** %5
%94 = call i32 @format_lun_number(i8* %93, i8** %14)
%95 = load i8**, i8*** %6
%96 = getelementptr inbounds [38 x i8], [38 x i8]* %15, i64 0, i64 0
%97 = load i8*, i8** %14
%98 = call i32 @path_prepend(i8** %95, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %96, i8* %97)
%99 = load i8*, i8** %14
%100 = icmp ne i8* %99, null
br i1 %100, label %101, label %104
101: ; preds = %90
%102 = load i8*, i8** %14
%103 = call i32 @free(i8* %102)
br label %104
104: ; preds = %101, %90
%105 = load i8*, i8** %5
%106 = call i8* @strdup(i8* %105)
%107 = load i8**, i8*** %7
store i8* %106, i8** %107
%108 = load i8**, i8*** %7
%109 = load i8*, i8** %108
%110 = icmp eq i8* %109, null
br i1 %110, label %111, label %114
111: ; preds = %104
%112 = load i32, i32* @ENOMEM
%113 = sub nsw i32 0, %112
store i32 %113, i32* %4
br label %115
114: ; preds = %104
store i32 0, i32* %4
br label %115
115: ; preds = %114, %111, %63, %45, %32, %25
%116 = load i32, i32* %4
ret i32 %116
}

LLVM IR (-O2):
@.str = [5 x i8] c"scsi\00"
@.str.1 = [10 x i8] c"scsi_host\00"
@.str.2 = [10 x i8] c"device_id\00"
@EINVAL = global i32 0
@.str.3 = [12 x i8] c"vmbus-%s-%s\00"
@ENOMEM = global i32 0
define i32 @handle_scsi_hyperv(i8* %0, i8** %1, i8** nocapture writeonly %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca [38 x i8]
%12 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%13 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%14 = bitcast i8** %6 to i8*
store i8* null, i8** %6
%15 = bitcast i64* %7 to i8*
store i64 0, i64* %7
%16 = bitcast i8** %8 to i8*
store i8* null, i8** %8
%17 = bitcast i64* %9 to i8*
store i64 0, i64* %9
%18 = bitcast i8** %10 to i8*
store i8* null, i8** %10
%19 = getelementptr inbounds [38 x i8], [38 x i8]* %11, i64 0, i64 0
%20 = call i32 @memset(i8* %19, i32 0, i32 38)
%21 = call i32 @vdev_sysfs_get_parent_with_subsystem_devtype(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %4, i64* %5)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %92
23: ; preds = %3
%24 = load i8*, i8** %4
%25 = call i32 @vdev_sysfs_get_parent_device(i8* %24, i8** %6, i64* %7)
%26 = icmp eq i32 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %23
%28 = load i8*, i8** %4
%29 = call i32 @free(i8* %28)
br label %92
30: ; preds = %23
%31 = load i8*, i8** %6
%32 = call i32 @vdev_sysfs_read_attr(i8* %31, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %8, i64* %9)
%33 = load i8*, i8** %4
%34 = call i32 @free(i8* %33)
%35 = load i8*, i8** %6
%36 = call i32 @free(i8* %35)
%37 = icmp eq i32 %32, 0
br i1 %37, label %38, label %92
38: ; preds = %30
%39 = load i8*, i8** %8
%40 = call i32 @strlen(i8* %39)
%41 = icmp slt i32 %40, 37
br i1 %41, label %50, label %42
42: ; preds = %38
%43 = load i8*, i8** %8
%44 = load i8, i8* %43
%45 = icmp eq i8 %44, 123
br i1 %45, label %46, label %50
46: ; preds = %42
%47 = getelementptr inbounds i8, i8* %43, i64 36
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 125
br i1 %49, label %53, label %50
50: ; preds = %46, %42, %38
%51 = load i32, i32* @EINVAL
%52 = sub nsw i32 0, %51
br label %92
53: ; preds = %46, %74
%54 = phi i8 [ %76, %74 ], [ 123, %46 ]
%55 = phi i64 [ %71, %74 ], [ 0, %46 ]
%56 = phi i64 [ %72, %74 ], [ 0, %46 ]
%57 = icmp eq i8 %54, 45
br i1 %57, label %61, label %58
58: ; preds = %53
%59 = getelementptr inbounds [38 x i8], [38 x i8]* %11, i64 0, i64 %55
store i8 %54, i8* %59
%60 = add i64 %55, 1
br label %61
61: ; preds = %58, %53
%62 = phi i64 [ %55, %53 ], [ %60, %58 ]
%63 = or i64 %56, 1
%64 = getelementptr inbounds i8, i8* %43, i64 %63
%65 = load i8, i8* %64
%66 = icmp eq i8 %65, 45
br i1 %66, label %70, label %67
67: ; preds = %61
%68 = getelementptr inbounds [38 x i8], [38 x i8]* %11, i64 0, i64 %62
store i8 %65, i8* %68
%69 = add i64 %62, 1
br label %70
70: ; preds = %67, %61
%71 = phi i64 [ %62, %61 ], [ %69, %67 ]
%72 = add nuw nsw i64 %56, 2
%73 = icmp eq i64 %72, 36
br i1 %73, label %77, label %74
74: ; preds = %70
%75 = getelementptr inbounds i8, i8* %43, i64 %72
%76 = load i8, i8* %75
br label %53
77: ; preds = %70
%78 = getelementptr inbounds [38 x i8], [38 x i8]* %11, i64 0, i64 %71
store i8 0, i8* %78
%79 = call i32 @format_lun_number(i8* %0, i8** %10)
%80 = load i8*, i8** %10
%81 = call i32 @path_prepend(i8** %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %19, i8* %80)
%82 = load i8*, i8** %10
%83 = icmp eq i8* %82, null
br i1 %83, label %86, label %84
84: ; preds = %77
%85 = call i32 @free(i8* %82)
br label %86
86: ; preds = %84, %77
%87 = call i8* @strdup(i8* %0)
store i8* %87, i8** %2
%88 = icmp eq i8* %87, null
br i1 %88, label %89, label %92
89: ; preds = %86
%90 = load i32, i32* @ENOMEM
%91 = sub nsw i32 0, %90
br label %92
92: ; preds = %86, %30, %3, %89, %50, %27
%93 = phi i32 [ %25, %27 ], [ %52, %50 ], [ %91, %89 ], [ %21, %3 ], [ %32, %30 ], [ 0, %86 ]
ret i32 %93
}