#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 /*<<< orphan*/ deleteMsgQueue(char *);
int /*<<< orphan*/ getMsgQueue(char *, char *);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printLn(char *);
void recibe() {
  int j = 0;
  char buff[50];
  while (j < 6) {
    printLn("----- Espero mensaje -----");
    getMsgQueue(buff, "simpleconv");
    print("Recibi: ");
    printLn(buff);
    printLn("---------------------------");
    j++;
  }
  deleteMsgQueue("simpleconv");
  printLn("");
  print("$ ");
}


x86 assembly (clang, -O0):
<recibe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
jge    11a4 <recibe+0x64>
lea    0xea0(%rip),%rdi
call   1050 <printLn@plt>
lea    -0x40(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <getMsgQueue@plt>
lea    0xeaa(%rip),%rdi
call   1040 <print@plt>
lea    -0x40(%rbp),%rdi
call   1050 <printLn@plt>
lea    0xe9e(%rip),%rdi
call   1050 <printLn@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <recibe+0xf>
lea    0xe70(%rip),%rdi
call   1060 <deleteMsgQueue@plt>
lea    0xe96(%rip),%rdi
call   1050 <printLn@plt>
lea    0xe88(%rip),%rdi
call   1040 <print@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recibe>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0xeac(%rip),%r15
mov    %r15,%rdi
call   1050 <printLn@plt>
lea    0xeb8(%rip),%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <getMsgQueue@plt>
lea    0xeae(%rip),%r12
mov    %r12,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1050 <printLn@plt>
lea    0xea0(%rip),%r13
mov    %r13,%rdi
call   1050 <printLn@plt>
mov    %r15,%rdi
call   1050 <printLn@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <getMsgQueue@plt>
mov    %r12,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1050 <printLn@plt>
mov    %r13,%rdi
call   1050 <printLn@plt>
mov    %r15,%rdi
call   1050 <printLn@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <getMsgQueue@plt>
mov    %r12,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1050 <printLn@plt>
mov    %r13,%rdi
call   1050 <printLn@plt>
mov    %r15,%rdi
call   1050 <printLn@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <getMsgQueue@plt>
mov    %r12,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1050 <printLn@plt>
mov    %r13,%rdi
call   1050 <printLn@plt>
mov    %r15,%rdi
call   1050 <printLn@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <getMsgQueue@plt>
mov    %r12,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1050 <printLn@plt>
mov    %r13,%rdi
call   1050 <printLn@plt>
mov    %r15,%rdi
call   1050 <printLn@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <getMsgQueue@plt>
mov    %r12,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1050 <printLn@plt>
mov    %r13,%rdi
call   1050 <printLn@plt>
mov    %r14,%rdi
call   1060 <deleteMsgQueue@plt>
lea    0xdd0(%rip),%rdi
call   1050 <printLn@plt>
lea    0xdc2(%rip),%rdi
call   1040 <print@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"----- Espero mensaje -----\00"
@.str.1 = [11 x i8] c"simpleconv\00"
@.str.2 = [9 x i8] c"Recibi: \00"
@.str.3 = [28 x i8] c"---------------------------\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [3 x i8] c"$ \00"
define void @recibe() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 6
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = call i32 @printLn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%9 = call i32 @getMsgQueue(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%12 = call i32 @printLn(i8* %11)
%13 = call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %3
16: ; preds = %3
%17 = call i32 @deleteMsgQueue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @printLn(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"----- Espero mensaje -----\00"
@.str.1 = [11 x i8] c"simpleconv\00"
@.str.2 = [9 x i8] c"Recibi: \00"
@.str.3 = [28 x i8] c"---------------------------\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [3 x i8] c"$ \00"
define void @recibe() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @printLn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @getMsgQueue(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printLn(i8* %2)
%7 = call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printLn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @getMsgQueue(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @printLn(i8* %2)
%12 = call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @printLn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @getMsgQueue(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @printLn(i8* %2)
%17 = call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @printLn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @getMsgQueue(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @printLn(i8* %2)
%22 = call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @printLn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @getMsgQueue(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @printLn(i8* %2)
%27 = call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32 @printLn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @getMsgQueue(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 @printLn(i8* %2)
%32 = call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%33 = call i32 @deleteMsgQueue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @printLn(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%35 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret void
}