#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
void imprimeAltera(FILE *fAltera, char *tipo, char *nome, char *nomeUpperCase) {
  char nomeInicialUpper[80];
  strcpy(nomeInicialUpper, nome);
  if ('a' <= nomeInicialUpper[0] && nomeInicialUpper[0] <= 'z')
    nomeInicialUpper[0] += 'A' - 'a';
  fprintf(fAltera, "\t/* Testar PRF altera %s professor */\n", nome);
  fprintf(fAltera, "\n");
  fprintf(fAltera,
          "\telse if ( strcmp( ComandoTeste , ALTERA_%s_CMD ) == 0 ){\n",
          nomeUpperCase);
  fprintf(fAltera,
          "\t\tNumLidos = LER_LerParametros( \"i%ci\" , &index, %s, "
          "&CondRetEsperada );\n",
          *tipo == 'c' ? 's' : 'i', *tipo == 'c' ? "paramString" : "&paramInt");
  fprintf(fAltera, "\t\tif(NumLidos != 3){\n");
  fprintf(fAltera, "\t\t\treturn TST_CondRetParm;\n");
  fprintf(fAltera, "\t\t} /* if */\n");
  fprintf(fAltera, "\n");
  fprintf(fAltera, "\t\tCondRetObtido = PRF_altera%s(p[index], param%s);\n",
          nomeInicialUpper, *tipo == 'c' ? "String" : "Int");
  fprintf(fAltera, "\n");
  fprintf(fAltera,
          "\t\treturn TST_CompararInt(CondRetEsperada, CondRetObtido,\n");
  fprintf(fAltera, "\t\t\t\t\"Retorno errado ao alterar %s de Professor.\");\n",
          nomeInicialUpper);
  fprintf(fAltera, "\t} /* fim ativa: Testar PRF altera %s professor */\n",
          nomeInicialUpper);
  fprintf(fAltera, "\n");
}


