#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_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ ubuf;
typedef int /*<<< orphan*/ cbuf;
struct TYPE_3__ {
  int format;
  size_t nitems;
  unsigned char *value;
  int /*<<< orphan*/ encoding;
};
typedef TYPE_1__ XTextProperty;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
scalar_t__ EOF;
int Success;
int /*<<< orphan*/ XInternAtom(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int Xutf8TextPropertyToTextList(int /*<<< orphan*/ *, TYPE_1__ *, char ***,
                                int *);
int /*<<< orphan*/ abort();
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fputs(char *, int /*<<< orphan*/ *);
size_t fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  Display *display;
  static char ubuf[500000];
  size_t ulen;
  static char cbuf[500000];
  size_t clen;
  static XTextProperty text_prop;
  int ret;
  char **tlist;
  int tcount;
  display = XOpenDisplay(NULL);
  if (!display) {
    printf("cannot open DISPLAY\n");
    abort();
  }
  {
    FILE *fp = fopen("../tempfile.utf8", "r");
    if (!fp) {
      printf("cannot open tempfile.utf8\n");
      abort();
    }
    ulen = fread(ubuf, 1, sizeof(ubuf) - 1, fp);
    if (fclose(fp) != 0) {
      abort();
    }
    ubuf[ulen] = '\0';
  }
  {
    FILE *fp = fopen("../tempfile.ctext", "r");
    if (!fp) {
      printf("cannot open tempfile.ctext\n");
      abort();
    }
    clen = fread(cbuf, 1, sizeof(cbuf) - 1, fp);
    if (fclose(fp) != 0) {
      abort();
    }
    cbuf[clen] = '\0';
  }
  printf("ulen %d\n", ulen);
  printf("clen %d\n", clen);
  text_prop.encoding = XInternAtom(display, "COMPOUND_TEXT", 0);
  text_prop.format = 8;
  text_prop.nitems = clen;
  text_prop.value = (unsigned char *)cbuf;
  ret = Xutf8TextPropertyToTextList(display, &text_prop, &tlist, &tcount);
  printf("tcount %d\n", tcount);
  if (ret != Success) {
    printf("Xutf8TextPropertyToTextList ret %d\n", ret);
    {
      FILE *fp = fopen("../tempfile-xlib.utf8", "w");
      if (!fp) {
        printf("cannot create ../tempfile-xlib.utf8\n");
        abort();
      }
      if (fputs(tlist[0], fp) == EOF) {
        abort();
      }
      if (fclose(fp) != 0) {
        abort();
      }
    }
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1090 <XOpenDisplay@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11cc <main+0x3c>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <abort@plt>
lea    0xe42(%rip),%rdi
lea    0xe4c(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1203 <main+0x73>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x40(%rbp),%rcx
lea    0x2e72(%rip),%rdi
mov    $0x1,%esi
mov    $0x7a11f,%edx
call   1050 <fread@plt>
mov    %rax,-0x18(%rbp)
mov    -0x40(%rbp),%rdi
call   1060 <fclose@plt>
cmp    $0x0,%rax
je     123b <main+0xab>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x18(%rbp),%rcx
lea    0x2e3a(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0xdf2(%rip),%rdi
lea    0xdce(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1281 <main+0xf1>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x48(%rbp),%rcx
lea    0x7cf14(%rip),%rdi
mov    $0x1,%esi
mov    $0x7a11f,%edx
call   1050 <fread@plt>
mov    %rax,-0x20(%rbp)
mov    -0x48(%rbp),%rdi
call   1060 <fclose@plt>
cmp    $0x0,%rax
je     12b9 <main+0x129>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x20(%rbp),%rcx
lea    0x7cedc(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rsi
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xd8c(%rip),%rsi
xor    %edx,%edx
call   10a0 <XInternAtom@plt>
mov    %eax,0xf6fd4(%rip)
movl   $0x8,0xf6fb2(%rip)
mov    -0x20(%rbp),%rax
mov    %rax,0xf6faf(%rip)
lea    0x7ce80(%rip),%rax
mov    %rax,0xf6fa9(%rip)
mov    -0x10(%rbp),%rdi
lea    0xf6f8e(%rip),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
call   1030 <Xutf8TextPropertyToTextList@plt>
mov    %eax,-0x24(%rbp)
mov    -0x34(%rbp),%esi
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x24(%rbp),%eax
mov    0x2c9b(%rip),%rcx
cmp    (%rcx),%eax
je     13f5 <main+0x265>
mov    -0x24(%rbp),%esi
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd43(%rip),%rdi
lea    0xd52(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    13ad <main+0x21d>
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
mov    -0x50(%rbp),%rsi
call   1080 <fputs@plt>
mov    0x2c1c(%rip),%rcx
cmp    (%rcx),%rax
jne    13d4 <main+0x244>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x50(%rbp),%rdi
call   1060 <fclose@plt>
cmp    $0x0,%rax
je     13ee <main+0x25e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   10a0 <XOpenDisplay@plt>
test   %rax,%rax
je     1302 <main+0x162>
mov    %rax,%r14
lea    0xe39(%rip),%rdi
lea    0xe43(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     130b <main+0x16b>
mov    %rax,%rbx
lea    0x2e9a(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x7a11f,%edx
mov    %rax,%rcx
call   1060 <fread@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1070 <fclose@plt>
test   %rax,%rax
jne    1377 <main+0x1d7>
movb   $0x0,(%r12,%r15,1)
lea    0xdf8(%rip),%rdi
lea    0xdef(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1314 <main+0x174>
mov    %rax,%rbx
lea    0x7cf66(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x7a11f,%edx
mov    %rax,%rcx
call   1060 <fread@plt>
mov    %rax,%r13
mov    %rbx,%rdi
call   1070 <fclose@plt>
test   %rax,%rax
jne    1377 <main+0x1d7>
movb   $0x0,0x0(%r13,%r15,1)
lea    0xdb5(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdad(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xda5(%rip),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   10b0 <XInternAtom@plt>
mov    %eax,0xf7036(%rip)
lea    0xf7017(%rip),%rsi
movl   $0x8,0xf700d(%rip)
mov    %r13,0xf700e(%rip)
mov    %r15,0xf700f(%rip)
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %r14,%rdi
call   1030 <Xutf8TextPropertyToTextList@plt>
mov    %eax,%ebx
mov    0x4(%rsp),%esi
lea    0xd65(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2d0a(%rip),%rax
cmp    (%rax),%ebx
jne    131d <main+0x17d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xd6d(%rip),%rdi
jmp    134c <main+0x1ac>
lea    0xd78(%rip),%rdi
jmp    134c <main+0x1ac>
lea    0xd89(%rip),%rdi
jmp    134c <main+0x1ac>
lea    0xd2c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd99(%rip),%rdi
lea    0xd39(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
jne    1358 <main+0x1b8>
lea    0xd73(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1040 <abort@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%rax
mov    (%rax),%rdi
mov    %rbx,%rsi
call   1090 <fputs@plt>
mov    0x2c6e(%rip),%rcx
cmp    (%rcx),%rax
jne    137e <main+0x1de>
xor    %eax,%eax
call   1040 <abort@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i64, i8*, i32 }
@main.ubuf = internal global [500000 x i8] zeroinitializer
@main.cbuf = internal global [500000 x i8] zeroinitializer
@main.text_prop = internal global %struct.TYPE_3__ zeroinitializer
@.str = [21 x i8] c"cannot open DISPLAY\0A\00"
@.str.1 = [17 x i8] c"../tempfile.utf8\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [27 x i8] c"cannot open tempfile.utf8\0A\00"
@.str.4 = [18 x i8] c"../tempfile.ctext\00"
@.str.5 = [28 x i8] c"cannot open tempfile.ctext\0A\00"
@.str.6 = [9 x i8] c"ulen %d\0A\00"
@.str.7 = [9 x i8] c"clen %d\0A\00"
@.str.8 = [14 x i8] c"COMPOUND_TEXT\00"
@.str.9 = [11 x i8] c"tcount %d\0A\00"
@Success = global i32 0
@.str.10 = [36 x i8] c"Xutf8TextPropertyToTextList ret %d\0A\00"
@.str.11 = [22 x i8] c"../tempfile-xlib.utf8\00"
@.str.12 = [2 x i8] c"w\00"
@.str.13 = [37 x i8] c"cannot create ../tempfile-xlib.utf8\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 0, i32* %1
%11 = call i32* @XOpenDisplay(i32* null)
store i32* %11, i32** %2
%12 = load i32*, i32** %2
%13 = icmp ne i32* %12, null
br i1 %13, label %17, label %14
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %0
%18 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %18, i32** %8
%19 = load i32*, i32** %8
%20 = icmp ne i32* %19, null
br i1 %20, label %24, label %21
21: ; preds = %17
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 (...) @abort()
unreachable
24: ; preds = %17
%25 = load i32*, i32** %8
%26 = call i64 @fread(i8* getelementptr inbounds ([500000 x i8], [500000 x i8]* @main.ubuf, i64 0, i64 0), i32 1, i32 499999, i32* %25)
store i64 %26, i64* %3
%27 = load i32*, i32** %8
%28 = call i64 @fclose(i32* %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %24
%31 = call i32 (...) @abort()
unreachable
32: ; preds = %24
%33 = load i64, i64* %3
%34 = getelementptr inbounds [500000 x i8], [500000 x i8]* @main.ubuf, i64 0, i64 %33
store i8 0, i8* %34
%35 = call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %35, i32** %9
%36 = load i32*, i32** %9
%37 = icmp ne i32* %36, null
br i1 %37, label %41, label %38
38: ; preds = %32
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%40 = call i32 (...) @abort()
unreachable
41: ; preds = %32
%42 = load i32*, i32** %9
%43 = call i64 @fread(i8* getelementptr inbounds ([500000 x i8], [500000 x i8]* @main.cbuf, i64 0, i64 0), i32 1, i32 499999, i32* %42)
store i64 %43, i64* %4
%44 = load i32*, i32** %9
%45 = call i64 @fclose(i32* %44)
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %41
%48 = call i32 (...) @abort()
unreachable
49: ; preds = %41
%50 = load i64, i64* %4
%51 = getelementptr inbounds [500000 x i8], [500000 x i8]* @main.cbuf, i64 0, i64 %50
store i8 0, i8* %51
%52 = load i64, i64* %3
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i64 %52)
%54 = load i64, i64* %4
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i64 %54)
%56 = load i32*, i32** %2
%57 = call i32 @XInternAtom(i32* %56, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 0)
store i32 %57, i32* getelementptr inbounds (%struct.TYPE_3__, %struct.TYPE_3__* @main.text_prop, i32 0, i32 3)
store i32 8, i32* getelementptr inbounds (%struct.TYPE_3__, %struct.TYPE_3__* @main.text_prop, i32 0, i32 0)
%58 = load i64, i64* %4
store i64 %58, i64* getelementptr inbounds (%struct.TYPE_3__, %struct.TYPE_3__* @main.text_prop, i32 0, i32 1)
store i8* getelementptr inbounds ([500000 x i8], [500000 x i8]* @main.cbuf, i64 0, i64 0), i8** getelementptr inbounds (%struct.TYPE_3__, %struct.TYPE_3__* @main.text_prop, i32 0, i32 2)
%59 = load i32*, i32** %2
%60 = call i32 @Xutf8TextPropertyToTextList(i32* %59, %struct.TYPE_3__* @main.text_prop, i8*** %6, i32* %7)
store i32 %60, i32* %5
%61 = load i32, i32* %7
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %5
%64 = load i32, i32* @Success
%65 = icmp ne i32 %63, %64
br i1 %65, label %66, label %93
66: ; preds = %49
%67 = load i32, i32* %5
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), i32 %67)
%69 = call i32* @fopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %69, i32** %10
%70 = load i32*, i32** %10
%71 = icmp ne i32* %70, null
br i1 %71, label %75, label %72
72: ; preds = %66
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%74 = call i32 (...) @abort()
unreachable
75: ; preds = %66
%76 = load i8**, i8*** %6
%77 = getelementptr inbounds i8*, i8** %76, i64 0
%78 = load i8*, i8** %77
%79 = load i32*, i32** %10
%80 = call i64 @fputs(i8* %78, i32* %79)
%81 = load i64, i64* @EOF
%82 = icmp eq i64 %80, %81
br i1 %82, label %83, label %85
83: ; preds = %75
%84 = call i32 (...) @abort()
unreachable
85: ; preds = %75
%86 = load i32*, i32** %10
%87 = call i64 @fclose(i32* %86)
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %91
89: ; preds = %85
%90 = call i32 (...) @abort()
unreachable
91: ; preds = %85
%92 = call i32 (...) @abort()
unreachable
93: ; preds = %49
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i64, i8*, i32 }
@main.ubuf = internal global [500000 x i8] zeroinitializer
@main.cbuf = internal global [500000 x i8] zeroinitializer
@main.text_prop = internal global %struct.TYPE_3__ zeroinitializer
@.str.1 = [17 x i8] c"../tempfile.utf8\00"
@.str.2 = [2 x i8] c"r\00"
@.str.4 = [18 x i8] c"../tempfile.ctext\00"
@.str.6 = [9 x i8] c"ulen %d\0A\00"
@.str.7 = [9 x i8] c"clen %d\0A\00"
@.str.8 = [14 x i8] c"COMPOUND_TEXT\00"
@.str.9 = [11 x i8] c"tcount %d\0A\00"
@Success = global i32 0
@.str.10 = [36 x i8] c"Xutf8TextPropertyToTextList ret %d\0A\00"
@.str.11 = [22 x i8] c"../tempfile-xlib.utf8\00"
@.str.12 = [2 x i8] c"w\00"
@EOF = global i64 0
@str = [20 x i8] c"cannot open DISPLAY\00"
@str.14 = [26 x i8] c"cannot open tempfile.utf8\00"
@str.15 = [27 x i8] c"cannot open tempfile.ctext\00"
@str.16 = [36 x i8] c"cannot create ../tempfile-xlib.utf8\00"
define i32 @main() {
%1 = alloca i8**
%2 = alloca i32
%3 = bitcast i8*** %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32* @XOpenDisplay(i32* null)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.14, i64 0, i64 0))
%15 = tail call i32 (...) @abort()
unreachable
16: ; preds = %10
%17 = tail call i64 @fread(i8* getelementptr inbounds ([500000 x i8], [500000 x i8]* @main.ubuf, i64 0, i64 0), i32 1, i32 499999, i32* %11)
%18 = tail call i64 @fclose(i32* %11)
%19 = icmp eq i64 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %16
%21 = tail call i32 (...) @abort()
unreachable
22: ; preds = %16
%23 = getelementptr inbounds [500000 x i8], [500000 x i8]* @main.ubuf, i64 0, i64 %17
store i8 0, i8* %23
%24 = tail call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.15, i64 0, i64 0))
%28 = tail call i32 (...) @abort()
unreachable
29: ; preds = %22
%30 = tail call i64 @fread(i8* getelementptr inbounds ([500000 x i8], [500000 x i8]* @main.cbuf, i64 0, i64 0), i32 1, i32 499999, i32* %24)
%31 = tail call i64 @fclose(i32* %24)
%32 = icmp eq i64 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %29
%34 = tail call i32 (...) @abort()
unreachable
35: ; preds = %29
%36 = getelementptr inbounds [500000 x i8], [500000 x i8]* @main.cbuf, i64 0, i64 %30
store i8 0, i8* %36
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i64 %17)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i64 %30)
%39 = tail call i32 @XInternAtom(i32* %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 0)
store i32 %39, i32* getelementptr inbounds (%struct.TYPE_3__, %struct.TYPE_3__* @main.text_prop, i64 0, i32 3)
store i32 8, i32* getelementptr inbounds (%struct.TYPE_3__, %struct.TYPE_3__* @main.text_prop, i64 0, i32 0)
store i64 %30, i64* getelementptr inbounds (%struct.TYPE_3__, %struct.TYPE_3__* @main.text_prop, i64 0, i32 1)
store i8* getelementptr inbounds ([500000 x i8], [500000 x i8]* @main.cbuf, i64 0, i64 0), i8** getelementptr inbounds (%struct.TYPE_3__, %struct.TYPE_3__* @main.text_prop, i64 0, i32 2)
%40 = call i32 @Xutf8TextPropertyToTextList(i32* %5, %struct.TYPE_3__* @main.text_prop, i8*** %1, i32* %2)
%41 = load i32, i32* %2
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %41)
%43 = load i32, i32* @Success
%44 = icmp eq i32 %40, %43
br i1 %44, label %63, label %45
45: ; preds = %35
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), i32 %40)
%47 = call i32* @fopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.16, i64 0, i64 0))
%51 = call i32 (...) @abort()
unreachable
52: ; preds = %45
%53 = load i8**, i8*** %1
%54 = load i8*, i8** %53
%55 = call i64 @fputs(i8* %54, i32* %47)
%56 = load i64, i64* @EOF
%57 = icmp eq i64 %55, %56
br i1 %57, label %58, label %60
58: ; preds = %52
%59 = call i32 (...) @abort()
unreachable
60: ; preds = %52
%61 = call i64 @fclose(i32* %47)
%62 = call i32 (...) @abort()
unreachable
63: ; preds = %35
ret i32 0
}