#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(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void print_usage(FILE *stream, char *app_name, int exit_code) {
  fprintf(stream, "Usage: %s [options]\n", app_name);
  fprintf(
      stream,
      " -h  --help                Display this usage information.\n"
      " -d  --dev <device_file>   Use <device_file> as watchdog device file.\n"
      "                           The default device file is '/dev/watchdog'\n"
      " -f  --feed                Feed the watchdog\n"
      " -i  --interval <interval> Change the watchdog interval time\n"
      " -s  --status              Check the watchdog status\n"
      " -S  --shutdown            Attempt to shutdown watchdog if nowayout is "
      "0\n");
  exit(exit_code);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xebe(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xec5(%rip),%rdi
mov    $0x1af,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %ebp,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s [options]\0A\00"
@.str.1 = [432 x i8] c" -h --help Display this usage information.\0A -d --dev <device_file> Use <device_file> as watchdog device file.\0A The default device file is '/dev/watchdog'\0A -f --feed Feed the watchdog\0A -i --interval <interval> Change the watchdog interval time\0A -s --status Check the watchdog status\0A -S --shutdown Attempt to shutdown watchdog if nowayout is 0\0A\00"
define void @print_usage(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32*, i32** %4
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([432 x i8], [432 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %6
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s [options]\0A\00"
@.str.1 = [432 x i8] c" -h --help Display this usage information.\0A -d --dev <device_file> Use <device_file> as watchdog device file.\0A The default device file is '/dev/watchdog'\0A -f --feed Feed the watchdog\0A -i --interval <interval> Change the watchdog interval time\0A -s --status Check the watchdog status\0A -S --shutdown Attempt to shutdown watchdog if nowayout is 0\0A\00"
define void @print_usage(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([432 x i8], [432 x i8]* @.str.1, i64 0, i64 0), i64 431, i64 1, i32* %0)
%6 = tail call i32 @exit(i32 %2)
unreachable
}