char *fgets(char *restrict __s, signed int __n,
            struct _IO_FILE *restrict __stream) {
  char *return_value___fgets_chk$1;
  char *return_value___fgets_chk_warn$2;
  if ((_Bool)0) {
  __CPROVER_DUMP_L1:;
    return_value___fgets_chk$1 =
        __fgets_chk(__s, 18446744073709551615ul, __n, __stream);
    return return_value___fgets_chk$1;
    if ((unsigned long int)__n > 18446744073709551615ul) {
      return_value___fgets_chk_warn$2 =
          __fgets_chk_warn(__s, 18446744073709551615ul, __n, __stream);
      return return_value___fgets_chk_warn$2;
    }
  }
  char *return_value___fgets_alias$3;
  return_value___fgets_alias$3 = __fgets_alias(__s, __n, __stream);
  return return_value___fgets_alias$3;
}


x86 assembly (clang, -O0):
<fgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1142 <fgets+0x22>
jmp    1173 <fgets+0x53>
jmp    1147 <fgets+0x27>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0xffffffffffffffff,%rsi
mov    $0x0,%al
call   1040 <__fgets_chk@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1193 <fgets+0x73>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1030 <__fgets_alias@plt>
cltq
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets>:
push   %rax
xor    %eax,%eax
call   1030 <__fgets_alias@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct._IO_FILE = type opaque
define i8* @fgets(i8* noalias %0, i32 %1, %struct._IO_FILE* noalias %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct._IO_FILE*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store %struct._IO_FILE* %2, %struct._IO_FILE** %7
br i1 false, label %11, label %20
11: ; preds = %3
br label %12
12: ; preds = %11
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = load %struct._IO_FILE*, %struct._IO_FILE** %7
%16 = call i32 (i8*, i64, i32, %struct._IO_FILE*, ...) bitcast (i32 (...)* @__fgets_chk to i32 (i8*, i64, i32, %struct._IO_FILE*, ...)*)(i8* %13, i64 -1, i32 %14, %struct._IO_FILE* %15)
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %8
%19 = load i8*, i8** %8
store i8* %19, i8** %4
br label %28
20: ; preds = %3
%21 = load i8*, i8** %5
%22 = load i32, i32* %6
%23 = load %struct._IO_FILE*, %struct._IO_FILE** %7
%24 = call i32 (i8*, i32, %struct._IO_FILE*, ...) bitcast (i32 (...)* @__fgets_alias to i32 (i8*, i32, %struct._IO_FILE*, ...)*)(i8* %21, i32 %22, %struct._IO_FILE* %23)
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to i8*
store i8* %26, i8** %10
%27 = load i8*, i8** %10
store i8* %27, i8** %4
br label %28
28: ; preds = %20, %12
%29 = load i8*, i8** %4
ret i8* %29
}

LLVM IR (-O2):
%struct._IO_FILE = type opaque
define i8* @fgets(i8* noalias %0, i32 %1, %struct._IO_FILE* noalias %2) {
%4 = tail call i32 (i8*, i32, %struct._IO_FILE*, ...) bitcast (i32 (...)* @__fgets_alias to i32 (i8*, i32, %struct._IO_FILE*, ...)*)(i8* %0, i32 %1, %struct._IO_FILE* %2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}