#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ add_channel_pulse(int /*<<< orphan*/, int,
                                     int /*<<< orphan*/, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ shutdown();
int /*<<< orphan*/ usleep(int);
void terminate(void) {
  int esc[] = {24, 23, 4, 27, 25, 22, 17};
  int i;
  for (i = 0; i < 7; i++)
    add_channel_pulse(0, esc[i], 0, 1000);
  usleep(5000000);
  shutdown();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xea9(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    11a7 <terminate+0x67>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
xor    %edx,%edx
mov    $0x3e8,%ecx
mov    %edx,%edi
call   1030 <add_channel_pulse@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1179 <terminate+0x39>
mov    $0x4c4b40,%edi
call   1060 <usleep@plt>
mov    $0x0,%al
call   1040 <shutdown@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rax
xor    %edi,%edi
mov    $0x18,%esi
xor    %edx,%edx
mov    $0x3e8,%ecx
call   1030 <add_channel_pulse@plt>
xor    %edi,%edi
mov    $0x17,%esi
xor    %edx,%edx
mov    $0x3e8,%ecx
call   1030 <add_channel_pulse@plt>
xor    %edi,%edi
mov    $0x4,%esi
xor    %edx,%edx
mov    $0x3e8,%ecx
call   1030 <add_channel_pulse@plt>
xor    %edi,%edi
mov    $0x1b,%esi
xor    %edx,%edx
mov    $0x3e8,%ecx
call   1030 <add_channel_pulse@plt>
xor    %edi,%edi
mov    $0x19,%esi
xor    %edx,%edx
mov    $0x3e8,%ecx
call   1030 <add_channel_pulse@plt>
xor    %edi,%edi
mov    $0x16,%esi
xor    %edx,%edx
mov    $0x3e8,%ecx
call   1030 <add_channel_pulse@plt>
xor    %edi,%edi
mov    $0x11,%esi
xor    %edx,%edx
mov    $0x3e8,%ecx
call   1030 <add_channel_pulse@plt>
mov    $0x4c4b40,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1040 <shutdown@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@__const.terminate.esc = [7 x i32] [i32 24, i32 23, i32 4, i32 27, i32 25, i32 22, i32 17]
@EXIT_SUCCESS = global i32 0
define void @terminate() {
%1 = alloca [7 x i32]
%2 = alloca i32
%3 = bitcast [7 x i32]* %1 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 7
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = call i32 @add_channel_pulse(i32 0, i32 %11, i32 0, i32 1000)
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = call i32 @usleep(i32 5000000)
%18 = call i32 (...) @shutdown()
%19 = load i32, i32* @EXIT_SUCCESS
%20 = call i32 @exit(i32 %19)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @terminate() {
%1 = tail call i32 @add_channel_pulse(i32 0, i32 24, i32 0, i32 1000)
%2 = tail call i32 @add_channel_pulse(i32 0, i32 23, i32 0, i32 1000)
%3 = tail call i32 @add_channel_pulse(i32 0, i32 4, i32 0, i32 1000)
%4 = tail call i32 @add_channel_pulse(i32 0, i32 27, i32 0, i32 1000)
%5 = tail call i32 @add_channel_pulse(i32 0, i32 25, i32 0, i32 1000)
%6 = tail call i32 @add_channel_pulse(i32 0, i32 22, i32 0, i32 1000)
%7 = tail call i32 @add_channel_pulse(i32 0, i32 17, i32 0, i32 1000)
%8 = tail call i32 @usleep(i32 5000000)
%9 = tail call i32 (...) @shutdown()
%10 = load i32, i32* @EXIT_SUCCESS
%11 = tail call i32 @exit(i32 %10)
unreachable
}