#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;
scalar_t__ SIG_ERR;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "Error in number of arguments\n");
    return EXIT_FAILURE;
  }
  if (signal(atoi(argv[1]), SIG_IGN) == SIG_ERR) {
    fprintf(stderr, "Error in handling the signal\n");
    _exit(EXIT_FAILURE);
  }
  while (1)
    ;
  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)
cmpl   $0x2,-0x8(%rbp)
je     1184 <main+0x44>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
mov    0x2e4e(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e28(%rip),%rcx
cmp    (%rcx),%rax
jne    11d4 <main+0x94>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
lea    0xe5d(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>
jmp    11d9 <main+0x99>
jmp    11d9 <main+0x99>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1172 <main+0x32>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    0x2e92(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <signal@plt>
mov    0x2e6a(%rip),%rcx
cmp    (%rcx),%rax
je     1192 <main+0x52>
nopl   0x0(%rax,%rax,1)
jmp    1170 <main+0x30>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Error in number of arguments\0A\00"
@EXIT_FAILURE = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str.1 = [30 x i8] c"Error in handling the signal\0A\00"
@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 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
ret i32 %11
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
%17 = load i32, i32* @SIG_IGN
%18 = call i64 @signal(i32 %16, i32 %17)
%19 = load i64, i64* @SIG_ERR
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %26
21: ; preds = %12
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @_exit(i32 %24)
unreachable
26: ; preds = %12
br label %27
27: ; preds = %26, %27
br label %27
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Error in number of arguments\0A\00"
@EXIT_FAILURE = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str.1 = [30 x i8] c"Error in handling the signal\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
ret i32 %7
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = load i32, i32* @SIG_IGN
%13 = tail call i64 @signal(i32 %11, i32 %12)
%14 = load i64, i64* @SIG_ERR
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %8
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
%20 = tail call i32 @_exit(i32 %19)
unreachable
21: ; preds = %8, %21
br label %21
}