#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*/ atoi(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int raise(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int res;
  if (argc == 1) {
    printf("Usage: raise SIGNAL_NUMBER\n");
    return 1;
  }
  res = raise(atoi(argv[1]));
  if (res != 0)
    perror("raise");
  else
    printf("I'm alive!\n");
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1178 <main+0x38>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11bc <main+0x7c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1030 <raise@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11aa <main+0x6a>
lea    0xe7c(%rip),%rdi
call   1050 <perror@plt>
jmp    11b6 <main+0x76>
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jne    1159 <main+0x19>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
jmp    117b <main+0x3b>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1030 <raise@plt>
test   %eax,%eax
jne    117f <main+0x3f>
lea    0xe92(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret
mov    %eax,%ebx
lea    0xe78(%rip),%rdi
call   1050 <perror@plt>
jmp    117b <main+0x3b>

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: raise SIGNAL_NUMBER\0A\00"
@.str.1 = [6 x i8] c"raise\00"
@.str.2 = [12 x i8] c"I'm alive!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %25
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
%16 = call i32 @raise(i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %23
21: ; preds = %11
%22 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
%24 = load i32, i32* %6
store i32 %24, i32* %3
br label %25
25: ; preds = %23, %9
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"raise\00"
@str = [11 x i8] c"I'm alive!\00"
@str.3 = [27 x i8] c"Usage: raise SIGNAL_NUMBER\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
br label %16
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @raise(i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %6
%13 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %16
14: ; preds = %6
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %12, %14, %4
%17 = phi i32 [ 1, %4 ], [ 0, %14 ], [ %10, %12 ]
ret i32 %17
}