#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 */
typedef scalar_t__ iconv_t;

/* Variables and functions */
size_t iconv(scalar_t__, char **, size_t *, char **, size_t *);
int /*<<< orphan*/ iconv_close(scalar_t__);
scalar_t__ iconv_open(char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(int argc, char **argv) {
  char *encTo = "UNICODE//IGNORE";
  char *encFrom = "UTF-8";
  iconv_t cd = iconv_open(encTo, encFrom);
  if (cd == (iconv_t)-1) {
    perror("iconv_open");
  }
  char inbuf[1024] = "abcdef哈哈哈哈行";
  size_t srclen = strlen(inbuf);
  printf("srclen=%d\n", srclen);
  size_t outlen = 1024;
  char outbuf[outlen];
  memset(outbuf, 0, outlen);
  char *srcstart = inbuf;
  char *tempoutbuf = outbuf;
  size_t ret = iconv(cd, &srcstart, &srclen, &tempoutbuf, &outlen);
  if (ret == -1) {
    perror("iconv");
  }
  printf("inbuf=%s, srclen=%d, outbuf=%s, outlen=%d\n", inbuf, srclen, outbuf,
         outlen);
  int i = 0;
  for (i = 0; i < strlen(outbuf); i++) {
    printf("%x\n", outbuf[i]);
  }
  iconv_close(cd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x490,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe60(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe65(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10a0 <iconv_open@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0xffffffffffffffff,-0x28(%rbp)
jne    11d7 <main+0x57>
lea    0xe44(%rip),%rdi
call   1090 <perror@plt>
lea    0xe92(%rip),%rsi
lea    -0x430(%rbp),%rdi
mov    %rdi,-0x480(%rbp)
mov    $0x400,%edx
call   1070 <memcpy@plt>
mov    -0x480(%rbp),%rdi
call   1040 <strlen@plt>
cltq
mov    %rax,-0x438(%rbp)
mov    -0x438(%rbp),%rsi
lea    0xe08(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movq   $0x400,-0x440(%rbp)
mov    -0x440(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x448(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x478(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x450(%rbp)
mov    -0x440(%rbp),%rdx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0x478(%rbp),%rax
lea    -0x430(%rbp),%rcx
mov    %rcx,-0x458(%rbp)
mov    %rax,-0x460(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x458(%rbp),%rsi
lea    -0x438(%rbp),%rdx
lea    -0x460(%rbp),%rcx
lea    -0x440(%rbp),%r8
call   1030 <iconv@plt>
mov    %rax,-0x468(%rbp)
cmpq   $0xffffffffffffffff,-0x468(%rbp)
ff
jne    12ce <main+0x14e>
lea    0xd63(%rip),%rdi
call   1090 <perror@plt>
mov    -0x478(%rbp),%rcx
lea    -0x430(%rbp),%rsi
mov    -0x438(%rbp),%rdx
mov    -0x440(%rbp),%r8
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x46c(%rbp)
movl   $0x0,-0x46c(%rbp)
mov    -0x478(%rbp),%rdi
mov    -0x46c(%rbp),%eax
mov    %eax,-0x484(%rbp)
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x484(%rbp),%eax
cmp    %ecx,%eax
jge    1368 <main+0x1e8>
mov    -0x478(%rbp),%rax
movslq -0x46c(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x46c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x46c(%rbp)
jmp    130c <main+0x18c>
mov    -0x28(%rbp),%rdi
call   1080 <iconv_close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x448(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
lea    0xe65(%rip),%rdi
lea    0xe6e(%rip),%rsi
call   10a0 <iconv_open@plt>
mov    %rax,%r14
cmp    $0xffffffffffffffff,%rax
je     12bf <main+0x13f>
lea    0xeb5(%rip),%rsi
lea    -0x450(%rbp),%r15
mov    $0x400,%edx
mov    %r15,%rdi
call   1070 <memcpy@plt>
mov    %r15,%rdi
call   1040 <strlen@plt>
movslq %eax,%rsi
mov    %rsi,-0x38(%rbp)
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%r12
movq   $0x400,-0x30(%rbp)
mov    %rsp,%r13
add    $0xfffffffffffffc00,%r13
mov    %r13,%rsp
mov    $0x400,%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    %r15,-0x48(%rbp)
mov    %r13,-0x40(%rbp)
lea    -0x48(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x30(%rbp),%r8
mov    %r14,%rdi
call   1030 <iconv@plt>
cmp    $0xffffffffffffffff,%rax
je     12d0 <main+0x150>
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%r8
lea    0xde6(%rip),%rdi
lea    -0x450(%rbp),%rsi
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    12a3 <main+0x123>
lea    0xded(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl 0x0(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
mov    %r13,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1280 <main+0x100>
mov    %r14,%rdi
call   1080 <iconv_close@plt>
mov    %r12,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd50(%rip),%rdi
call   1090 <perror@plt>
jmp    11b4 <main+0x34>
lea    0xd55(%rip),%rdi
call   1090 <perror@plt>
jmp    123d <main+0xbd>

LLVM IR (-O0):
@.str = [16 x i8] c"UNICODE//IGNORE\00"
@.str.1 = [6 x i8] c"UTF-8\00"
@.str.2 = [11 x i8] c"iconv_open\00"
@__const.main.inbuf = [1024 x i8] c"abcdef\E5\93\88\E5\93\88\E5\93\88\E5\93\88\E8\A1\8C\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.3 = [11 x i8] c"srclen=%d\0A\00"
@.str.4 = [6 x i8] c"iconv\00"
@.str.5 = [43 x i8] c"inbuf=%s, srclen=%d, outbuf=%s, outlen=%d\0A\00"
@.str.6 = [4 x i8] c"%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca [1024 x i8]
%10 = alloca i64
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %7
%18 = load i8*, i8** %6
%19 = load i8*, i8** %7
%20 = call i64 @iconv_open(i8* %18, i8* %19)
store i64 %20, i64* %8
%21 = load i64, i64* %8
%22 = icmp eq i64 %21, -1
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %2
%26 = bitcast [1024 x i8]* %9 to i8*
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%28 = call i32 @strlen(i8* %27)
%29 = sext i32 %28 to i64
store i64 %29, i64* %10
%30 = load i64, i64* %10
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i64 %30)
store i64 1024, i64* %11
%32 = load i64, i64* %11
%33 = call i8* @llvm.stacksave()
store i8* %33, i8** %12
%34 = alloca i8, i64 %32
store i64 %32, i64* %13
%35 = load i64, i64* %11
%36 = call i32 @memset(i8* %34, i32 0, i64 %35)
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
store i8* %37, i8** %14
store i8* %34, i8** %15
%38 = load i64, i64* %8
%39 = call i64 @iconv(i64 %38, i8** %14, i64* %10, i8** %15, i64* %11)
store i64 %39, i64* %16
%40 = load i64, i64* %16
%41 = icmp eq i64 %40, -1
br i1 %41, label %42, label %44
42: ; preds = %25
%43 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %44
44: ; preds = %42, %25
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%46 = load i64, i64* %10
%47 = load i64, i64* %11
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %45, i64 %46, i8* %34, i64 %47)
store i32 0, i32* %17
store i32 0, i32* %17
br label %49
49: ; preds = %60, %44
%50 = load i32, i32* %17
%51 = call i32 @strlen(i8* %34)
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %63
53: ; preds = %49
%54 = load i32, i32* %17
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %34, i64 %55
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %53
%61 = load i32, i32* %17
%62 = add nsw i32 %61, 1
store i32 %62, i32* %17
br label %49
63: ; preds = %49
%64 = load i64, i64* %8
%65 = call i32 @iconv_close(i64 %64)
store i32 0, i32* %3
%66 = load i8*, i8** %12
%67 = load i32, i32* %3
ret i32 %67
}

LLVM IR (-O2):
@.str = [16 x i8] c"UNICODE//IGNORE\00"
@.str.1 = [6 x i8] c"UTF-8\00"
@.str.2 = [11 x i8] c"iconv_open\00"
@__const.main.inbuf = [1024 x i8] c"abcdef\E5\93\88\E5\93\88\E5\93\88\E5\93\88\E8\A1\8C\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.3 = [11 x i8] c"srclen=%d\0A\00"
@.str.4 = [6 x i8] c"iconv\00"
@.str.5 = [43 x i8] c"inbuf=%s, srclen=%d, outbuf=%s, outlen=%d\0A\00"
@.str.6 = [4 x i8] c"%x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = tail call i64 @iconv_open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%14 = bitcast i64* %4 to i8*
%15 = call i32 @strlen(i8* %13)
%16 = sext i32 %15 to i64
store i64 %16, i64* %4
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i64 %16)
%18 = bitcast i64* %5 to i8*
store i64 1024, i64* %5
%19 = call i8* @llvm.stacksave()
%20 = alloca [1024 x i8]
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %20, i64 0, i64 0
%22 = call i32 @memset(i8* %21, i32 0, i64 1024)
%23 = bitcast i8** %6 to i8*
store i8* %13, i8** %6
%24 = bitcast i8** %7 to i8*
store i8* %21, i8** %7
%25 = call i64 @iconv(i64 %8, i8** %6, i64* %4, i8** %7, i64* %5)
%26 = icmp eq i64 %25, -1
br i1 %26, label %27, label %29
27: ; preds = %12
%28 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %27, %12
%30 = load i64, i64* %4
%31 = load i64, i64* %5
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %13, i64 %30, i8* %21, i64 %31)
%33 = call i32 @strlen(i8* %21)
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %45
35: ; preds = %29, %35
%36 = phi i64 [ %41, %35 ], [ 0, %29 ]
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %20, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %39)
%41 = add nuw nsw i64 %36, 1
%42 = call i32 @strlen(i8* %21)
%43 = sext i32 %42 to i64
%44 = icmp slt i64 %41, %43
br i1 %44, label %35, label %45
45: ; preds = %35, %29
%46 = call i32 @iconv_close(i64 %8)
ret i32 0
}