#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 int ssize_t;
typedef int mqd_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int mkfifo(char *, int);
int /*<<< orphan*/ mq_close(int);
int mq_open(char *, int /*<<< orphan*/);
int mq_receive(int, char *, int, unsigned int *);
int /*<<< orphan*/ mq_unlink(char *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
char toupper(char);
int /*<<< orphan*/ unlink(char *);
int write(int, char *, int);
int main() {
  int fd;
  printf("open queue\n");
  mqd_t queue = mq_open("/is141315q", O_RDONLY);
  if (queue == -1) {
    perror("/is141315q");
    return 1;
  }
  printf("make pipe\n");
  unlink("/tmp/is141315");
  if (mkfifo("/tmp/is141315", 0666) == -1) {
    perror("mkfifo");
    return 1;
  }
  printf("%s open pipe\n", "/tmp/is141315");
  if ((fd = open("/tmp/is141315", O_WRONLY)) == -1) {
    perror("open");
    return 1;
  }
  printf("%s opend pipe\n", "/tmp/is141315");
  char line[256];
  do {
    int i = 0;
    unsigned int prio = 0;
    printf("read queue\n");
    ssize_t len = mq_receive(queue, line, 256, &prio);
    if (len == -1) {
      perror("/is141315q");
      mq_close(queue);
      return 1;
    }
    line[256 - 1] = 0;
    printf("IN > prio: %u, msg:'%s' \n", prio, line);
    fflush(stdout);
    for (i = 0; i < strlen(line); i++) {
      line[i] = toupper(line[i]);
    }
    printf("OUT > msg:'%s' \n", line);
    if (write(fd, line, strlen(line) + 1) == -1) {
      perror("write");
      break;
    }
  } while (strcmp(line, "QUIT"));
  mq_close(queue);
  mq_unlink("/is141315q");
  unlink("/tmp/is141315");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%esi
lea    0xdfc(%rip),%rdi
call   10b0 <mq_open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    123a <main+0x5a>
lea    0xde3(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a2 <main+0x2c2>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdd3(%rip),%rdi
call   1030 <unlink@plt>
lea    0xdc7(%rip),%rdi
mov    $0x1b6,%esi
call   10a0 <mkfifo@plt>
cmp    $0xffffffff,%eax
jne    1286 <main+0xa6>
lea    0xdbb(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a2 <main+0x2c2>
lea    0xdaa(%rip),%rdi
lea    0xd8e(%rip),%rsi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2d26(%rip),%rax
mov    (%rax),%esi
lea    0xd77(%rip),%rdi
call   10e0 <open@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    12d4 <main+0xf4>
lea    0xd82(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a2 <main+0x2c2>
lea    0xd6f(%rip),%rdi
lea    0xd40(%rip),%rsi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x114(%rbp)
movl   $0x0,-0x118(%rbp)
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xc(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
lea    -0x118(%rbp),%rcx
call   10d0 <mq_receive@plt>
mov    %eax,-0x11c(%rbp)
cmpl   $0xffffffff,-0x11c(%rbp)
jne    1359 <main+0x179>
lea    0xccc(%rip),%rdi
call   10f0 <perror@plt>
mov    -0xc(%rbp),%edi
call   1080 <mq_close@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a2 <main+0x2c2>
movb   $0x0,-0x11(%rbp)
mov    -0x118(%rbp),%esi
lea    -0x110(%rbp),%rdx
lea    0xcf4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
mov    %eax,-0x120(%rbp)
lea    -0x110(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x120(%rbp),%eax
cmp    %ecx,%eax
jge    13f0 <main+0x210>
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%edi
ff
call   1040 <toupper@plt>
mov    %al,%cl
movslq -0x114(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1390 <main+0x1b0>
lea    -0x110(%rbp),%rsi
lea    0xc81(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x12c(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x128(%rbp)
lea    -0x110(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x12c(%rbp),%edi
mov    -0x128(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1050 <write@plt>
cmp    $0xffffffff,%eax
jne    1459 <main+0x279>
lea    0xc41(%rip),%rdi
call   10f0 <perror@plt>
jmp    147b <main+0x29b>
jmp    145e <main+0x27e>
lea    -0x110(%rbp),%rdi
lea    0xc2a(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12e9 <main+0x109>
mov    -0xc(%rbp),%edi
call   1080 <mq_close@plt>
lea    0xb82(%rip),%rdi
call   1100 <mq_unlink@plt>
lea    0xb8c(%rip),%rdi
call   1030 <unlink@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
lea    0xe70(%rip),%rdi
call   1050 <puts@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
lea    0xde3(%rip),%rdi
call   10c0 <mq_open@plt>
cmp    $0xffffffff,%eax
je     13c6 <main+0x1d6>
mov    %eax,%r15d
lea    0xe4e(%rip),%rdi
call   1050 <puts@plt>
lea    0xdca(%rip),%rbx
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %rbx,%rdi
mov    $0x1b6,%esi
call   10b0 <mkfifo@plt>
cmp    $0xffffffff,%eax
je     13cf <main+0x1df>
lea    0xdba(%rip),%rdi
lea    0xd9e(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2d4a(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10f0 <open@plt>
cmp    $0xffffffff,%eax
je     13d8 <main+0x1e8>
mov    %eax,%ebp
lea    0xd99(%rip),%rdi
lea    0xd6a(%rip),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0x10(%rsp),%rbx
lea    0xda8(%rip),%r14
lea    0xdb8(%rip),%r12
nopl   0x0(%rax,%rax,1)
movl   $0x0,0xc(%rsp)
lea    0xdbe(%rip),%rdi
call   1050 <puts@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x100,%edx
lea    0xc(%rsp),%rcx
call   10e0 <mq_receive@plt>
cmp    $0xffffffff,%eax
je     13eb <main+0x1fb>
movb   $0x0,0x10f(%rsp)
mov    0xc(%rsp),%esi
lea    0xd3d(%rip),%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2cc2(%rip),%rax
mov    (%rax),%edi
call   10d0 <fflush@plt>
mov    %rbx,%rdi
call   1070 <strlen@plt>
test   %eax,%eax
jle    1353 <main+0x163>
xor    %r13d,%r13d
nopl   0x0(%rax)
movsbl 0x10(%rsp,%r13,1),%edi
call   1040 <toupper@plt>
mov    %al,0x10(%rsp,%r13,1)
add    $0x1,%r13
mov    %rbx,%rdi
call   1070 <strlen@plt>
cltq
cmp    %rax,%r13
jl     1330 <main+0x140>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1070 <strlen@plt>
lea    0x1(%rax),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <write@plt>
cmp    $0xffffffff,%eax
je     1406 <main+0x216>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    12c0 <main+0xd0>
mov    %r15d,%edi
call   1090 <mq_close@plt>
lea    0xc5f(%rip),%rdi
call   1110 <mq_unlink@plt>
lea    0xc5e(%rip),%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc33(%rip),%rdi
jmp    13df <main+0x1ef>
lea    0xc43(%rip),%rdi
jmp    13df <main+0x1ef>
lea    0xc4f(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%eax
jmp    13b4 <main+0x1c4>
lea    0xc0e(%rip),%rdi
call   1100 <perror@plt>
mov    %r15d,%edi
call   1090 <mq_close@plt>
mov    $0x1,%eax
jmp    13b4 <main+0x1c4>
lea    0xc60(%rip),%rdi
call   1100 <perror@plt>
jmp    1392 <main+0x1a2>

LLVM IR (-O0):
@.str = [12 x i8] c"open queue\0A\00"
@.str.1 = [11 x i8] c"/is141315q\00"
@O_RDONLY = global i32 0
@.str.2 = [11 x i8] c"make pipe\0A\00"
@.str.3 = [14 x i8] c"/tmp/is141315\00"
@.str.4 = [7 x i8] c"mkfifo\00"
@.str.5 = [14 x i8] c"%s open pipe\0A\00"
@O_WRONLY = global i32 0
@.str.6 = [5 x i8] c"open\00"
@.str.7 = [15 x i8] c"%s opend pipe\0A\00"
@.str.8 = [12 x i8] c"read queue\0A\00"
@.str.9 = [26 x i8] c"IN > prio: %u, msg:'%s' \0A\00"
@stdout = global i32 0
@.str.10 = [17 x i8] c"OUT > msg:'%s' \0A\00"
@.str.11 = [6 x i8] c"write\00"
@.str.12 = [5 x i8] c"QUIT\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @O_RDONLY
%10 = call i32 @mq_open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %88
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @mkfifo(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 438)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %88
22: ; preds = %15
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%24 = load i32, i32* @O_WRONLY
%25 = call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %24)
store i32 %25, i32* %2
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %1
br label %88
29: ; preds = %22
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %31
31: ; preds = %79, %29
store i32 0, i32* %5
store i32 0, i32* %6
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%33 = load i32, i32* %3
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%35 = call i32 @mq_receive(i32 %33, i8* %34, i32 256, i32* %6)
store i32 %35, i32* %7
%36 = load i32, i32* %7
%37 = icmp eq i32 %36, -1
br i1 %37, label %38, label %42
38: ; preds = %31
%39 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%40 = load i32, i32* %3
%41 = call i32 @mq_close(i32 %40)
store i32 1, i32* %1
br label %88
42: ; preds = %31
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 255
store i8 0, i8* %43
%44 = load i32, i32* %6
%45 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %44, i8* %45)
%47 = load i32, i32* @stdout
%48 = call i32 @fflush(i32 %47)
store i32 0, i32* %5
br label %49
49: ; preds = %63, %42
%50 = load i32, i32* %5
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%52 = call i32 @strlen(i8* %51)
%53 = icmp slt i32 %50, %52
br i1 %53, label %54, label %66
54: ; preds = %49
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = call signext i8 @toupper(i8 signext %58)
%60 = load i32, i32* %5
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %61
store i8 %59, i8* %62
br label %63
63: ; preds = %54
%64 = load i32, i32* %5
%65 = add nsw i32 %64, 1
store i32 %65, i32* %5
br label %49
66: ; preds = %49
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i8* %67)
%69 = load i32, i32* %2
%70 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%72 = call i32 @strlen(i8* %71)
%73 = add nsw i32 %72, 1
%74 = call i32 @write(i32 %69, i8* %70, i32 %73)
%75 = icmp eq i32 %74, -1
br i1 %75, label %76, label %78
76: ; preds = %66
%77 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
br label %83
78: ; preds = %66
br label %79
79: ; preds = %78
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%82 = icmp ne i64 %81, 0
br i1 %82, label %31, label %83
83: ; preds = %79, %76
%84 = load i32, i32* %3
%85 = call i32 @mq_close(i32 %84)
%86 = call i32 @mq_unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%87 = call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %88
88: ; preds = %83, %38, %27, %20, %13
%89 = load i32, i32* %1
ret i32 %89
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"/is141315q\00"
@O_RDONLY = global i32 0
@.str.3 = [14 x i8] c"/tmp/is141315\00"
@.str.4 = [7 x i8] c"mkfifo\00"
@.str.5 = [14 x i8] c"%s open pipe\0A\00"
@O_WRONLY = global i32 0
@.str.6 = [5 x i8] c"open\00"
@.str.7 = [15 x i8] c"%s opend pipe\0A\00"
@.str.9 = [26 x i8] c"IN > prio: %u, msg:'%s' \0A\00"
@stdout = global i32 0
@.str.10 = [17 x i8] c"OUT > msg:'%s' \0A\00"
@.str.11 = [6 x i8] c"write\00"
@.str.12 = [5 x i8] c"QUIT\00"
@str = [11 x i8] c"open queue\00"
@str.13 = [10 x i8] c"make pipe\00"
@str.14 = [11 x i8] c"read queue\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @mq_open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %68
9: ; preds = %0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.13, i64 0, i64 0))
%11 = tail call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @mkfifo(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 438)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %68
16: ; preds = %9
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%18 = load i32, i32* @O_WRONLY
%19 = tail call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %68
23: ; preds = %16
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%26 = bitcast i32* %2 to i8*
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 255
br label %28
28: ; preds = %59, %23
store i32 0, i32* %2
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.14, i64 0, i64 0))
%30 = call i32 @mq_receive(i32 %5, i8* %25, i32 256, i32* %2)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @mq_close(i32 %5)
br label %66
35: ; preds = %28
store i8 0, i8* %27
%36 = load i32, i32* %2
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %36, i8* %25)
%38 = load i32, i32* @stdout
%39 = call i32 @fflush(i32 %38)
%40 = call i32 @strlen(i8* %25)
%41 = icmp sgt i32 %40, 0
br i1 %41, label %42, label %51
42: ; preds = %35, %42
%43 = phi i64 [ %47, %42 ], [ 0, %35 ]
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = call signext i8 @toupper(i8 signext %45)
store i8 %46, i8* %44
%47 = add nuw nsw i64 %43, 1
%48 = call i32 @strlen(i8* %25)
%49 = sext i32 %48 to i64
%50 = icmp slt i64 %47, %49
br i1 %50, label %42, label %51
51: ; preds = %42, %35
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i8* %25)
%53 = call i32 @strlen(i8* %25)
%54 = add nsw i32 %53, 1
%55 = call i32 @write(i32 %19, i8* %25, i32 %54)
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %59
57: ; preds = %51
%58 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
br label %62
59: ; preds = %51
%60 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %28
62: ; preds = %59, %57
%63 = call i32 @mq_close(i32 %5)
%64 = call i32 @mq_unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%65 = call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %66
66: ; preds = %32, %62
%67 = phi i32 [ 0, %62 ], [ 1, %32 ]
br label %68
68: ; preds = %66, %21, %14, %7
%69 = phi i32 [ 1, %7 ], [ 1, %14 ], [ 1, %21 ], [ %67, %66 ]
ret i32 %69
}