#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct TYPE_2__ {
  int /*<<< orphan*/ sa_data;
  int /*<<< orphan*/ sa_family;
};
struct ifreq {
  int /*<<< orphan*/ ifr_addr;
  TYPE_1__ ifr_hwaddr;
  int /*<<< orphan*/ ifr_name;
};
typedef int /*<<< orphan*/ hostName;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ ARPHRD_ETHER;
int /*<<< orphan*/ ETH_ALEN;
int /*<<< orphan*/ SIOCGIFADDR;
int /*<<< orphan*/ SIOCGIFHWADDR;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ gethostname(char *, int);
int /*<<< orphan*/ inet_ntoa(int /*<<< orphan*/);
int ioctl(int, int /*<<< orphan*/, struct ifreq *);
int /*<<< orphan*/ memcpy(unsigned char *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ strncpy(int /*<<< orphan*/, char const *, int);
int get_MachineInfo(const char *device, char *buf, int flag) {
  if (flag == 0)
    return 0;
  unsigned char macAddr[6] = {0};
  unsigned char ipAddr[18] = {0};
  unsigned char hostName[16] = {0};
  int sockfd;
  struct ifreq ifr4dev;
  sockfd = socket(AF_INET, SOCK_DGRAM, 0);
  strncpy(ifr4dev.ifr_name, device, sizeof(ifr4dev.ifr_name) - 1);
  ifr4dev.ifr_hwaddr.sa_family = ARPHRD_ETHER;
  if (ioctl(sockfd, SIOCGIFHWADDR, &ifr4dev) == -1) {
    printf("get_MachineInfo: get device [%s] mac error.\n", device);
    return -1;
  }
  memcpy(macAddr, ifr4dev.ifr_hwaddr.sa_data, ETH_ALEN);
  if (ioctl(sockfd, SIOCGIFADDR, &ifr4dev) == -1) {
    printf("get_MachineInfo: get device [%s] ip error.\n", device);
    return -1;
  }
  struct sockaddr_in *sin = (struct sockaddr_in *)&ifr4dev.ifr_addr;
  strcpy((char *)ipAddr, inet_ntoa(sin->sin_addr));
  close(sockfd);
  gethostname((char *)hostName, sizeof(hostName));
  sprintf(buf, "[%s]", hostName);
  if (flag & 0x01)
    sprintf(buf + strlen(buf), "[%02x:%02x:%02x:%02x:%02x:%02x] ", macAddr[0],
            macAddr[1], macAddr[2], macAddr[3], macAddr[4], macAddr[5]);
  if (flag & 0x02)
    sprintf(buf + strlen(buf) - 1, "[%s] ", ipAddr);
  return (int)strlen(buf);
}


x86 assembly (clang, -O0):
<get_MachineInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    11ec <get_MachineInfo+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    13db <get_MachineInfo+0x21b>
lea    -0x22(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1080 <memset@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x12,%edx
call   1080 <memset@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1080 <memset@plt>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
mov    0x2da4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,-0x54(%rbp)
mov    -0x5c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    0x2d78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    -0x54(%rbp),%edi
mov    0x2d59(%rip),%rax
mov    (%rax),%esi
lea    -0x68(%rbp),%rdx
call   1090 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    128f <get_MachineInfo+0xcf>
mov    -0x10(%rbp),%rsi
lea    0xd82(%rip),%rdi
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13db <get_MachineInfo+0x21b>
lea    -0x22(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    0x2d3b(%rip),%rax
mov    (%rax),%edx
call   10b0 <memcpy@plt>
mov    -0x54(%rbp),%edi
mov    0x2d3a(%rip),%rax
mov    (%rax),%esi
lea    -0x68(%rbp),%rdx
call   1090 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    12de <get_MachineInfo+0x11e>
mov    -0x10(%rbp),%rsi
lea    0xd60(%rip),%rdi
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13db <get_MachineInfo+0x21b>
lea    -0x68(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
mov    (%rax),%edi
call   1050 <inet_ntoa@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
mov    -0x54(%rbp),%edi
call   10a0 <close@plt>
lea    -0x50(%rbp),%rdi
mov    $0x10,%esi
call   10c0 <gethostname@plt>
mov    -0x18(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xd30(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     138a <get_MachineInfo+0x1ca>
mov    -0x18(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x80(%rbp),%rdi
cltq
add    %rax,%rdi
movzbl -0x22(%rbp),%edx
movzbl -0x21(%rbp),%ecx
movzbl -0x20(%rbp),%r8d
movzbl -0x1f(%rbp),%r9d
movzbl -0x1e(%rbp),%r10d
movzbl -0x1d(%rbp),%eax
lea    0xce3(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x1c(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     13cf <get_MachineInfo+0x20f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x88(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xffffffffffffffff,%rdi
lea    -0x40(%rbp),%rdx
lea    0xcb7(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_MachineInfo>:
test   %edx,%edx
je     1335 <get_MachineInfo+0x185>
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
movw   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movw   $0x0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
mov    %eax,%ebp
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x18(%rsp)
mov    0x2d8e(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdx
mov    %ebp,%edi
call   1080 <ioctl@plt>
cmp    $0xffffffff,%eax
je     1338 <get_MachineInfo+0x188>
mov    0x14(%rsp),%esi
mov    0x2d8c(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rdi
call   10a0 <memcpy@plt>
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdx
mov    %ebp,%edi
call   1080 <ioctl@plt>
cmp    $0xffffffff,%eax
je     1341 <get_MachineInfo+0x191>
mov    0x10(%rsp),%edi
call   1050 <inet_ntoa@plt>
lea    0x20(%rsp),%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
mov    %ebp,%edi
call   1090 <close@plt>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   10b0 <gethostname@plt>
lea    0xdae(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10c0 <sprintf@plt>
test   $0x1,%r15b
je     1300 <get_MachineInfo+0x150>
mov    %r14,%rdi
call   1060 <strlen@plt>
movslq %eax,%rdi
add    %r14,%rdi
movzbl 0x8(%rsp),%edx
movzbl 0x9(%rsp),%ecx
movzbl 0xa(%rsp),%r8d
movzbl 0xb(%rsp),%r9d
movzbl 0xc(%rsp),%ebp
movzbl 0xd(%rsp),%ebx
lea    0xd6b(%rip),%rsi
xor    %eax,%eax
push   %rbx
push   %rbp
call   10c0 <sprintf@plt>
add    $0x10,%rsp
test   $0x2,%r15b
je     132b <get_MachineInfo+0x17b>
mov    %r14,%rdi
call   1060 <strlen@plt>
cltq
lea    (%r14,%rax,1),%rdi
add    $0xffffffffffffffff,%rdi
lea    0xd60(%rip),%rsi
lea    0x20(%rsp),%rdx
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
jmp    1355 <get_MachineInfo+0x1a5>
xor    %eax,%eax
ret
lea    0xcc1(%rip),%rdi
jmp    1348 <get_MachineInfo+0x198>
lea    0xce5(%rip),%rdi
mov    %rbx,%rsi
call   1070 <printf@plt>
mov    $0xffffffff,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ifreq = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32, i32 }
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@ARPHRD_ETHER = global i32 0
@SIOCGIFHWADDR = global i32 0
@.str = [45 x i8] c"get_MachineInfo: get device [%s] mac error.\0A\00"
@ETH_ALEN = global i32 0
@SIOCGIFADDR = global i32 0
@.str.1 = [44 x i8] c"get_MachineInfo: get device [%s] ip error.\0A\00"
@.str.2 = [5 x i8] c"[%s]\00"
@.str.3 = [33 x i8] c"[%02x:%02x:%02x:%02x:%02x:%02x] \00"
@.str.4 = [6 x i8] c"[%s] \00"
define i32 @get_MachineInfo(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [6 x i8]
%9 = alloca [18 x i8]
%10 = alloca [16 x i8]
%11 = alloca i32
%12 = alloca %struct.ifreq
%13 = alloca %struct.sockaddr_in*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 0, i32* %4
br label %112
17: ; preds = %3
%18 = bitcast [6 x i8]* %8 to i8*
%19 = bitcast [18 x i8]* %9 to i8*
%20 = bitcast [16 x i8]* %10 to i8*
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_DGRAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %11
%24 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %12, i32 0, i32 2
%25 = load i32, i32* %24
%26 = load i8*, i8** %5
%27 = call i32 @strncpy(i32 %25, i8* %26, i32 3)
%28 = load i32, i32* @ARPHRD_ETHER
%29 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %12, i32 0, i32 1
%30 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %29, i32 0, i32 1
store i32 %28, i32* %30
%31 = load i32, i32* %11
%32 = load i32, i32* @SIOCGIFHWADDR
%33 = call i32 @ioctl(i32 %31, i32 %32, %struct.ifreq* %12)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %38
35: ; preds = %17
%36 = load i8*, i8** %5
%37 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %36)
store i32 -1, i32* %4
br label %112
38: ; preds = %17
%39 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%40 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %12, i32 0, i32 1
%41 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %40, i32 0, i32 0
%42 = load i32, i32* %41
%43 = load i32, i32* @ETH_ALEN
%44 = call i32 @memcpy(i8* %39, i32 %42, i32 %43)
%45 = load i32, i32* %11
%46 = load i32, i32* @SIOCGIFADDR
%47 = call i32 @ioctl(i32 %45, i32 %46, %struct.ifreq* %12)
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %52
49: ; preds = %38
%50 = load i8*, i8** %5
%51 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %50)
store i32 -1, i32* %4
br label %112
52: ; preds = %38
%53 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %12, i32 0, i32 0
%54 = bitcast i32* %53 to %struct.sockaddr_in*
store %struct.sockaddr_in* %54, %struct.sockaddr_in** %13
%55 = getelementptr inbounds [18 x i8], [18 x i8]* %9, i64 0, i64 0
%56 = load %struct.sockaddr_in*, %struct.sockaddr_in** %13
%57 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %56, i32 0, i32 0
%58 = load i32, i32* %57
%59 = call i32 @inet_ntoa(i32 %58)
%60 = call i32 @strcpy(i8* %55, i32 %59)
%61 = load i32, i32* %11
%62 = call i32 @close(i32 %61)
%63 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%64 = call i32 @gethostname(i8* %63, i32 16)
%65 = load i8*, i8** %6
%66 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%67 = call i32 (i8*, i8*, ...) @sprintf(i8* %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %66)
%68 = load i32, i32* %7
%69 = and i32 %68, 1
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %96
71: ; preds = %52
%72 = load i8*, i8** %6
%73 = load i8*, i8** %6
%74 = call i32 @strlen(i8* %73)
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8, i8* %72, i64 %75
%77 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 1
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 2
%84 = load i8, i8* %83
%85 = zext i8 %84 to i32
%86 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 3
%87 = load i8, i8* %86
%88 = zext i8 %87 to i32
%89 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 4
%90 = load i8, i8* %89
%91 = zext i8 %90 to i32
%92 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 5
%93 = load i8, i8* %92
%94 = zext i8 %93 to i32
%95 = call i32 (i8*, i8*, ...) @sprintf(i8* %76, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %79, i32 %82, i32 %85, i32 %88, i32 %91, i32 %94)
br label %96
96: ; preds = %71, %52
%97 = load i32, i32* %7
%98 = and i32 %97, 2
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %109
100: ; preds = %96
%101 = load i8*, i8** %6
%102 = load i8*, i8** %6
%103 = call i32 @strlen(i8* %102)
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8, i8* %101, i64 %104
%106 = getelementptr inbounds i8, i8* %105, i64 -1
%107 = getelementptr inbounds [18 x i8], [18 x i8]* %9, i64 0, i64 0
%108 = call i32 (i8*, i8*, ...) @sprintf(i8* %106, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %107)
br label %109
109: ; preds = %100, %96
%110 = load i8*, i8** %6
%111 = call i32 @strlen(i8* %110)
store i32 %111, i32* %4
br label %112
112: ; preds = %109, %49, %35, %16
%113 = load i32, i32* %4
ret i32 %113
}

LLVM IR (-O2):
%struct.ifreq = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32, i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@ARPHRD_ETHER = global i32 0
@SIOCGIFHWADDR = global i32 0
@.str = [45 x i8] c"get_MachineInfo: get device [%s] mac error.\0A\00"
@ETH_ALEN = global i32 0
@SIOCGIFADDR = global i32 0
@.str.1 = [44 x i8] c"get_MachineInfo: get device [%s] ip error.\0A\00"
@.str.2 = [5 x i8] c"[%s]\00"
@.str.3 = [33 x i8] c"[%02x:%02x:%02x:%02x:%02x:%02x] \00"
@.str.4 = [6 x i8] c"[%s] \00"
define i32 @get_MachineInfo(i8* %0, i8* %1, i32 %2) {
%4 = alloca [6 x i8]
%5 = alloca [18 x i8]
%6 = alloca [16 x i8]
%7 = alloca %struct.ifreq
%8 = icmp eq i32 %2, 0
br i1 %8, label %80, label %9
9: ; preds = %3
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [18 x i8], [18 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%13 = bitcast %struct.ifreq* %7 to i8*
%14 = load i32, i32* @AF_INET
%15 = load i32, i32* @SOCK_DGRAM
%16 = tail call i32 @socket(i32 %14, i32 %15, i32 0)
%17 = tail call i32 @strncpy(i32 undef, i8* %0, i32 3)
%18 = load i32, i32* @ARPHRD_ETHER
%19 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %7, i64 0, i32 1, i32 1
store i32 %18, i32* %19
%20 = load i32, i32* @SIOCGIFHWADDR
%21 = call i32 @ioctl(i32 %16, i32 %20, %struct.ifreq* %7)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %25
23: ; preds = %9
%24 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %78
25: ; preds = %9
%26 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %7, i64 0, i32 1, i32 0
%27 = load i32, i32* %26
%28 = load i32, i32* @ETH_ALEN
%29 = call i32 @memcpy(i8* %10, i32 %27, i32 %28)
%30 = load i32, i32* @SIOCGIFADDR
%31 = call i32 @ioctl(i32 %16, i32 %30, %struct.ifreq* %7)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %35
33: ; preds = %25
%34 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %78
35: ; preds = %25
%36 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %7, i64 0, i32 0
%37 = load i32, i32* %36
%38 = call i32 @inet_ntoa(i32 %37)
%39 = call i32 @strcpy(i8* %11, i32 %38)
%40 = call i32 @close(i32 %16)
%41 = call i32 @gethostname(i8* %12, i32 16)
%42 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%43 = and i32 %2, 1
%44 = icmp eq i32 %43, 0
br i1 %44, label %67, label %45
45: ; preds = %35
%46 = call i32 @strlen(i8* %1)
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %1, i64 %47
%49 = load i8, i8* %10
%50 = zext i8 %49 to i32
%51 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 1
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 2
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 3
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 4
%61 = load i8, i8* %60
%62 = zext i8 %61 to i32
%63 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 5
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %48, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %50, i32 %53, i32 %56, i32 %59, i32 %62, i32 %65)
br label %67
67: ; preds = %45, %35
%68 = and i32 %2, 2
%69 = icmp eq i32 %68, 0
br i1 %69, label %76, label %70
70: ; preds = %67
%71 = call i32 @strlen(i8* %1)
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %1, i64 %72
%74 = getelementptr inbounds i8, i8* %73, i64 -1
%75 = call i32 (i8*, i8*, ...) @sprintf(i8* %74, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %11)
br label %76
76: ; preds = %70, %67
%77 = call i32 @strlen(i8* %1)
br label %78
78: ; preds = %76, %33, %23
%79 = phi i32 [ -1, %23 ], [ -1, %33 ], [ %77, %76 ]
br label %80
80: ; preds = %3, %78
%81 = phi i32 [ %79, %78 ], [ 0, %3 ]
ret i32 %81
}