#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*/ str2;
typedef int /*<<< orphan*/ str1;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int strcmp(char *, char *);
int main(int argc, char const *argv[]) {
  char str1[20], str2[20];
  int ret;
  fgets(str1, sizeof(str1), stdin);
  fgets(str2, sizeof(str2), stdin);
  ret = strcmp(str1, str2);
  printf("%d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1040 <fgets@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1040 <fgets@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <strcmp@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%esi
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    0x2eaa(%rip),%rbx
mov    (%rbx),%edx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x14,%esi
call   1040 <fgets@plt>
mov    (%rbx),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <fgets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
lea    0xe8a(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
%7 = alloca [20 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 20, i32 %10)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 20, i32 %13)
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%17 = call i32 @strcmp(i8* %15, i8* %16)
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %5, i32 20, i32 %7)
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %6, i32 20, i32 %9)
%11 = call i32 @strcmp(i8* %5, i8* %6)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}