#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 */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void S1(pid_t cpid) {
  fprintf(stdout, "P11\n");
  sleep(1);
  kill(cpid, SIGUSR1);
  fprintf(stdout, "P12\n");
  pause();
  fprintf(stdout, "P13\n");
  return;
}


x86 assembly (clang, -O0):
<S1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x4(%rbp),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <pause@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
lea    0xe63(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S1>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2e8b(%rip),%r14
mov    (%r14),%edi
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <kill@plt>
mov    (%r14),%edi
lea    0xe85(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <pause@plt>
mov    (%r14),%edi
lea    0xe74(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"P11\0A\00"
@SIGUSR1 = global i32 0
@.str.1 = [5 x i8] c"P12\0A\00"
@.str.2 = [5 x i8] c"P13\0A\00"
define void @S1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 1)
%6 = load i32, i32* %2
%7 = load i32, i32* @SIGUSR1
%8 = call i32 @kill(i32 %6, i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (...) @pause()
%12 = load i32, i32* @stdout
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"P11\0A\00"
@SIGUSR1 = global i32 0
@.str.1 = [5 x i8] c"P12\0A\00"
@.str.2 = [5 x i8] c"P13\0A\00"
define void @S1(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 1)
%5 = load i32, i32* @SIGUSR1
%6 = tail call i32 @kill(i32 %0, i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 (...) @pause()
%10 = load i32, i32* @stdout
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}