#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*/ print(char *);
int /*<<< orphan*/ printLn(char *);
int /*<<< orphan*/ putMsgQueue(char *, char *);
void escribe() {
  int i = 0;
  while (i < 6) {
    char *textos[] = {"Hola", "Don", "Pepito", "Hola", "Don", "Jose"};
    printLn("****** Escribo mensaje ******");
    print("Envio ");
    printLn(textos[i]);
    putMsgQueue(textos[i], "simpleconv");
    printLn("***************************");
    i++;
  }
}


x86 assembly (clang, -O0):
<escribe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
jge    1200 <escribe+0xc0>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
lea    0xe90(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe83(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe6f(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe69(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe69(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe63(%rip),%rdi
call   1050 <printLn@plt>
lea    0xe75(%rip),%rdi
call   1040 <print@plt>
movslq -0x4(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rdi
call   1050 <printLn@plt>
movslq -0x4(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rdi
lea    0xe59(%rip),%rsi
call   1060 <putMsgQueue@plt>
lea    0xe58(%rip),%rdi
call   1050 <printLn@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <escribe+0xf>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escribe>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed3(%rip),%rbp
mov    %rbp,%rdi
call   1040 <printLn@plt>
lea    0xee2(%rip),%r14
mov    %r14,%rdi
call   1030 <print@plt>
lea    0xea0(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printLn@plt>
lea    0xecb(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <putMsgQueue@plt>
lea    0xec4(%rip),%r12
mov    %r12,%rdi
call   1040 <printLn@plt>
mov    %rbp,%rdi
call   1040 <printLn@plt>
mov    %r14,%rdi
call   1030 <print@plt>
lea    0xe65(%rip),%r15
mov    %r15,%rdi
call   1040 <printLn@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <putMsgQueue@plt>
mov    %r12,%rdi
call   1040 <printLn@plt>
mov    %rbp,%rdi
call   1040 <printLn@plt>
mov    %r14,%rdi
mov    %r14,%rbx
call   1030 <print@plt>
lea    0xe34(%rip),%r14
mov    %r14,%rdi
call   1040 <printLn@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r13,%r14
call   1050 <putMsgQueue@plt>
mov    %r12,%rdi
call   1040 <printLn@plt>
mov    %rbp,%rdi
mov    %rbp,%r13
call   1040 <printLn@plt>
mov    %rbx,%rdi
mov    %rbx,%rbp
call   1030 <print@plt>
lea    0xdf0(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printLn@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <putMsgQueue@plt>
mov    %r12,%rdi
call   1040 <printLn@plt>
mov    %r13,%rdi
call   1040 <printLn@plt>
mov    %rbp,%rdi
call   1030 <print@plt>
mov    %r15,%rdi
call   1040 <printLn@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <putMsgQueue@plt>
mov    %r12,%rdi
call   1040 <printLn@plt>
mov    %r13,%rdi
call   1040 <printLn@plt>
mov    %rbp,%rdi
call   1030 <print@plt>
lea    0xda3(%rip),%rbp
mov    %rbp,%rdi
call   1040 <printLn@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1050 <putMsgQueue@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printLn@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Hola\00"
@.str.1 = [4 x i8] c"Don\00"
@.str.2 = [7 x i8] c"Pepito\00"
@.str.3 = [5 x i8] c"Jose\00"
@.str.4 = [30 x i8] c"****** Escribo mensaje ******\00"
@.str.5 = [7 x i8] c"Envio \00"
@.str.6 = [11 x i8] c"simpleconv\00"
@.str.7 = [28 x i8] c"***************************\00"
define void @escribe() {
%1 = alloca i32
%2 = alloca [6 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 %30
6: ; preds = %3
%7 = bitcast [6 x i8*]* %2 to i8*
%8 = bitcast i8* %7 to [6 x i8*]*
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8** %14
%15 = call i32 @printLn(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%17 = load i32, i32* %1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @printLn(i8* %20)
%22 = load i32, i32* %1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 @putMsgQueue(i8* %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%27 = call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 1
store i32 %29, i32* %1
br label %3
30: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Hola\00"
@.str.1 = [4 x i8] c"Don\00"
@.str.2 = [7 x i8] c"Pepito\00"
@.str.3 = [5 x i8] c"Jose\00"
@.str.4 = [30 x i8] c"****** Escribo mensaje ******\00"
@.str.5 = [7 x i8] c"Envio \00"
@.str.6 = [11 x i8] c"simpleconv\00"
@.str.7 = [28 x i8] c"***************************\00"
define void @escribe() {
%1 = tail call i32 @printLn(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%2 = tail call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%3 = tail call i32 @printLn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @putMsgQueue(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%5 = tail call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%6 = tail call i32 @printLn(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @printLn(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @putMsgQueue(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%10 = tail call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%11 = tail call i32 @printLn(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 @printLn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 @putMsgQueue(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%15 = tail call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%16 = tail call i32 @printLn(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%17 = tail call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%18 = tail call i32 @printLn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @putMsgQueue(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%20 = tail call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%21 = tail call i32 @printLn(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%22 = tail call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%23 = tail call i32 @printLn(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%24 = tail call i32 @putMsgQueue(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%25 = tail call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%26 = tail call i32 @printLn(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%27 = tail call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%28 = tail call i32 @printLn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%29 = tail call i32 @putMsgQueue(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%30 = tail call i32 @printLn(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
ret void
}