int main() {
  char str[90], str1[90];
  scanf("%s", str);
  printf("result=%s\n", str);
  gets(str1);
  puts(str1);
  printf("%s\n", strcat(str, "wangbadan"));
  printf("%d", str);
  printf("%d", strlen(str1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rsi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc0(%rbp),%rdi
mov    $0x0,%al
call   1060 <gets@plt>
lea    -0xc0(%rbp),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    -0x60(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1080 <strcat@plt>
mov    %rax,%rsi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc0(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xc0,%rsp
lea    0xe9d(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe8c(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x60(%rsp),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <gets@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movabs $0x61646162676e6177,%rcx
61 64 61
mov    %rcx,(%rsp,%rax,1)
movw   $0x6e,0x8(%rsp,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe52(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"result=%s\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [10 x i8] c"wangbadan\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [90 x i8]
%3 = alloca [90 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [90 x i8], [90 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [90 x i8], [90 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [90 x i8], [90 x i8]* %3, i64 0, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %8)
%10 = getelementptr inbounds [90 x i8], [90 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %10)
%12 = getelementptr inbounds [90 x i8], [90 x i8]* %2, i64 0, i64 0
%13 = call i8* @strcat(i8* %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [90 x i8], [90 x i8]* %2, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [90 x i8], [90 x i8]* %3, i64 0, i64 0
%18 = call i64 @strlen(i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"result=%s\0A\00"
@.str.3 = [10 x i8] c"wangbadan\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [90 x i8]
%2 = alloca [90 x i8]
%3 = getelementptr inbounds [90 x i8], [90 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [90 x i8], [90 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %4)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %4)
%9 = call i64 @strlen(i8* %3)
%10 = getelementptr [90 x i8], [90 x i8]* %1, i64 0, i64 %9
%11 = call i32 bitcast (i32 (...)* @puts to i32 (i8*)*)(i8* %3)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%13 = call i64 @strlen(i8* %4)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 %13)
ret i32 0
}