x86 assembly (clang, -O0):
<imprimeAltera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
movsbl -0x70(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     116d <imprimeAltera+0x4d>
movsbl -0x70(%rbp),%eax
cmp    $0x7a,%eax
jg     116d <imprimeAltera+0x4d>
movsbl -0x70(%rbp),%eax
add    $0xffffffe0,%eax
mov    %al,-0x70(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xfe0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xe83(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x69,%edx
mov    $0x73,%eax
cmp    $0x63,%ecx
cmove  %eax,%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xee4(%rip),%rcx
lea    0xed1(%rip),%rax
cmp    $0x63,%esi
cmove  %rax,%rcx
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf3d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rdx
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xe70(%rip),%rcx
lea    0xe5c(%rip),%rax
cmp    $0x63,%esi
cmove  %rax,%rcx
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xef9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xef1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeAltera>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    %rdx,%rsi
call   1030 <strcpy@plt>
mov    (%rsp),%al
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1172 <imprimeAltera+0x32>
add    $0xe0,%al
mov    %al,(%rsp)
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
cmpb   $0x63,(%r14)
mov    $0x73,%eax
mov    $0x69,%edx
cmove  %eax,%edx
lea    0xeed(%rip),%rax
lea    0xef2(%rip),%rcx
cmove  %rax,%rcx
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xee0(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xedd(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xee0(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
cmpb   $0x63,(%r14)
lea    0xe73(%rip),%rax
lea    0xe79(%rip),%rcx
cmove  %rax,%rcx
lea    0xeb2(%rip),%rsi
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
lea    0xec2(%rip),%rdi
mov    $0x39,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xf03(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\09/* Testar PRF altera %s professor */\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [59 x i8] c"\09else if ( strcmp( ComandoTeste , ALTERA_%s_CMD ) == 0 ){\0A\00"
@.str.3 = [74 x i8] c"\09\09NumLidos = LER_LerParametros( \22i%ci\22 , &index, %s, &CondRetEsperada );\0A\00"
@.str.4 = [12 x i8] c"paramString\00"
@.str.5 = [10 x i8] c"&paramInt\00"
@.str.6 = [22 x i8] c"\09\09if(NumLidos != 3){\0A\00"
@.str.7 = [28 x i8] c"\09\09\09return TST_CondRetParm;\0A\00"
@.str.8 = [14 x i8] c"\09\09} /* if */\0A\00"
@.str.9 = [52 x i8] c"\09\09CondRetObtido = PRF_altera%s(p[index], param%s);\0A\00"
@.str.10 = [7 x i8] c"String\00"
@.str.11 = [4 x i8] c"Int\00"
@.str.12 = [58 x i8] c"\09\09return TST_CompararInt(CondRetEsperada, CondRetObtido,\0A\00"
@.str.13 = [52 x i8] c"\09\09\09\09\22Retorno errado ao alterar %s de Professor.\22);\0A\00"
@.str.14 = [52 x i8] c"\09} /* fim ativa: Testar PRF altera %s professor */\0A\00"
define void @imprimeAltera(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [80 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %7
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp sle i32 97, %15
br i1 %16, label %17, label %28
17: ; preds = %4
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 122
br i1 %21, label %22, label %28
22: ; preds = %17
%23 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = add nsw i32 %25, -32
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
br label %28
28: ; preds = %22, %17, %4
%29 = load i32*, i32** %5
%30 = load i8*, i8** %7
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %30)
%32 = load i32*, i32** %5
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%34 = load i32*, i32** %5
%35 = load i8*, i8** %8
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = load i32*, i32** %5
%38 = load i8*, i8** %6
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 99
%42 = zext i1 %41 to i64
%43 = select i1 %41, i32 115, i32 105
%44 = load i8*, i8** %6
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 99
%48 = zext i1 %47 to i64
%49 = select i1 %47, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0)
%50 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.3, i64 0, i64 0), i32 %43, i8* %49)
%51 = load i32*, i32** %5
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%53 = load i32*, i32** %5
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%55 = load i32*, i32** %5
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%57 = load i32*, i32** %5
%58 = call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%59 = load i32*, i32** %5
%60 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%61 = load i8*, i8** %6
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 99
%65 = zext i1 %64 to i64
%66 = select i1 %64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0)
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i8* %60, i8* %66)
%68 = load i32*, i32** %5
%69 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%70 = load i32*, i32** %5
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.12, i64 0, i64 0))
%72 = load i32*, i32** %5
%73 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.13, i64 0, i64 0), i8* %73)
%75 = load i32*, i32** %5
%76 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0), i8* %76)
%78 = load i32*, i32** %5
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"\09/* Testar PRF altera %s professor */\0A\00"
@.str.2 = [59 x i8] c"\09else if ( strcmp( ComandoTeste , ALTERA_%s_CMD ) == 0 ){\0A\00"
@.str.3 = [74 x i8] c"\09\09NumLidos = LER_LerParametros( \22i%ci\22 , &index, %s, &CondRetEsperada );\0A\00"
@.str.4 = [12 x i8] c"paramString\00"
@.str.5 = [10 x i8] c"&paramInt\00"
@.str.6 = [22 x i8] c"\09\09if(NumLidos != 3){\0A\00"
@.str.7 = [28 x i8] c"\09\09\09return TST_CondRetParm;\0A\00"
@.str.8 = [14 x i8] c"\09\09} /* if */\0A\00"
@.str.9 = [52 x i8] c"\09\09CondRetObtido = PRF_altera%s(p[index], param%s);\0A\00"
@.str.10 = [7 x i8] c"String\00"
@.str.11 = [4 x i8] c"Int\00"
@.str.12 = [58 x i8] c"\09\09return TST_CompararInt(CondRetEsperada, CondRetObtido,\0A\00"
@.str.13 = [52 x i8] c"\09\09\09\09\22Retorno errado ao alterar %s de Professor.\22);\0A\00"
@.str.14 = [52 x i8] c"\09} /* fim ativa: Testar PRF altera %s professor */\0A\00"
define void @imprimeAltera(i32* nocapture %0, i8* nocapture %1, i8* %2, i8* %3) {
%5 = alloca [80 x i8]
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* %2)
%8 = load i8, i8* %6
%9 = add i8 %8, -97
%10 = icmp ult i8 %9, 26
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = add nsw i8 %8, -32
store i8 %12, i8* %6
br label %13
13: ; preds = %11, %4
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %2)
%15 = call i32 @fputc(i32 10, i32* %0)
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%17 = load i8, i8* %1
%18 = icmp eq i8 %17, 99
%19 = select i1 %18, i32 115, i32 105
%20 = select i1 %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0)
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.3, i64 0, i64 0), i32 %19, i8* %20)
%22 = call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i64 21, i64 1, i32* %0)
%23 = call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i64 27, i64 1, i32* %0)
%24 = call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i64 13, i64 1, i32* %0)
%25 = call i32 @fputc(i32 10, i32* %0)
%26 = load i8, i8* %1
%27 = icmp eq i8 %26, 99
%28 = select i1 %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0)
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i8* %6, i8* %28)
%30 = call i32 @fputc(i32 10, i32* %0)
%31 = call i64 @fwrite(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.12, i64 0, i64 0), i64 57, i64 1, i32* %0)
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.13, i64 0, i64 0), i8* %6)
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0), i8* %6)
%34 = call i32 @fputc(i32 10, i32* %0)
ret void
}