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

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void show(char *f, int nbit, int ebit, int *nbr) {
  FILE *file;
  char line[2400];
  file = fopen(f, "r");
  if (file == 0)
    (void)fprintf(stderr, "Error: %s.\n", strerror(errno));
  exit(EXIT_FAILURE);
  while (fscanf(file, "%[^\n]\n", line) != EOF) {
    if (nbit == 1 && ebit == 1) {
      printf("$   %d.%s\n", *nbr, line);
      *nbr = *nbr + 1;
    } else if (nbit == 1 && ebit != 1) {
      printf("%d.%s\n", *nbr, line);
      *nbr = *nbr + 1;
    } else if (nbit != 1 && ebit == 1) {
      printf("$   %s\n", line);
    } else {
      printf("%s\n", line);
    }
  }
  fclose(file);
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x990,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11aa <show+0x6a>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x984(%rbp)
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x984(%rbp),%edi
mov    %rax,%rdx
lea    0xe5d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<show>:
push   %rbx
lea    0xeb8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
jne    117a <show+0x3a>
mov    0x2e87(%rip),%rax
mov    (%rax),%ebx
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe92(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [12 x i8] c"Error: %s.\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@EOF = global i64 0
define void @show(i8* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca [2400 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%11 = load i8*, i8** %5
%12 = call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %12, i32** %9
%13 = load i32*, i32** %9
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %20
15: ; preds = %4
%16 = load i32, i32* @stderr
%17 = load i32, i32* @errno
%18 = call i8* @strerror(i32 %17)
%19 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %15, %4
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [12 x i8] c"Error: %s.\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@EOF = global i64 0
define void @show(i8* nocapture %0, i32 %1, i32 %2, i32* nocapture readnone %3) {
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = tail call i8* @strerror(i32 %9)
%11 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %7, %4
%13 = load i32, i32* @EXIT_FAILURE
%14 = tail call i32 @exit(i32 %13)
unreachable
}