#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 Connection {
  int dummy;
};
struct Address {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Address_print(struct Address *);
int /*<<< orphan*/ Database_close(struct Connection *);
int /*<<< orphan*/ Database_create(struct Connection *);
int /*<<< orphan*/ Database_delete(struct Connection *, int);
struct Address *Database_find(struct Connection *, char const *);
int /*<<< orphan*/ Database_get(struct Connection *, int);
int /*<<< orphan*/ Database_list(struct Connection *);
struct Connection *Database_open(char const *, char const);
int /*<<< orphan*/ Database_set(struct Connection *, int, char const *,
                                char const *);
int /*<<< orphan*/ Database_write(struct Connection *);
int atoi(char const *);
int /*<<< orphan*/ die(char *, struct Connection *);
int /*<<< orphan*/ printf(char *, char const *);
int main(int argc, const char *argv[]) {
  if (argc < 3)
    die("USAGE: ex17_heap_and_stack <dbfile> <action> [action params]", NULL);
  int id = 0;
  const char *name;
  const char *filename = argv[1];
  const char action = argv[2][0];
  if (argc > 3) {
    if (action != 'f')
      id = atoi(argv[3]);
    else
      name = argv[3];
  }
  if (id >= 100)
    die("There are not that many records", NULL);
  struct Connection *conn = Database_open(filename, action);
  switch (action) {
  case 'c':
    Database_create(conn);
    Database_write(conn);
    break;
  case 's':
    if (argc != 6)
      die("Need id, name, email to set a record", conn);
    Database_set(conn, id, argv[4], argv[5]);
    Database_write(conn);
    break;
  case 'g':
    if (argc != 4)
      die("Need an id to get a record", conn);
    Database_get(conn, id);
    break;
  case 'l':
    Database_list(conn);
    break;
  case 'd':
    if (argc != 4)
      die("Need id to delete a record", conn);
    Database_delete(conn, id);
    Database_write(conn);
    break;
  case 'f':
    if (argc != 4)
      die("Need name to find", conn);
    struct Address *addr = Database_find(conn, name);
    if (addr) {
      Address_print(addr);
    } else {
      printf("Unable to find address with name %s\n", name);
    }
    break;
  default:
    die("Invalid action, only: c=create, g=get, s=set, d=del, l=list", conn);
  }
  Database_close(conn);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1200 <main+0x30>
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10b0 <die@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    125d <main+0x8d>
movsbl -0x29(%rbp),%eax
cmp    $0x66,%eax
je     124c <main+0x7c>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1258 <main+0x88>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    125d <main+0x8d>
cmpl   $0x64,-0x14(%rbp)
jl     1277 <main+0xa7>
lea    0xe13(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10b0 <die@plt>
mov    -0x28(%rbp),%rdi
movsbl -0x29(%rbp),%esi
call   10e0 <Database_open@plt>
mov    %rax,-0x38(%rbp)
movsbl -0x29(%rbp),%eax
add    $0xffffff9d,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x10,%eax
ja     13d3 <main+0x203>
mov    -0x48(%rbp),%rax
lea    0xd57(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x38(%rbp),%rdi
call   1080 <Database_create@plt>
mov    -0x38(%rbp),%rdi
call   1030 <Database_write@plt>
jmp    13e3 <main+0x213>
cmpl   $0x6,-0x8(%rbp)
je     12e3 <main+0x113>
mov    -0x38(%rbp),%rsi
lea    0xdc3(%rip),%rdi
call   10b0 <die@plt>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rcx
call   10a0 <Database_set@plt>
mov    -0x38(%rbp),%rdi
call   1030 <Database_write@plt>
jmp    13e3 <main+0x213>
cmpl   $0x4,-0x8(%rbp)
je     1327 <main+0x157>
mov    -0x38(%rbp),%rsi
lea    0xda4(%rip),%rdi
call   10b0 <die@plt>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   10d0 <Database_get@plt>
jmp    13e3 <main+0x213>
mov    -0x38(%rbp),%rdi
call   1050 <Database_list@plt>
jmp    13e3 <main+0x213>
cmpl   $0x4,-0x8(%rbp)
je     1360 <main+0x190>
mov    -0x38(%rbp),%rsi
lea    0xd86(%rip),%rdi
call   10b0 <die@plt>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1090 <Database_delete@plt>
mov    -0x38(%rbp),%rdi
call   1030 <Database_write@plt>
jmp    13e3 <main+0x213>
cmpl   $0x4,-0x8(%rbp)
je     1394 <main+0x1c4>
mov    -0x38(%rbp),%rsi
lea    0xd6d(%rip),%rdi
call   10b0 <die@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <Database_find@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     13be <main+0x1ee>
mov    -0x40(%rbp),%rdi
call   1040 <Address_print@plt>
jmp    13ce <main+0x1fe>
mov    -0x20(%rbp),%rsi
lea    0xd45(%rip),%rdi
call   1060 <printf@plt>
jmp    13e3 <main+0x213>
mov    -0x38(%rbp),%rsi
lea    0xd55(%rip),%rdi
call   10b0 <die@plt>
mov    -0x38(%rbp),%rdi
call   10f0 <Database_close@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %edi,%r12d
cmp    $0x2,%edi
jg     1203 <main+0x33>
lea    0xe57(%rip),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
call   10b0 <die@plt>
mov    0x8(%r13),%r15
mov    0x10(%r13),%rax
mov    (%rax),%bl
jmp    124f <main+0x7f>
mov    0x8(%r13),%r15
mov    0x10(%r13),%rax
mov    (%rax),%bl
xor    %r14d,%r14d
cmp    $0x3,%r12d
je     124f <main+0x7f>
mov    0x18(%r13),%rbp
cmp    $0x66,%bl
jne    1231 <main+0x61>
mov    %r15,%rdi
mov    $0x66,%esi
call   10e0 <Database_open@plt>
mov    %rax,%r15
jmp    1284 <main+0xb4>
mov    %rbp,%rdi
call   10c0 <atoi@plt>
mov    %eax,%r14d
cmp    $0x64,%eax
jl     124f <main+0x7f>
lea    0xe39(%rip),%rdi
xor    %esi,%esi
call   10b0 <die@plt>
movsbl %bl,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
call   10e0 <Database_open@plt>
mov    %rax,%r15
add    $0xffffff9d,%ebp
cmp    $0x10,%ebp
ja     12dc <main+0x10c>
lea    0xd92(%rip),%rax
movslq (%rax,%rbp,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    %r15,%rdi
call   1080 <Database_create@plt>
jmp    1337 <main+0x167>
cmp    $0x4,%r12d
je     1299 <main+0xc9>
lea    0xe6b(%rip),%rdi
mov    %r15,%rsi
call   10b0 <die@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1070 <Database_find@plt>
test   %rax,%rax
je     134b <main+0x17b>
mov    %rax,%rdi
call   1040 <Address_print@plt>
jmp    135a <main+0x18a>
cmp    $0x4,%r12d
je     12cf <main+0xff>
lea    0xe1a(%rip),%rdi
mov    %r15,%rsi
call   10b0 <die@plt>
mov    %r15,%rdi
mov    %r14d,%esi
call   1090 <Database_delete@plt>
jmp    1337 <main+0x167>
lea    0xe50(%rip),%rdi
mov    %r15,%rsi
call   10b0 <die@plt>
jmp    135a <main+0x18a>
cmp    $0x4,%r12d
je     1302 <main+0x132>
lea    0xdcc(%rip),%rdi
mov    %r15,%rsi
call   10b0 <die@plt>
mov    %r15,%rdi
mov    %r14d,%esi
call   10d0 <Database_get@plt>
jmp    135a <main+0x18a>
cmp    $0x6,%r12d
je     1324 <main+0x154>
lea    0xd85(%rip),%rdi
mov    %r15,%rsi
call   10b0 <die@plt>
mov    0x20(%r13),%rdx
mov    0x28(%r13),%rcx
mov    %r15,%rdi
mov    %r14d,%esi
call   10a0 <Database_set@plt>
mov    %r15,%rdi
call   1030 <Database_write@plt>
jmp    135a <main+0x18a>
mov    %r15,%rdi
call   1050 <Database_list@plt>
jmp    135a <main+0x18a>
lea    0xdbc(%rip),%rdi
mov    %rbp,%rsi
call   1060 <printf@plt>
mov    %r15,%rdi
call   10f0 <Database_close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.Connection = type { i32 }
%struct.Address = type { i32 }
@.str = [61 x i8] c"USAGE: ex17_heap_and_stack <dbfile> <action> [action params]\00"
@.str.1 = [32 x i8] c"There are not that many records\00"
@.str.2 = [37 x i8] c"Need id, name, email to set a record\00"
@.str.3 = [27 x i8] c"Need an id to get a record\00"
@.str.4 = [27 x i8] c"Need id to delete a record\00"
@.str.5 = [18 x i8] c"Need name to find\00"
@.str.6 = [37 x i8] c"Unable to find address with name %s\0A\00"
@.str.7 = [60 x i8] c"Invalid action, only: c=create, g=get, s=set, d=del, l=list\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
%10 = alloca %struct.Connection*
%11 = alloca %struct.Address*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @die(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), %struct.Connection* null)
br label %16
16: ; preds = %14, %2
store i32 0, i32* %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
store i8* %19, i8** %8
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
store i8 %24, i8* %9
%25 = load i32, i32* %4
%26 = icmp sgt i32 %25, 3
br i1 %26, label %27, label %41
27: ; preds = %16
%28 = load i8, i8* %9
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 102
br i1 %30, label %31, label %36
31: ; preds = %27
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 3
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %6
br label %40
36: ; preds = %27
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 3
%39 = load i8*, i8** %38
store i8* %39, i8** %7
br label %40
40: ; preds = %36, %31
br label %41
41: ; preds = %40, %16
%42 = load i32, i32* %6
%43 = icmp sge i32 %42, 100
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 @die(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), %struct.Connection* null)
br label %46
46: ; preds = %44, %41
%47 = load i8*, i8** %8
%48 = load i8, i8* %9
%49 = call %struct.Connection* @Database_open(i8* %47, i8 signext %48)
store %struct.Connection* %49, %struct.Connection** %10
%50 = load i8, i8* %9
%51 = sext i8 %50 to i32
switch i32 %51, label %119 [
i32 99, label %52
i32 115, label %57
i32 103, label %75
i32 108, label %85
i32 100, label %88
i32 102, label %100
]
52: ; preds = %46
%53 = load %struct.Connection*, %struct.Connection** %10
%54 = call i32 @Database_create(%struct.Connection* %53)
%55 = load %struct.Connection*, %struct.Connection** %10
%56 = call i32 @Database_write(%struct.Connection* %55)
br label %122
57: ; preds = %46
%58 = load i32, i32* %4
%59 = icmp ne i32 %58, 6
br i1 %59, label %60, label %63
60: ; preds = %57
%61 = load %struct.Connection*, %struct.Connection** %10
%62 = call i32 @die(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), %struct.Connection* %61)
br label %63
63: ; preds = %60, %57
%64 = load %struct.Connection*, %struct.Connection** %10
%65 = load i32, i32* %6
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 4
%68 = load i8*, i8** %67
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 5
%71 = load i8*, i8** %70
%72 = call i32 @Database_set(%struct.Connection* %64, i32 %65, i8* %68, i8* %71)
%73 = load %struct.Connection*, %struct.Connection** %10
%74 = call i32 @Database_write(%struct.Connection* %73)
br label %122
75: ; preds = %46
%76 = load i32, i32* %4
%77 = icmp ne i32 %76, 4
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = load %struct.Connection*, %struct.Connection** %10
%80 = call i32 @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), %struct.Connection* %79)
br label %81
81: ; preds = %78, %75
%82 = load %struct.Connection*, %struct.Connection** %10
%83 = load i32, i32* %6
%84 = call i32 @Database_get(%struct.Connection* %82, i32 %83)
br label %122
85: ; preds = %46
%86 = load %struct.Connection*, %struct.Connection** %10
%87 = call i32 @Database_list(%struct.Connection* %86)
br label %122
88: ; preds = %46
%89 = load i32, i32* %4
%90 = icmp ne i32 %89, 4
br i1 %90, label %91, label %94
91: ; preds = %88
%92 = load %struct.Connection*, %struct.Connection** %10
%93 = call i32 @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), %struct.Connection* %92)
br label %94
94: ; preds = %91, %88
%95 = load %struct.Connection*, %struct.Connection** %10
%96 = load i32, i32* %6
%97 = call i32 @Database_delete(%struct.Connection* %95, i32 %96)
%98 = load %struct.Connection*, %struct.Connection** %10
%99 = call i32 @Database_write(%struct.Connection* %98)
br label %122
100: ; preds = %46
%101 = load i32, i32* %4
%102 = icmp ne i32 %101, 4
br i1 %102, label %103, label %106
103: ; preds = %100
%104 = load %struct.Connection*, %struct.Connection** %10
%105 = call i32 @die(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), %struct.Connection* %104)
br label %106
106: ; preds = %103, %100
%107 = load %struct.Connection*, %struct.Connection** %10
%108 = load i8*, i8** %7
%109 = call %struct.Address* @Database_find(%struct.Connection* %107, i8* %108)
store %struct.Address* %109, %struct.Address** %11
%110 = load %struct.Address*, %struct.Address** %11
%111 = icmp ne %struct.Address* %110, null
br i1 %111, label %112, label %115
112: ; preds = %106
%113 = load %struct.Address*, %struct.Address** %11
%114 = call i32 @Address_print(%struct.Address* %113)
br label %118
115: ; preds = %106
%116 = load i8*, i8** %7
%117 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* %116)
br label %118
118: ; preds = %115, %112
br label %122
119: ; preds = %46
%120 = load %struct.Connection*, %struct.Connection** %10
%121 = call i32 @die(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0), %struct.Connection* %120)
br label %122
122: ; preds = %119, %118, %94, %85, %81, %63, %52
%123 = load %struct.Connection*, %struct.Connection** %10
%124 = call i32 @Database_close(%struct.Connection* %123)
ret i32 0
}

