#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*/ printf(char *, ...);
void *exibeMsgErro(char *msg, int linha, int coluna, char *esperado,
                   char *encontrado) {
  if (linha > 0) {
    printf("%d:", linha);
    if (coluna > 0)
      printf("%d:", coluna);
  }
  if (msg) {
    printf(" erro: %s.", msg);
    if (esperado) {
      printf(" Esperava-se '%s', mas foi encontrado '%s'.", esperado,
             encontrado);
    }
  }
  printf("\n");
  return NULL;
}


x86 assembly (clang, -O0):
<exibeMsgErro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1165 <exibeMsgErro+0x55>
mov    -0xc(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
jle    1160 <exibeMsgErro+0x50>
mov    -0x10(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1165 <exibeMsgErro+0x55>
cmpq   $0x0,-0x8(%rbp)
je     11a8 <exibeMsgErro+0x98>
mov    -0x8(%rbp),%rsi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
je     11a3 <exibeMsgErro+0x93>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a8 <exibeMsgErro+0x98>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exibeMsgErro>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdi,%rbx
test   %esi,%esi
jle    1158 <exibeMsgErro+0x38>
mov    %edx,%ebp
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jle    1158 <exibeMsgErro+0x38>
lea    0xeb1(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %rbx,%rbx
je     1187 <exibeMsgErro+0x67>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15,%r15
je     1187 <exibeMsgErro+0x67>
lea    0xe95(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d:\00"
@.str.1 = [11 x i8] c" erro: %s.\00"
@.str.2 = [44 x i8] c" Esperava-se '%s', mas foi encontrado '%s'.\00"
@.str.3 = [2 x i8] c"\0A\00"
define i8* @exibeMsgErro(i8* %0, i32 %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %5
%14 = load i32, i32* %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %8
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32, i32* %8
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %13
br label %22
22: ; preds = %21, %5
%23 = load i8*, i8** %6
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i8*, i8** %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = load i8*, i8** %9
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %34
30: ; preds = %25
%31 = load i8*, i8** %9
%32 = load i8*, i8** %10
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* %31, i8* %32)
br label %34
34: ; preds = %30, %25
br label %35
35: ; preds = %34, %22
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d:\00"
@.str.1 = [11 x i8] c" erro: %s.\00"
@.str.2 = [44 x i8] c" Esperava-se '%s', mas foi encontrado '%s'.\00"
define noalias i8* @exibeMsgErro(i8* %0, i32 %1, i32 %2, i8* %3, i8* %4) {
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%9 = icmp sgt i32 %2, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %12
12: ; preds = %7, %10, %5
%13 = icmp eq i8* %0, null
br i1 %13, label %19, label %14
14: ; preds = %12
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%16 = icmp eq i8* %3, null
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4)
br label %19
19: ; preds = %14, %17, %12
%20 = tail call i32 @putchar(i32 10)
ret i8* null
}