#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 SIGUSR1;
int SIGUSR2;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void sigusr_function(int signum) {
  assert(signum == SIGUSR1 || signum == SIGUSR2);
  if (signum == SIGUSR1) {
    printf("SIGUSR1\n");
  } else {
    printf("SIGUSR2\n");
  }
}


x86 assembly (clang, -O0):
<sigusr_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2eb1(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1154 <sigusr_function+0x34>
mov    -0x4(%rbp),%eax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%eax
jne    1184 <sigusr_function+0x64>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <sigusr_function+0x70>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigusr_function>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebb(%rip),%r14
cmp    %edi,(%r14)
sete   %al
mov    0x2e9e(%rip),%rcx
cmp    %edi,(%rcx)
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
cmp    %ebx,(%r14)
lea    0xeb5(%rip),%rax
lea    0xea6(%rip),%rdi
cmove  %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@.str = [9 x i8] c"SIGUSR1\0A\00"
@.str.1 = [9 x i8] c"SIGUSR2\0A\00"
define void @sigusr_function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR1
%5 = icmp eq i32 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @SIGUSR2
%9 = icmp eq i32 %7, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* @SIGUSR1
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %21
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@str = [8 x i8] c"SIGUSR2\00"
@str.2 = [8 x i8] c"SIGUSR1\00"
define void @sigusr_function(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @SIGUSR2
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* @SIGUSR1
%10 = icmp eq i32 %9, %0
%11 = select i1 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0)
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
ret void
}