LLVM IR (-O2):
%struct.Connection = type { i32 }
%struct.Address = type { i32 }
@.str = [61 x i8] c"USAGE: ex17_heap_and_stack <dbfile> <action> [action params]\00"
@.str.1 = [32 x i8] c"There are not that many records\00"
@.str.2 = [37 x i8] c"Need id, name, email to set a record\00"
@.str.3 = [27 x i8] c"Need an id to get a record\00"
@.str.4 = [27 x i8] c"Need id to delete a record\00"
@.str.5 = [18 x i8] c"Need name to find\00"
@.str.6 = [37 x i8] c"Unable to find address with name %s\0A\00"
@.str.7 = [60 x i8] c"Invalid action, only: c=create, g=get, s=set, d=del, l=list\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = tail call i32 @die(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), %struct.Connection* null)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
br label %29
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = icmp eq i32 %0, 3
br i1 %17, label %29, label %18
18: ; preds = %11
%19 = icmp eq i8 %16, 102
%20 = getelementptr inbounds i8*, i8** %1, i64 3
%21 = load i8*, i8** %20
br i1 %19, label %22, label %24
22: ; preds = %18
%23 = tail call %struct.Connection* @Database_open(i8* %13, i8 signext 102)
br label %64
24: ; preds = %18
%25 = tail call i32 @atoi(i8* %21)
%26 = icmp sgt i32 %25, 99
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = tail call i32 @die(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), %struct.Connection* null)
br label %29
29: ; preds = %4, %11, %27, %24
%30 = phi i32 [ %25, %27 ], [ %25, %24 ], [ 0, %11 ], [ 0, %4 ]
%31 = phi i8* [ %13, %27 ], [ %13, %24 ], [ %13, %11 ], [ %7, %4 ]
%32 = phi i8 [ %16, %27 ], [ %16, %24 ], [ %16, %11 ], [ %10, %4 ]
%33 = tail call %struct.Connection* @Database_open(i8* %31, i8 signext %32)
%34 = sext i8 %32 to i32
switch i32 %34, label %77 [
i32 99, label %35
i32 115, label %38
i32 103, label %49
i32 108, label %55
i32 100, label %57
i32 102, label %64
]
35: ; preds = %29
%36 = tail call i32 @Database_create(%struct.Connection* %33)
%37 = tail call i32 @Database_write(%struct.Connection* %33)
br label %79
38: ; preds = %29
%39 = icmp eq i32 %0, 6
br i1 %39, label %42, label %40
40: ; preds = %38
%41 = tail call i32 @die(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), %struct.Connection* %33)
br label %42
42: ; preds = %40, %38
%43 = getelementptr inbounds i8*, i8** %1, i64 4
%44 = load i8*, i8** %43
%45 = getelementptr inbounds i8*, i8** %1, i64 5
%46 = load i8*, i8** %45
%47 = tail call i32 @Database_set(%struct.Connection* %33, i32 %30, i8* %44, i8* %46)
%48 = tail call i32 @Database_write(%struct.Connection* %33)
br label %79
49: ; preds = %29
%50 = icmp eq i32 %0, 4
br i1 %50, label %53, label %51
51: ; preds = %49
%52 = tail call i32 @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), %struct.Connection* %33)
br label %53
53: ; preds = %51, %49
%54 = tail call i32 @Database_get(%struct.Connection* %33, i32 %30)
br label %79
55: ; preds = %29
%56 = tail call i32 @Database_list(%struct.Connection* %33)
br label %79
57: ; preds = %29
%58 = icmp eq i32 %0, 4
br i1 %58, label %61, label %59
59: ; preds = %57
%60 = tail call i32 @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), %struct.Connection* %33)
br label %61
61: ; preds = %59, %57
%62 = tail call i32 @Database_delete(%struct.Connection* %33, i32 %30)
%63 = tail call i32 @Database_write(%struct.Connection* %33)
br label %79
64: ; preds = %22, %29
%65 = phi %struct.Connection* [ %23, %22 ], [ %33, %29 ]
%66 = phi i8* [ %21, %22 ], [ undef, %29 ]
%67 = icmp eq i32 %0, 4
br i1 %67, label %70, label %68
68: ; preds = %64
%69 = tail call i32 @die(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), %struct.Connection* %65)
br label %70
70: ; preds = %68, %64
%71 = tail call %struct.Address* @Database_find(%struct.Connection* %65, i8* %66)
%72 = icmp eq %struct.Address* %71, null
br i1 %72, label %75, label %73
73: ; preds = %70
%74 = tail call i32 @Address_print(%struct.Address* %71)
br label %79
75: ; preds = %70
%76 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* %66)
br label %79
77: ; preds = %29
%78 = tail call i32 @die(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0), %struct.Connection* %33)
br label %79
79: ; preds = %73, %75, %77, %61, %55, %53, %42, %35
%80 = phi %struct.Connection* [ %65, %73 ], [ %65, %75 ], [ %33, %77 ], [ %33, %61 ], [ %33, %55 ], [ %33, %53 ], [ %33, %42 ], [ %33, %35 ]
%81 = tail call i32 @Database_close(%struct.Connection* %80)
ret i32 0
}