#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 rfc822t {
  int dummy;
};
struct rfc822a {
  int dummy;
};

/* Variables and functions */
struct rfc822a *doaddr(struct rfc822t *);
int /*<<< orphan*/ rfc822a_free(struct rfc822a *);
int /*<<< orphan*/ rfc822t_free(struct rfc822t *);
struct rfc822t *tokenize(char *);
int main() {
  struct rfc822t *t1, *t2, *t3, *t4;
  struct rfc822a *a1, *a2, *a3, *a4;
  t1 = tokenize("nobody@example.com (Nobody (is) here\\) right)");
  t2 = tokenize("Distribution  list: nobody@example.com daemon@example.com");
  t3 = tokenize(
      "Mr Nobody <nobody@example.com>, Mr. Nobody <nobody@example.com>");
  t4 = tokenize("nobody@example.com, <nobody@example.com>, Mr. Nobody "
                "<nobody@example.com>");
  a1 = doaddr(t1);
  a2 = doaddr(t2);
  a3 = doaddr(t3);
  a4 = doaddr(t4);
  rfc822a_free(a4);
  rfc822a_free(a3);
  rfc822a_free(a2);
  rfc822a_free(a1);
  rfc822t_free(t4);
  rfc822t_free(t3);
  rfc822t_free(t2);
  rfc822t_free(t1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1060 <tokenize@plt>
mov    %rax,-0x10(%rbp)
lea    0xec8(%rip),%rdi
call   1060 <tokenize@plt>
mov    %rax,-0x18(%rbp)
lea    0xef2(%rip),%rdi
call   1060 <tokenize@plt>
mov    %rax,-0x20(%rbp)
lea    0xf22(%rip),%rdi
call   1060 <tokenize@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <doaddr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <doaddr@plt>
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <doaddr@plt>
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <doaddr@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
call   1040 <rfc822a_free@plt>
mov    -0x40(%rbp),%rdi
call   1040 <rfc822a_free@plt>
mov    -0x38(%rbp),%rdi
call   1040 <rfc822a_free@plt>
mov    -0x30(%rbp),%rdi
call   1040 <rfc822a_free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <rfc822t_free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <rfc822t_free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <rfc822t_free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <rfc822t_free@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
lea    0xeae(%rip),%rdi
call   1060 <tokenize@plt>
mov    %rax,%rbp
mov    %rax,(%rsp)
lea    0xec9(%rip),%rdi
call   1060 <tokenize@plt>
mov    %rax,%r15
lea    0xef4(%rip),%rdi
call   1060 <tokenize@plt>
mov    %rax,%r12
lea    0xf25(%rip),%rdi
call   1060 <tokenize@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1050 <doaddr@plt>
mov    %rax,%r13
mov    %r15,%rdi
call   1050 <doaddr@plt>
mov    %rax,%rbp
mov    %r12,%rdi
call   1050 <doaddr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <doaddr@plt>
mov    %rax,%rdi
call   1040 <rfc822a_free@plt>
mov    %r14,%rdi
call   1040 <rfc822a_free@plt>
mov    %rbp,%rdi
call   1040 <rfc822a_free@plt>
mov    %r13,%rdi
call   1040 <rfc822a_free@plt>
mov    %rbx,%rdi
call   1030 <rfc822t_free@plt>
mov    %r12,%rdi
call   1030 <rfc822t_free@plt>
mov    %r15,%rdi
call   1030 <rfc822t_free@plt>
mov    (%rsp),%rdi
call   1030 <rfc822t_free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.rfc822t = type { i32 }
%struct.rfc822a = type { i32 }
@.str = [46 x i8] c"nobody@example.com (Nobody (is) here\\) right)\00"
@.str.1 = [58 x i8] c"Distribution list: nobody@example.com daemon@example.com\00"
@.str.2 = [64 x i8] c"Mr Nobody <nobody@example.com>, Mr. Nobody <nobody@example.com>\00"
@.str.3 = [74 x i8] c"nobody@example.com, <nobody@example.com>, Mr. Nobody <nobody@example.com>\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rfc822t*
%3 = alloca %struct.rfc822t*
%4 = alloca %struct.rfc822t*
%5 = alloca %struct.rfc822t*
%6 = alloca %struct.rfc822a*
%7 = alloca %struct.rfc822a*
%8 = alloca %struct.rfc822a*
%9 = alloca %struct.rfc822a*
store i32 0, i32* %1
%10 = call %struct.rfc822t* @tokenize(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
store %struct.rfc822t* %10, %struct.rfc822t** %2
%11 = call %struct.rfc822t* @tokenize(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
store %struct.rfc822t* %11, %struct.rfc822t** %3
%12 = call %struct.rfc822t* @tokenize(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
store %struct.rfc822t* %12, %struct.rfc822t** %4
%13 = call %struct.rfc822t* @tokenize(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.3, i64 0, i64 0))
store %struct.rfc822t* %13, %struct.rfc822t** %5
%14 = load %struct.rfc822t*, %struct.rfc822t** %2
%15 = call %struct.rfc822a* @doaddr(%struct.rfc822t* %14)
store %struct.rfc822a* %15, %struct.rfc822a** %6
%16 = load %struct.rfc822t*, %struct.rfc822t** %3
%17 = call %struct.rfc822a* @doaddr(%struct.rfc822t* %16)
store %struct.rfc822a* %17, %struct.rfc822a** %7
%18 = load %struct.rfc822t*, %struct.rfc822t** %4
%19 = call %struct.rfc822a* @doaddr(%struct.rfc822t* %18)
store %struct.rfc822a* %19, %struct.rfc822a** %8
%20 = load %struct.rfc822t*, %struct.rfc822t** %5
%21 = call %struct.rfc822a* @doaddr(%struct.rfc822t* %20)
store %struct.rfc822a* %21, %struct.rfc822a** %9
%22 = load %struct.rfc822a*, %struct.rfc822a** %9
%23 = call i32 @rfc822a_free(%struct.rfc822a* %22)
%24 = load %struct.rfc822a*, %struct.rfc822a** %8
%25 = call i32 @rfc822a_free(%struct.rfc822a* %24)
%26 = load %struct.rfc822a*, %struct.rfc822a** %7
%27 = call i32 @rfc822a_free(%struct.rfc822a* %26)
%28 = load %struct.rfc822a*, %struct.rfc822a** %6
%29 = call i32 @rfc822a_free(%struct.rfc822a* %28)
%30 = load %struct.rfc822t*, %struct.rfc822t** %5
%31 = call i32 @rfc822t_free(%struct.rfc822t* %30)
%32 = load %struct.rfc822t*, %struct.rfc822t** %4
%33 = call i32 @rfc822t_free(%struct.rfc822t* %32)
%34 = load %struct.rfc822t*, %struct.rfc822t** %3
%35 = call i32 @rfc822t_free(%struct.rfc822t* %34)
%36 = load %struct.rfc822t*, %struct.rfc822t** %2
%37 = call i32 @rfc822t_free(%struct.rfc822t* %36)
ret i32 0
}

LLVM IR (-O2):
%struct.rfc822t = type { i32 }
%struct.rfc822a = type { i32 }
@.str = [46 x i8] c"nobody@example.com (Nobody (is) here\\) right)\00"
@.str.1 = [58 x i8] c"Distribution list: nobody@example.com daemon@example.com\00"
@.str.2 = [64 x i8] c"Mr Nobody <nobody@example.com>, Mr. Nobody <nobody@example.com>\00"
@.str.3 = [74 x i8] c"nobody@example.com, <nobody@example.com>, Mr. Nobody <nobody@example.com>\00"
define i32 @main() {
%1 = tail call %struct.rfc822t* @tokenize(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = tail call %struct.rfc822t* @tokenize(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call %struct.rfc822t* @tokenize(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call %struct.rfc822t* @tokenize(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call %struct.rfc822a* @doaddr(%struct.rfc822t* %1)
%6 = tail call %struct.rfc822a* @doaddr(%struct.rfc822t* %2)
%7 = tail call %struct.rfc822a* @doaddr(%struct.rfc822t* %3)
%8 = tail call %struct.rfc822a* @doaddr(%struct.rfc822t* %4)
%9 = tail call i32 @rfc822a_free(%struct.rfc822a* %8)
%10 = tail call i32 @rfc822a_free(%struct.rfc822a* %7)
%11 = tail call i32 @rfc822a_free(%struct.rfc822a* %6)
%12 = tail call i32 @rfc822a_free(%struct.rfc822a* %5)
%13 = tail call i32 @rfc822t_free(%struct.rfc822t* %4)
%14 = tail call i32 @rfc822t_free(%struct.rfc822t* %3)
%15 = tail call i32 @rfc822t_free(%struct.rfc822t* %2)
%16 = tail call i32 @rfc822t_free(%struct.rfc822t* %1)
ret i32 0
}