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

/* Variables and functions */
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ printf(char *, ...);
int print_cmdl_help(char *prog_name) {
  printf("DarkWorld's debugger (dwbugger).\n"
         "License GPLv2.\n\n"
         "Debug or trace program: %s <program> [arguments]\n"
         "Attach to some program: %s --attach <pid>\n",
         prog_name, prog_name);
  printf("\nCommands in %s:\n", prog_name);
  print_help();
  printf("\nEnjoy it.\n");
  return 0;
}


x86 assembly (clang, -O0):
<print_cmdl_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print_help@plt>
lea    0xf3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cmdl_help>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf3e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <print_help@plt>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [141 x i8] c"DarkWorld's debugger (dwbugger).\0ALicense GPLv2.\0A\0ADebug or trace program: %s <program> [arguments]\0AAttach to some program: %s --attach <pid>\0A\00"
@.str.1 = [18 x i8] c"\0ACommands in %s:\0A\00"
@.str.2 = [12 x i8] c"\0AEnjoy it.\0A\00"
define i32 @print_cmdl_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @print_help()
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [141 x i8] c"DarkWorld's debugger (dwbugger).\0ALicense GPLv2.\0A\0ADebug or trace program: %s <program> [arguments]\0AAttach to some program: %s --attach <pid>\0A\00"
@.str.1 = [18 x i8] c"\0ACommands in %s:\0A\00"
@str = [11 x i8] c"\0AEnjoy it.\00"
define i32 @print_cmdl_help(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @print_help()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}