#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 *, int);
int /*<<< orphan*/ scanf(char *, char *);
void LeiaDadosDasEmpresas(int quantEmpresas, char **nomeEmpresas) {
  for (int i = 0; i < quantEmpresas; i++) {
    printf("\nDigite o nome da %dª empresa: ", i + 1);
    scanf("%s", nomeEmpresas[i]);
  }
}


x86 assembly (clang, -O0):
<LeiaDadosDasEmpresas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117a <LeiaDadosDasEmpresas+0x5a>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeba(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <LeiaDadosDasEmpresas+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeiaDadosDasEmpresas>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1172 <LeiaDadosDasEmpresas+0x52>
mov    %rsi,%r12
mov    %edi,%r13d
xor    %ebp,%ebp
lea    0xec2(%rip),%r14
lea    0xedc(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbp),%rbx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    (%r12,%rbp,8),%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rbp
cmp    %rbx,%r13
jne    1150 <LeiaDadosDasEmpresas+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0ADigite o nome da %d\C2\AA empresa: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @LeiaDadosDasEmpresas(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i8**, i8*** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %10
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0ADigite o nome da %d\C2\AA empresa: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @LeiaDadosDasEmpresas(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %9, %7 ]
%9 = add nuw nsw i64 %8, 1
%10 = trunc i64 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 %8
%13 = load i8*, i8** %12
%14 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = icmp eq i64 %9, %5
br i1 %15, label %6, label %7
}