#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*/ fflush(int /*<<< orphan*/ *);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
main() {
  char *ssh_connection;
  char *ssh_client;
  char *ssh_tty;
  ssh_connection = getenv("SSH_CONNECTION");
  ssh_client = getenv("SSH_CLIENT");
  ssh_tty = getenv("SSH_TTY");
  printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  if (ssh_connection && ssh_client) {
    printf("Connection: %s\nClient: %s\nTerminal: %s\n\n", ssh_connection,
           ssh_client, ssh_tty);
  }
  while (1) {
    sleep(10);
    printf("*");
    fflush(NULL);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
lea    0xea9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
lea    0xea4(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     11bd <main+0x7d>
cmpq   $0x0,-0x18(%rbp)
je     11bd <main+0x7d>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11c2 <main+0x82>
mov    $0xa,%edi
call   1060 <sleep@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
jmp    11c2 <main+0x82>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xe94(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
lea    0xe94(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r14
lea    0xe90(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r15
lea    0xeb2(%rip),%rdi
call   1050 <puts@plt>
test   %rbx,%rbx
je     11c0 <main+0x60>
test   %r14,%r14
je     11c0 <main+0x60>
lea    0xe73(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
nop
mov    $0xa,%edi
call   1080 <sleep@plt>
mov    $0x2a,%edi
call   1040 <putchar@plt>
xor    %edi,%edi
call   1070 <fflush@plt>
jmp    11c0 <main+0x60>

LLVM IR (-O0):
@.str = [15 x i8] c"SSH_CONNECTION\00"
@.str.1 = [11 x i8] c"SSH_CLIENT\00"
@.str.2 = [8 x i8] c"SSH_TTY\00"
@.str.3 = [21 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
@.str.4 = [41 x i8] c"Connection: %s\0AClient: %s\0ATerminal: %s\0A\0A\00"
@.str.5 = [2 x i8] c"*\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %2
%6 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %3
%7 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i8* %7, i8** %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %19
11: ; preds = %0
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i8*, i8** %2
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i8* %15, i8* %16, i8* %17)
br label %19
19: ; preds = %14, %11, %0
br label %20
20: ; preds = %19, %20
%21 = call i32 @sleep(i32 10)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 @fflush(i32* null)
br label %20
}

LLVM IR (-O2):
@.str = [15 x i8] c"SSH_CONNECTION\00"
@.str.1 = [11 x i8] c"SSH_CLIENT\00"
@.str.2 = [8 x i8] c"SSH_TTY\00"
@.str.4 = [41 x i8] c"Connection: %s\0AClient: %s\0ATerminal: %s\0A\0A\00"
@str = [20 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%5 = icmp ne i8* %1, null
%6 = icmp ne i8* %2, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
br label %10
10: ; preds = %8, %0
br label %11
11: ; preds = %10, %11
%12 = tail call i32 @sleep(i32 10)
%13 = tail call i32 @putchar(i32 42)
%14 = tail call i32 @fflush(i32* null)
br label %11
}