#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 */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
char *prog_inv_sh_nm_from_file(char *, int);
int /*<<< orphan*/ *stderr;
void __attribute__((__noreturn__)) usage(FILE *out) {
  fprintf(out, ("Usage: %s [options] <mount point>\n\nOptions:\n"),
          prog_inv_sh_nm_from_file(
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Romutk/lab3.2n/refs/heads/master/"
              "sys-utils/fsfreeze.c",
              1));
  fprintf(out, (" -h, --help          this help\n"
                " -f, --freeze        freeze the filesystem\n"
                " -u, --unfreeze      unfreeze the filesystem\n"));
  fprintf(out, ("\nFor more information see fsfreeze(8).\n"));
  exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x1,%esi
call   1040 <prog_inv_sh_nm_from_file@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
lea    0xe9d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf48(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xfae(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    0x2e47(%rip),%rcx
cmp    (%rcx),%rax
jne    11b3 <usage+0x83>
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    11bf <usage+0x8f>
mov    0x2e16(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee2(%rip),%rdi
mov    $0x1,%esi
call   1040 <prog_inv_sh_nm_from_file@plt>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xf4d(%rip),%rdi
mov    $0x77,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xfac(%rip),%rdi
mov    $0x27,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    0x2e3e(%rip),%rax
cmp    %rbx,(%rax)
jne    11b5 <usage+0x75>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: %s [options] <mount point>\0A\0AOptions:\0A\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Romutk/lab3.2n/refs/heads/master/sys-utils/fsfreeze.c\00"
@.str.2 = [120 x i8] c" -h, --help this help\0A -f, --freeze freeze the filesystem\0A -u, --unfreeze unfreeze the filesystem\0A\00"
@.str.3 = [40 x i8] c"\0AFor more information see fsfreeze(8).\0A\00"
@stderr = global i32* null
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i8* @prog_inv_sh_nm_from_file(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32*, i32** %2
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32*, i32** %2
%11 = load i32*, i32** @stderr
%12 = icmp eq i32* %10, %11
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* @EXIT_FAILURE
br label %17
15: ; preds = %1
%16 = load i32, i32* @EXIT_SUCCESS
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
%19 = call i32 @exit(i32 %18)
unreachable
}

LLVM IR (-O2):
@.str = [45 x i8] c"Usage: %s [options] <mount point>\0A\0AOptions:\0A\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Romutk/lab3.2n/refs/heads/master/sys-utils/fsfreeze.c\00"
@.str.2 = [120 x i8] c" -h, --help this help\0A -f, --freeze freeze the filesystem\0A -u, --unfreeze unfreeze the filesystem\0A\00"
@.str.3 = [40 x i8] c"\0AFor more information see fsfreeze(8).\0A\00"
@stderr = global i32* null
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage(i32* nocapture %0) {
%2 = tail call i8* @prog_inv_sh_nm_from_file(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str.2, i64 0, i64 0), i64 119, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i64 39, i64 1, i32* %0)
%6 = load i32*, i32** @stderr
%7 = icmp eq i32* %6, %0
%8 = load i32, i32* @EXIT_FAILURE
%9 = load i32, i32* @EXIT_SUCCESS
%10 = select i1 %7, i32 %8, i32 %9
%11 = tail call i32 @exit(i32 %10)
unreachable
}