#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*/ error_number;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
char *strerror(int /*<<< orphan*/);
int main() {
  char error_number[10];
  while (1) {
    puts("\nPlease, enter a error number:");
    if (fgets(error_number, sizeof(error_number), stdin) != NULL) {
      printf("It means %s\n", strerror(atoi(error_number)));
    } else {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
lea    -0xe(%rbp),%rdi
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     11b0 <main+0x60>
lea    -0xe(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1070 <strerror@plt>
mov    %rax,%rsi
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
jmp    11b5 <main+0x65>
jmp    11ba <main+0x6a>
jmp    115f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e7a(%rip),%r12
mov    (%r12),%edx
lea    0xe(%rsp),%rdi
mov    $0xa,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     11d8 <main+0x88>
lea    0xe(%rsp),%rbx
lea    0xe8d(%rip),%r14
lea    0xe67(%rip),%r15
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1070 <strerror@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <fgets@plt>
test   %rax,%rax
jne    11a0 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0APlease, enter a error number:\00"
@stdin = global i32 0
@.str.1 = [13 x i8] c"It means %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %15
%4 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32* @fgets(i8* %5, i32 10, i32 %6)
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%11 = call i32 @atoi(i8* %10)
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %15
14: ; preds = %3
br label %16
15: ; preds = %9
br label %3
16: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0APlease, enter a error number:\00"
@stdin = global i32 0
@.str.1 = [13 x i8] c"It means %s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32* @fgets(i8* %2, i32 10, i32 %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %15, label %7
7: ; preds = %0, %7
%8 = call i32 @atoi(i8* %2)
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stdin
%13 = call i32* @fgets(i8* %2, i32 10, i32 %12)
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %7
15: ; preds = %7, %0
ret i32 0
}