#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 *, ...);
char *strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
unsigned int _string(FILE *output) {
  char str1[25], str2[6];
  int stra, strb;
  strcpy(str1, "Teste de Sanidade");
  strcpy(str2, "DCOMP");
  stra = strlen(str1);
  strb = strlen(str2);
  fprintf(output, "%u%u", stra, strb);
  if (strcmp(str1, str2) == 0)
    fprintf(output, "%s", "EQ");
  else
    fprintf(output, "%s", "NEQ");
  fprintf(output, "%s", strcat(str1, "DCOMP"));
  return 6;
}


x86 assembly (clang, -O0):
<_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x36(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x3c(%rbp)
lea    -0x36(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x3c(%rbp),%edx
mov    -0x40(%rbp),%ecx
lea    0xe73(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x36(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11e1 <_string+0x91>
mov    -0x8(%rbp),%rdi
lea    0xe4f(%rip),%rsi
lea    0xe4c(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    11fa <_string+0xaa>
mov    -0x8(%rbp),%rdi
lea    0xe31(%rip),%rsi
lea    0xe2d(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe05(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x48(%rbp),%rdi
mov    %rax,%rdx
lea    0xdfd(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x6,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_string>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rbx
lea    0xe8c(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0xe8a(%rip),%rsi
lea    0xa(%rsp),%r15
mov    %r15,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    0xe6a(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11da <_string+0x7a>
lea    0xe4a(%rip),%rdi
mov    $0x3,%esi
jmp    11e6 <_string+0x86>
lea    0xe3d(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
movl   $0x4d4f4344,0x10(%rsp,%rax,1)
4d
movw   $0x50,0x14(%rsp,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <fputs@plt>
mov    $0x6,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Teste de Sanidade\00"
@.str.1 = [6 x i8] c"DCOMP\00"
@.str.2 = [5 x i8] c"%u%u\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [3 x i8] c"EQ\00"
@.str.5 = [4 x i8] c"NEQ\00"
define i32 @_string(i32* %0) {
%2 = alloca i32*
%3 = alloca [25 x i8]
%4 = alloca [6 x i8]
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
store i32 %12, i32* %5
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
store i32 %14, i32* %6
%15 = load i32*, i32** %2
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 %17)
%19 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%20 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%21 = call i64 @strcmp(i8* %19, i8* %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %1
%24 = load i32*, i32** %2
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %29
26: ; preds = %1
%27 = load i32*, i32** %2
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %29
29: ; preds = %26, %23
%30 = load i32*, i32** %2
%31 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%32 = call i8* @strcat(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %32)
ret i32 6
}

LLVM IR (-O2):
@.str = [18 x i8] c"Teste de Sanidade\00"
@.str.1 = [6 x i8] c"DCOMP\00"
@.str.2 = [5 x i8] c"%u%u\00"
@.str.4 = [3 x i8] c"EQ\00"
@.str.5 = [4 x i8] c"NEQ\00"
define i32 @_string(i32* nocapture %0) {
%2 = alloca [25 x i8]
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%6 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @strlen(i8* %4)
%9 = call i32 @strlen(i8* %5)
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i64 @strcmp(i8* %4, i8* %5)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 2, i64 1, i32* %0)
br label %17
15: ; preds = %1
%16 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 3, i64 1, i32* %0)
br label %17
17: ; preds = %15, %13
%18 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %4)
%19 = getelementptr [25 x i8], [25 x i8]* %2, i64 0, i64 %18
%20 = call i32 @fputs(i8* %4, i32* %0)
ret i32 6
}