#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 */
struct ttyent {
  char *ty_type;
};

/* Variables and functions */
int /*<<< orphan*/ LOG_AUTH;
int LOG_CONS;
int /*<<< orphan*/ LOG_ERR;
int LOG_ODELAY;
int LOG_PID;
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ _PATH_DEV;
int /*<<< orphan*/ asprintf(char **, char *, char *, ...);
int /*<<< orphan*/ chmod(char *, int);
int /*<<< orphan*/ chown(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ execl(char *, char *, char *, char *, char *, ...);
int /*<<< orphan*/ exit(int);
struct ttyent *getttynam(char *);
int login_tty(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ print_banner(int, char *);
int /*<<< orphan*/ revoke(char *);
int /*<<< orphan*/ set_speed(int, char *);
int /*<<< orphan*/ sleep(int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, ...);
int main(int argc, char **argv) {
  char *linespec, *ttyname;
  int tty;
  struct ttyent *tt;
  char *arg;
  openlog("getty", LOG_ODELAY | LOG_CONS | LOG_PID, LOG_AUTH);
  if (argc != 3) {
    syslog(LOG_ERR, "Bad syntax");
    closelog();
    exit(1);
  }
  linespec = argv[1];
  tt = getttynam(argv[2]);
  asprintf(&ttyname, "%s/%s", _PATH_DEV, argv[2]);
  chown(ttyname, 0, 0);
  chmod(ttyname, 0600);
  revoke(ttyname);
  sleep(2);
  do {
    tty = open(ttyname, O_RDWR);
    if (tty == -1) {
      syslog(LOG_ERR, "%s: %m", ttyname);
      closelog();
      sleep(60);
    }
  } while (tty == -1);
  set_speed(tty, linespec);
  print_banner(tty, ttyname);
  if (login_tty(tty) == -1)
    syslog(LOG_ERR, "cannot set controlling terminal to %s: %m", ttyname);
  asprintf(&arg, "TERM=%s", tt ? tt->ty_type : "unknown");
  if (tt && strcmp(tt->ty_type, "dialup") == 0)
    execl("/bin/login", "login", "-e", arg, NULL);
  else
    execl("/bin/login", "login", "-e", arg, "-aNOAUTH_TIMEOUT", NULL);
  syslog(LOG_ERR, "%s: %m", "/bin/login");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dc3(%rip),%rax
mov    (%rax),%esi
mov    0x2d92(%rip),%rax
or     (%rax),%esi
mov    0x2d91(%rip),%rax
or     (%rax),%esi
mov    0x2d98(%rip),%rax
mov    (%rax),%edx
lea    0xdbf(%rip),%rdi
call   10d0 <openlog@plt>
cmpl   $0x3,-0x8(%rbp)
je     1278 <main+0x78>
mov    0x2d51(%rip),%rax
mov    (%rax),%edi
lea    0xda6(%rip),%rsi
mov    $0x0,%al
call   1070 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <getttynam@plt>
mov    %rax,-0x30(%rbp)
mov    0x2d3c(%rip),%rax
movslq (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    -0x20(%rbp),%rdi
lea    0xd5f(%rip),%rsi
mov    $0x0,%al
call   1090 <asprintf@plt>
mov    -0x20(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1080 <chown@plt>
mov    -0x20(%rbp),%rdi
mov    $0x180,%esi
call   10a0 <chmod@plt>
mov    -0x20(%rbp),%rdi
call   1120 <revoke@plt>
mov    $0x2,%edi
call   1110 <sleep@plt>
mov    -0x20(%rbp),%rdi
mov    0x2cf6(%rip),%rax
mov    (%rax),%esi
call   10b0 <open@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1332 <main+0x132>
mov    0x2c9b(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xd20(%rip),%rsi
mov    $0x0,%al
call   1070 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
mov    $0x3c,%edi
call   1110 <sleep@plt>
jmp    1337 <main+0x137>
cmpl   $0xffffffff,-0x24(%rbp)
je     12e7 <main+0xe7>
mov    -0x24(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   10c0 <set_speed@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   10e0 <print_banner@plt>
mov    -0x24(%rbp),%edi
call   1050 <login_tty@plt>
cmp    $0xffffffff,%eax
jne    1385 <main+0x185>
mov    0x2c37(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xc99(%rip),%rsi
mov    $0x0,%al
call   1070 <syslog@plt>
cmpq   $0x0,-0x30(%rbp)
je     13a0 <main+0x1a0>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    13b0 <main+0x1b0>
lea    0xca2(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    13b0 <main+0x1b0>
mov    -0x40(%rbp),%rdx
lea    -0x38(%rbp),%rdi
lea    0xc82(%rip),%rsi
mov    $0x0,%al
call   1090 <asprintf@plt>
cmpq   $0x0,-0x30(%rbp)
je     1418 <main+0x218>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
lea    0xc72(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1418 <main+0x218>
mov    -0x38(%rbp),%rcx
lea    0xc5f(%rip),%rdi
lea    0xc5d(%rip),%rsi
lea    0xc5c(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1100 <execl@plt>
jmp    1444 <main+0x244>
mov    -0x38(%rbp),%rcx
lea    0xc35(%rip),%rdi
lea    0xc33(%rip),%rsi
lea    0xc32(%rip),%rdx
lea    0xc2e(%rip),%r8
xor    %eax,%eax
mov    %eax,%r9d
mov    $0x0,%al
call   1100 <execl@plt>
mov    0x2b5d(%rip),%rax
mov    (%rax),%edi
lea    0xbe6(%rip),%rsi
lea    0xbfd(%rip),%rdx
mov    $0x0,%al
call   1070 <syslog@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2dc6(%rip),%rax
mov    0x2d97(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2d94(%rip),%rax
or     (%rax),%esi
mov    0x2d9b(%rip),%rax
mov    (%rax),%edx
lea    0xdc2(%rip),%rdi
call   10d0 <openlog@plt>
cmp    $0x3,%ebp
jne    1428 <main+0x228>
mov    0x8(%rbx),%r14
mov    0x10(%rbx),%rdi
call   1040 <getttynam@plt>
mov    %rax,%r15
mov    0x2d75(%rip),%rax
movslq (%rax),%rdx
mov    0x10(%rbx),%rcx
lea    0xda0(%rip),%rsi
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1090 <asprintf@plt>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <chown@plt>
mov    0x8(%rsp),%rdi
mov    $0x180,%esi
call   10a0 <chmod@plt>
mov    0x8(%rsp),%rdi
call   1120 <revoke@plt>
mov    $0x2,%edi
call   1110 <sleep@plt>
mov    0x8(%rsp),%rdi
mov    0x2d2e(%rip),%r12
mov    (%r12),%esi
call   10b0 <open@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1319 <main+0x119>
mov    0x2cd7(%rip),%r13
lea    0xd62(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13),%edi
mov    0x8(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
mov    $0x3c,%edi
call   1110 <sleep@plt>
mov    0x8(%rsp),%rdi
mov    (%r12),%esi
call   10b0 <open@plt>
cmp    $0xffffffff,%eax
je     12e0 <main+0xe0>
mov    %eax,%ebp
mov    %ebp,%edi
mov    %r14,%rsi
call   10c0 <set_speed@plt>
mov    0x8(%rsp),%rsi
mov    %ebp,%edi
call   10e0 <print_banner@plt>
mov    %ebp,%edi
call   1050 <login_tty@plt>
cmp    $0xffffffff,%eax
je     1390 <main+0x190>
test   %r15,%r15
je     13b1 <main+0x1b1>
mov    (%r15),%rdx
lea    0xcf7(%rip),%rsi
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1090 <asprintf@plt>
mov    (%r15),%rdi
lea    0xcf1(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    13cb <main+0x1cb>
mov    0x10(%rsp),%rcx
lea    0xce2(%rip),%rdi
lea    0xce0(%rip),%rsi
lea    0xcdf(%rip),%rdx
xor    %r8d,%r8d
xor    %eax,%eax
call   1100 <execl@plt>
jmp    13f6 <main+0x1f6>
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsp),%rdx
lea    0xc72(%rip),%rsi
xor    %eax,%eax
call   1070 <syslog@plt>
test   %r15,%r15
jne    1340 <main+0x140>
lea    0xc89(%rip),%rsi
lea    0xc8a(%rip),%rdx
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1090 <asprintf@plt>
mov    0x10(%rsp),%rcx
lea    0xc81(%rip),%rdi
lea    0xc7f(%rip),%rsi
lea    0xc7e(%rip),%rdx
lea    0xc7a(%rip),%r8
xor    %r9d,%r9d
xor    %eax,%eax
call   1100 <execl@plt>
mov    0x2bab(%rip),%rax
mov    (%rax),%edi
lea    0xc34(%rip),%rsi
lea    0xc4b(%rip),%rdx
xor    %eax,%eax
call   1070 <syslog@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b79(%rip),%rax
mov    (%rax),%edi
lea    0xbce(%rip),%rsi
xor    %eax,%eax
call   1070 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.ttyent = type { i8* }
@.str = [6 x i8] c"getty\00"
@LOG_ODELAY = global i32 0
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_AUTH = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [11 x i8] c"Bad syntax\00"
@.str.2 = [6 x i8] c"%s/%s\00"
@_PATH_DEV = global i32 0
@O_RDWR = global i32 0
@.str.3 = [7 x i8] c"%s: %m\00"
@.str.4 = [42 x i8] c"cannot set controlling terminal to %s: %m\00"
@.str.5 = [8 x i8] c"TERM=%s\00"
@.str.6 = [8 x i8] c"unknown\00"
@.str.7 = [7 x i8] c"dialup\00"
@.str.8 = [11 x i8] c"/bin/login\00"
@.str.9 = [6 x i8] c"login\00"
@.str.10 = [3 x i8] c"-e\00"
@.str.11 = [17 x i8] c"-aNOAUTH_TIMEOUT\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca %struct.ttyent*
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* @LOG_ODELAY
%12 = load i32, i32* @LOG_CONS
%13 = or i32 %11, %12
%14 = load i32, i32* @LOG_PID
%15 = or i32 %13, %14
%16 = load i32, i32* @LOG_AUTH
%17 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 3
br i1 %19, label %20, label %25
20: ; preds = %2
%21 = load i32, i32* @LOG_ERR
%22 = call i32 (i32, i8*, ...) @syslog(i32 %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 (...) @closelog()
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
store i8* %28, i8** %6
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call %struct.ttyent* @getttynam(i8* %31)
store %struct.ttyent* %32, %struct.ttyent** %9
%33 = load i32, i32* @_PATH_DEV
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i8*
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %35, i8* %38)
%40 = load i8*, i8** %7
%41 = call i32 @chown(i8* %40, i32 0, i32 0)
%42 = load i8*, i8** %7
%43 = call i32 @chmod(i8* %42, i32 384)
%44 = load i8*, i8** %7
%45 = call i32 @revoke(i8* %44)
%46 = call i32 @sleep(i32 2)
br label %47
47: ; preds = %60, %25
%48 = load i8*, i8** %7
%49 = load i32, i32* @O_RDWR
%50 = call i32 @open(i8* %48, i32 %49)
store i32 %50, i32* %8
%51 = load i32, i32* %8
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %59
53: ; preds = %47
%54 = load i32, i32* @LOG_ERR
%55 = load i8*, i8** %7
%56 = call i32 (i32, i8*, ...) @syslog(i32 %54, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %55)
%57 = call i32 (...) @closelog()
%58 = call i32 @sleep(i32 60)
br label %59
59: ; preds = %53, %47
br label %60
60: ; preds = %59
%61 = load i32, i32* %8
%62 = icmp eq i32 %61, -1
br i1 %62, label %47, label %63
63: ; preds = %60
%64 = load i32, i32* %8
%65 = load i8*, i8** %6
%66 = call i32 @set_speed(i32 %64, i8* %65)
%67 = load i32, i32* %8
%68 = load i8*, i8** %7
%69 = call i32 @print_banner(i32 %67, i8* %68)
%70 = load i32, i32* %8
%71 = call i32 @login_tty(i32 %70)
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %77
73: ; preds = %63
%74 = load i32, i32* @LOG_ERR
%75 = load i8*, i8** %7
%76 = call i32 (i32, i8*, ...) @syslog(i32 %74, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i8* %75)
br label %77
77: ; preds = %73, %63
%78 = load %struct.ttyent*, %struct.ttyent** %9
%79 = icmp ne %struct.ttyent* %78, null
br i1 %79, label %80, label %84
80: ; preds = %77
%81 = load %struct.ttyent*, %struct.ttyent** %9
%82 = getelementptr inbounds %struct.ttyent, %struct.ttyent* %81, i32 0, i32 0
%83 = load i8*, i8** %82
br label %85
84: ; preds = %77
br label %85
85: ; preds = %84, %80
%86 = phi i8* [ %83, %80 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), %84 ]
%87 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %86)
%88 = load %struct.ttyent*, %struct.ttyent** %9
%89 = icmp ne %struct.ttyent* %88, null
br i1 %89, label %90, label %99
90: ; preds = %85
%91 = load %struct.ttyent*, %struct.ttyent** %9
%92 = getelementptr inbounds %struct.ttyent, %struct.ttyent* %91, i32 0, i32 0
%93 = load i8*, i8** %92
%94 = call i64 @strcmp(i8* %93, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %90
%97 = load i8*, i8** %10
%98 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %97, i8* null)
br label %102
99: ; preds = %90, %85
%100 = load i8*, i8** %10
%101 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %100, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i8* null)
br label %102
102: ; preds = %99, %96
%103 = load i32, i32* @LOG_ERR
%104 = call i32 (i32, i8*, ...) @syslog(i32 %103, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.ttyent = type { i8* }
@.str = [6 x i8] c"getty\00"
@LOG_ODELAY = global i32 0
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_AUTH = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [11 x i8] c"Bad syntax\00"
@.str.2 = [6 x i8] c"%s/%s\00"
@_PATH_DEV = global i32 0
@O_RDWR = global i32 0
@.str.3 = [7 x i8] c"%s: %m\00"
@.str.4 = [42 x i8] c"cannot set controlling terminal to %s: %m\00"
@.str.5 = [8 x i8] c"TERM=%s\00"
@.str.6 = [8 x i8] c"unknown\00"
@.str.7 = [7 x i8] c"dialup\00"
@.str.8 = [11 x i8] c"/bin/login\00"
@.str.9 = [6 x i8] c"login\00"
@.str.10 = [3 x i8] c"-e\00"
@.str.11 = [17 x i8] c"-aNOAUTH_TIMEOUT\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = load i32, i32* @LOG_ODELAY
%8 = load i32, i32* @LOG_CONS
%9 = or i32 %8, %7
%10 = load i32, i32* @LOG_PID
%11 = or i32 %9, %10
%12 = load i32, i32* @LOG_AUTH
%13 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = icmp eq i32 %0, 3
br i1 %14, label %20, label %15
15: ; preds = %2
%16 = load i32, i32* @LOG_ERR
%17 = tail call i32 (i32, i8*, ...) @syslog(i32 %16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%18 = tail call i32 (...) @closelog()
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = getelementptr inbounds i8*, i8** %1, i64 1
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = tail call %struct.ttyent* @getttynam(i8* %24)
%26 = load i32, i32* @_PATH_DEV
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i8*
%29 = load i8*, i8** %23
%30 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %28, i8* %29)
%31 = load i8*, i8** %3
%32 = call i32 @chown(i8* %31, i32 0, i32 0)
%33 = load i8*, i8** %3
%34 = call i32 @chmod(i8* %33, i32 384)
%35 = load i8*, i8** %3
%36 = call i32 @revoke(i8* %35)
%37 = call i32 @sleep(i32 2)
%38 = load i8*, i8** %3
%39 = load i32, i32* @O_RDWR
%40 = call i32 @open(i8* %38, i32 %39)
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %52
42: ; preds = %20, %42
%43 = load i32, i32* @LOG_ERR
%44 = load i8*, i8** %3
%45 = call i32 (i32, i8*, ...) @syslog(i32 %43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %44)
%46 = call i32 (...) @closelog()
%47 = call i32 @sleep(i32 60)
%48 = load i8*, i8** %3
%49 = load i32, i32* @O_RDWR
%50 = call i32 @open(i8* %48, i32 %49)
%51 = icmp eq i32 %50, -1
br i1 %51, label %42, label %52
52: ; preds = %42, %20
%53 = phi i32 [ %40, %20 ], [ %50, %42 ]
%54 = call i32 @set_speed(i32 %53, i8* %22)
%55 = load i8*, i8** %3
%56 = call i32 @print_banner(i32 %53, i8* %55)
%57 = call i32 @login_tty(i32 %53)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %63
59: ; preds = %52
%60 = load i32, i32* @LOG_ERR
%61 = load i8*, i8** %3
%62 = call i32 (i32, i8*, ...) @syslog(i32 %60, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i8* %61)
br label %63
63: ; preds = %59, %52
%64 = icmp eq %struct.ttyent* %25, null
br i1 %64, label %75, label %65
65: ; preds = %63
%66 = getelementptr inbounds %struct.ttyent, %struct.ttyent* %25, i64 0, i32 0
%67 = load i8*, i8** %66
%68 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %67)
%69 = load i8*, i8** %66
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %77
72: ; preds = %65
%73 = load i8*, i8** %4
%74 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %73, i8* null)
br label %80
75: ; preds = %63
%76 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %77
77: ; preds = %75, %65
%78 = load i8*, i8** %4
%79 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %78, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i8* null)
br label %80
80: ; preds = %77, %72
%81 = load i32, i32* @LOG_ERR
%82 = call i32 (i32, i8*, ...) @syslog(i32 %81, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
ret i32 1
}