#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 /*<<< orphan*/ scanf(char *, char *, char *);
int sf_extend(char *, char *);
int main(int argc, const char *argv[]) {
  char s[100], t[100];
  int result;
  scanf("%s %s", s, t);
  result = sf_extend(s, t);
  if (result == 1) {
    printf("S é seguimento de T\n");
  } else {
    printf("S nao é segmento de T\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
lea    0xea5(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1050 <sf_extend@plt>
mov    %eax,-0xf4(%rbp)
cmpl   $0x1,-0xf4(%rbp)
jne    1194 <main+0x64>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
jmp    11a0 <main+0x70>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xebf(%rip),%rdi
lea    0x70(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <sf_extend@plt>
cmp    $0x1,%eax
lea    0xeb4(%rip),%rax
lea    0xe96(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [22 x i8] c"S \C3\A9 seguimento de T\0A\00"
@.str.2 = [24 x i8] c"S nao \C3\A9 segmento de T\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%14 = call i32 @sf_extend(i8* %12, i8* %13)
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %21
19: ; preds = %2
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@str = [23 x i8] c"S nao \C3\A9 segmento de T\00"
@str.3 = [21 x i8] c"S \C3\A9 seguimento de T\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 @sf_extend(i8* %5, i8* %6)
%9 = icmp eq i32 %8, 1
%10 = select i1 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}