#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_usage();
int cmd_off(int /*<<< orphan*/ *);
int /*<<< orphan*/ strcmp(char *, char *);
int _pm_handler(int argc, char **argv) {
  if (argc < 2) {
    _print_usage();
    return 1;
  }
  if (!strcmp(argv[1], "off")) {
    return cmd_off(NULL);
  }
  _print_usage();
  return 1;
}


x86 assembly (clang, -O0):
<_pm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115c <_pm_handler+0x2c>
mov    $0x0,%al
call   1040 <_print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1198 <_pm_handler+0x68>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe95(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    118a <_pm_handler+0x5a>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <cmd_off@plt>
mov    %eax,-0x4(%rbp)
jmp    1198 <_pm_handler+0x68>
mov    $0x0,%al
call   1040 <_print_usage@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pm_handler>:
push   %rax
cmp    $0x1,%edi
jle    114a <_pm_handler+0x1a>
mov    0x8(%rsi),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1158 <_pm_handler+0x28>
xor    %eax,%eax
call   1040 <_print_usage@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %edi,%edi
pop    %rax
jmp    1050 <cmd_off@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"off\00"
define i32 @_pm_handler(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @_print_usage()
store i32 1, i32* %3
br label %20
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %10
%17 = call i32 @cmd_off(i32* null)
store i32 %17, i32* %3
br label %20
18: ; preds = %10
%19 = call i32 (...) @_print_usage()
store i32 1, i32* %3
br label %20
20: ; preds = %18, %16, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"off\00"
define i32 @_pm_handler(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @_print_usage()
br label %15
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @cmd_off(i32* null)
br label %15
13: ; preds = %6
%14 = tail call i32 (...) @_print_usage()
br label %15
15: ; preds = %13, %11, %4
%16 = phi i32 [ 1, %4 ], [ 1, %13 ], [ %12, %11 ]
ret i32 %16
}