#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*/ kill(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sync();
void performTerminations(void) {
  sync();
  printf("sending termination signals...");
  kill(-1, 15);
  sleep(2);
  printf("done\n");
  printf("sending kill signals...");
  kill(-1, 9);
  sleep(2);
  printf("done\n");
}


x86 assembly (clang, -O0):
<performTerminations>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <sync@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
mov    $0xf,%esi
call   1040 <kill@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
mov    $0x9,%esi
call   1040 <kill@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<performTerminations>:
push   %rbx
xor    %eax,%eax
call   1060 <sync@plt>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
mov    $0xf,%esi
call   1050 <kill@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
mov    $0x9,%esi
call   1050 <kill@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"sending termination signals...\00"
@.str.1 = [6 x i8] c"done\0A\00"
@.str.2 = [24 x i8] c"sending kill signals...\00"
define void @performTerminations() {
%1 = call i32 (...) @sync()
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @kill(i32 -1, i32 15)
%4 = call i32 @sleep(i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @kill(i32 -1, i32 9)
%8 = call i32 @sleep(i32 2)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"sending termination signals...\00"
@.str.2 = [24 x i8] c"sending kill signals...\00"
@str.3 = [5 x i8] c"done\00"
define void @performTerminations() {
%1 = tail call i32 (...) @sync()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @kill(i32 -1, i32 15)
%4 = tail call i32 @sleep(i32 2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @kill(i32 -1, i32 9)
%8 = tail call i32 @sleep(i32 2)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0))
ret void
}