#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, char *);
char strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, char);
int main(void) {
  char code[101], res[101], lcode, lres, *pcode;
  while (scanf("%s", code) != EOF) {
    scanf("%s", res);
    pcode = code;
    lcode = strlen(code);
    lres = strlen(res);
    while (lcode >= lres) {
      if (!strncmp(pcode, res, lres)) {
        printf("Resistente\n");
        goto GOON;
      }
      lcode--, pcode++;
    }
    printf("Nao resistente\n");
  GOON:;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%rax
je     1231 <main+0xf1>
lea    -0xe0(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    %al,-0xe1(%rbp)
lea    -0xe0(%rbp),%rdi
call   1040 <strlen@plt>
mov    %al,-0xe2(%rbp)
movsbl -0xe1(%rbp),%eax
movsbl -0xe2(%rbp),%ecx
cmp    %ecx,%eax
jl     1220 <main+0xe0>
mov    -0xf0(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
movsbl -0xe2(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11fb <main+0xbb>
lea    0xe12(%rip),%rdi
call   1050 <printf@plt>
jmp    122c <main+0xec>
mov    -0xe1(%rbp),%al
add    $0xff,%al
mov    %al,-0xe1(%rbp)
mov    -0xf0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xf0(%rbp)
jmp    11b1 <main+0x71>
lea    0xde8(%rip),%rdi
call   1050 <printf@plt>
jmp    1152 <main+0x12>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0xea8(%rip),%rdi
lea    0x70(%rsp),%r15
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0x2e7c(%rip),%r14
cmp    (%r14),%rax
jne    1185 <main+0x45>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe74(%rip),%rbp
mov    %rsp,%r12
jmp    11c3 <main+0x83>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe6b(%rip),%rdi
lea    0xe52(%rip),%rbp
call   1040 <puts@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
cmp    (%r14),%rax
je     1171 <main+0x31>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1050 <strlen@plt>
lea    0xe1c(%rip),%rdi
cmp    %al,%bl
jl     11ae <main+0x6e>
mov    %eax,%r13d
mov    %r15,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %r13b,%edx
mov    %rbp,%rdi
mov    %r12,%rsi
call   1030 <strncmp@plt>
test   %eax,%eax
je     11a0 <main+0x60>
add    $0xff,%bl
add    $0x1,%rbp
cmp    %r13b,%bl
jge    1200 <main+0xc0>
lea    0xddd(%rip),%rdi
jmp    11a7 <main+0x67>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [12 x i8] c"Resistente\0A\00"
@.str.2 = [16 x i8] c"Nao resistente\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x i8]
%3 = alloca [101 x i8]
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
store i32 0, i32* %1
br label %7
7: ; preds = %41, %0
%8 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %42
12: ; preds = %7
%13 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%14 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
store i8* %15, i8** %6
%16 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%17 = call signext i8 @strlen(i8* %16)
store i8 %17, i8* %4
%18 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%19 = call signext i8 @strlen(i8* %18)
store i8 %19, i8* %5
br label %20
20: ; preds = %34, %12
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = load i8, i8* %5
%24 = sext i8 %23 to i32
%25 = icmp sge i32 %22, %24
br i1 %25, label %26, label %39
26: ; preds = %20
%27 = load i8*, i8** %6
%28 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%29 = load i8, i8* %5
%30 = call i32 @strncmp(i8* %27, i8* %28, i8 signext %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %26
%33 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %41
34: ; preds = %26
%35 = load i8, i8* %4
%36 = add i8 %35, -1
store i8 %36, i8* %4
%37 = load i8*, i8** %6
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %6
br label %20
39: ; preds = %20
%40 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %41
41: ; preds = %39, %32
br label %7
42: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@str = [15 x i8] c"Nao resistente\00"
@str.3 = [11 x i8] c"Resistente\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = alloca [101 x i8]
%3 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %28, label %8
8: ; preds = %0, %22
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call signext i8 @strlen(i8* %3)
%11 = call signext i8 @strlen(i8* %4)
%12 = icmp slt i8 %10, %11
br i1 %12, label %22, label %13
13: ; preds = %8, %18
%14 = phi i8* [ %20, %18 ], [ %3, %8 ]
%15 = phi i8 [ %19, %18 ], [ %10, %8 ]
%16 = call i32 @strncmp(i8* %14, i8* %4, i8 signext %11)
%17 = icmp eq i32 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %13
%19 = add i8 %15, -1
%20 = getelementptr inbounds i8, i8* %14, i64 1
%21 = icmp slt i8 %19, %11
br i1 %21, label %22, label %13
22: ; preds = %18, %13, %8
%23 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0), %8 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0), %13 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0), %18 ]
%24 = call i32 @puts(i8* dereferenceable(1) %23)
%25 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%26 = load i64, i64* @EOF
%27 = icmp eq i64 %25, %26
br i1 %27, label %28, label %8
28: ; preds = %22, %0
ret i32 0
}