#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (1 != argc) {
    (void)fprintf(stderr, "Usage: %s\n", argv[0]);
    return EXIT_FAILURE;
  }
  if (-1 == kill(1, SIGUSR2))
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
je     1171 <main+0x51>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11b0 <main+0x90>
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   1040 <kill@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    11a4 <main+0x84>
mov    0x2e36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11b0 <main+0x90>
mov    0x2e1d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1147 <main+0x27>
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   1040 <kill@plt>
cmp    $0xffffffff,%eax
je     115f <main+0x3f>
mov    0x2e83(%rip),%rax
jmp    1166 <main+0x46>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Usage: %s\0A\00"
@EXIT_FAILURE = global i32 0
@SIGUSR2 = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 1, %6
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
store i32 %14, i32* %3
br label %23
15: ; preds = %2
%16 = load i32, i32* @SIGUSR2
%17 = call i32 @kill(i32 1, i32 %16)
%18 = icmp eq i32 -1, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i32, i32* @EXIT_FAILURE
store i32 %20, i32* %3
br label %23
21: ; preds = %15
%22 = load i32, i32* @EXIT_SUCCESS
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %19, %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Usage: %s\0A\00"
@EXIT_FAILURE = global i32 0
@SIGUSR2 = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %13
8: ; preds = %2
%9 = load i32, i32* @SIGUSR2
%10 = tail call i32 @kill(i32 1, i32 %9)
%11 = icmp eq i32 %10, -1
%12 = select i1 %11, i32* @EXIT_FAILURE, i32* @EXIT_SUCCESS
br label %13
13: ; preds = %8, %4
%14 = phi i32* [ @EXIT_FAILURE, %4 ], [ %12, %8 ]
%15 = load i32, i32* %14
ret i32 %15
}