#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 */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int O_CREAT;
int O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fork();
int getpid();
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
char *mmap(int /*<<< orphan*/, int, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
int open(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ wait(int *);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  int fd;
  char *map;
  fd = open("test", O_RDWR | O_CREAT);
  lseek(fd, ((1000) * sizeof(int)) - 1, SEEK_SET);
  write(fd, "", 1);
  map = mmap(0, ((1000) * sizeof(int)), PROT_READ | PROT_WRITE, MAP_SHARED, fd,
             0);
  close(fd);
  pid_t pid;
  int rv;
  int val1, val2, val3;
  switch (pid = fork()) {
  case -1:
    perror("fork() has not worked!");
    exit(1);
  case 0:
    printf("CHILD: I am the child!\n");
    printf("CHILD: My PID is %d.\n", getpid());
    printf("CHILD: First value for mmap?\n");
    scanf(" %d", &val1);
    printf("CHILD: Second value for mmap?\n");
    scanf(" %d", &val2);
    printf("CHILD: Third value for mmap?\n");
    scanf(" %d", &val3);
    map[0] = val1;
    map[1] = val2;
    map[2] = val3;
    printf("CHILD: Enter my return status: ");
    scanf(" %d", &rv);
    printf("CHILD: I'm done!\n");
    break;
  default:
    printf("PARENT: I am the parent!\n");
    printf("PARENT: My PID is %d.\n", getpid());
    wait(&rv);
    printf("PARENT: My child's return value was %d.\n", rv);
    printf("PARENT: My child set the following values:\n");
    printf("PARENT: map[0] is %d.\n", map[0]);
    printf("PARENT: map[1] is %d.\n", map[1]);
    printf("PARENT: map[2] is %d.\n", map[2]);
    printf("PARENT: I'm done!\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2dfa(%rip),%rax
mov    (%rax),%esi
mov    0x2e19(%rip),%rax
mov    (%rax),%eax
or     %eax,%esi
lea    0xe16(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2dc4(%rip),%rax
mov    (%rax),%edx
mov    $0xf9f,%esi
call   1070 <lseek@plt>
mov    -0x8(%rbp),%edi
lea    0xe21(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x2dcd(%rip),%rax
mov    (%rax),%edx
mov    0x2d8c(%rip),%rax
mov    (%rax),%eax
or     %eax,%edx
mov    0x2da9(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%r8d
mov    $0xfa0,%esi
xor    %r9d,%r9d
mov    %r9d,-0x2c(%rbp)
mov    %r9d,%edi
call   1050 <mmap@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <close@plt>
mov    -0x2c(%rbp),%eax
call   10e0 <fork@plt>
mov    %eax,-0x14(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x28(%rbp)
sub    $0xffffffff,%eax
je     128b <main+0xcb>
jmp    127b <main+0xbb>
mov    -0x28(%rbp),%eax
test   %eax,%eax
je     12a1 <main+0xe1>
jmp    1374 <main+0x1b4>
lea    0xd73(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd8d(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1090 <scanf@plt>
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd6f(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1090 <scanf@plt>
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd51(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x24(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd10(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1090 <scanf@plt>
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1410 <main+0x250>
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x18(%rbp),%rdi
call   10d0 <wait@plt>
mov    -0x18(%rbp),%esi
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%esi
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%esi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2df1(%rip),%rax
mov    0x2e12(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xe0f(%rip),%rdi
call   10b0 <open@plt>
mov    %eax,%ebp
mov    0x2dc1(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
mov    $0xf9f,%esi
call   1080 <lseek@plt>
lea    0xe81(%rip),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
call   1040 <write@plt>
mov    0x2dc9(%rip),%rax
mov    0x2d8a(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2da7(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0xfa0,%esi
mov    %ebp,%r8d
xor    %r9d,%r9d
call   1060 <mmap@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1090 <close@plt>
xor    %eax,%eax
call   10f0 <fork@plt>
test   %eax,%eax
je     12f8 <main+0x128>
cmp    $0xffffffff,%eax
je     13b1 <main+0x1e1>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xdcd(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rsp,%rdi
call   10e0 <wait@plt>
mov    (%rsp),%esi
lea    0xdc9(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
movsbl (%rbx),%esi
lea    0xdd5(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movsbl 0x1(%rbx),%esi
lea    0xdda(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movsbl 0x2(%rbx),%esi
lea    0xddf(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xeac(%rip),%rdi
jmp    13a1 <main+0x1d1>
lea    0xddc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xd0a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdd0(%rip),%rdi
call   1030 <puts@plt>
lea    0xd04(%rip),%r14
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
lea    0xdcd(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
lea    0xdd2(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
mov    0xc(%rsp),%al
mov    %al,(%rbx)
mov    0x8(%rsp),%al
mov    %al,0x1(%rbx)
mov    0x4(%rsp),%al
mov    %al,0x2(%rbx)
lea    0xcae(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rsp,%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
lea    0xda9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xc4d(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@SEEK_SET = global i32 0
@.str.1 = [1 x i8] zeroinitializer
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.2 = [23 x i8] c"fork() has not worked!\00"
@.str.3 = [24 x i8] c"CHILD: I am the child!\0A\00"
@.str.4 = [22 x i8] c"CHILD: My PID is %d.\0A\00"
@.str.5 = [30 x i8] c"CHILD: First value for mmap?\0A\00"
@.str.6 = [4 x i8] c" %d\00"
@.str.7 = [31 x i8] c"CHILD: Second value for mmap?\0A\00"
@.str.8 = [30 x i8] c"CHILD: Third value for mmap?\0A\00"
@.str.9 = [32 x i8] c"CHILD: Enter my return status: \00"
@.str.10 = [18 x i8] c"CHILD: I'm done!\0A\00"
@.str.11 = [26 x i8] c"PARENT: I am the parent!\0A\00"
@.str.12 = [23 x i8] c"PARENT: My PID is %d.\0A\00"
@.str.13 = [41 x i8] c"PARENT: My child's return value was %d.\0A\00"
@.str.14 = [44 x i8] c"PARENT: My child set the following values:\0A\00"
@.str.15 = [23 x i8] c"PARENT: map[0] is %d.\0A\00"
@.str.16 = [23 x i8] c"PARENT: map[1] is %d.\0A\00"
@.str.17 = [23 x i8] c"PARENT: map[2] is %d.\0A\00"
@.str.18 = [19 x i8] c"PARENT: I'm done!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = load i32, i32* @O_RDWR
%10 = load i32, i32* @O_CREAT
%11 = or i32 %9, %10
%12 = call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @lseek(i32 %13, i32 3999, i32 %14)
%16 = load i32, i32* %2
%17 = call i32 @write(i32 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%18 = load i32, i32* @PROT_READ
%19 = load i32, i32* @PROT_WRITE
%20 = or i32 %18, %19
%21 = load i32, i32* @MAP_SHARED
%22 = load i32, i32* %2
%23 = call i8* @mmap(i32 0, i32 4000, i32 %20, i32 %21, i32 %22, i32 0)
store i8* %23, i8** %3
%24 = load i32, i32* %2
%25 = call i32 @close(i32 %24)
%26 = call i32 (...) @fork()
store i32 %26, i32* %4
switch i32 %26, label %55 [
i32 -1, label %27
i32 0, label %30
]
27: ; preds = %0
%28 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%32 = call i32 (...) @getpid()
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %6)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%37 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %7)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%39 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %8)
%40 = load i32, i32* %6
%41 = trunc i32 %40 to i8
%42 = load i8*, i8** %3
%43 = getelementptr inbounds i8, i8* %42, i64 0
store i8 %41, i8* %43
%44 = load i32, i32* %7
%45 = trunc i32 %44 to i8
%46 = load i8*, i8** %3
%47 = getelementptr inbounds i8, i8* %46, i64 1
store i8 %45, i8* %47
%48 = load i32, i32* %8
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %3
%51 = getelementptr inbounds i8, i8* %50, i64 2
store i8 %49, i8* %51
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
%53 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %5)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
br label %79
55: ; preds = %0
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
%57 = call i32 (...) @getpid()
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %57)
%59 = call i32 @wait(i32* %5)
%60 = load i32, i32* %5
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0), i32 %60)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.14, i64 0, i64 0))
%63 = load i8*, i8** %3
%64 = getelementptr inbounds i8, i8* %63, i64 0
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), i32 %66)
%68 = load i8*, i8** %3
%69 = getelementptr inbounds i8, i8* %68, i64 1
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0), i32 %71)
%73 = load i8*, i8** %3
%74 = getelementptr inbounds i8, i8* %73, i64 2
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0), i32 %76)
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.18, i64 0, i64 0))
br label %79
79: ; preds = %55, %30
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@SEEK_SET = global i32 0
@.str.1 = [1 x i8] zeroinitializer
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.2 = [23 x i8] c"fork() has not worked!\00"
@.str.4 = [22 x i8] c"CHILD: My PID is %d.\0A\00"
@.str.6 = [4 x i8] c" %d\00"
@.str.9 = [32 x i8] c"CHILD: Enter my return status: \00"
@.str.12 = [23 x i8] c"PARENT: My PID is %d.\0A\00"
@.str.13 = [41 x i8] c"PARENT: My child's return value was %d.\0A\00"
@.str.15 = [23 x i8] c"PARENT: map[0] is %d.\0A\00"
@.str.16 = [23 x i8] c"PARENT: map[1] is %d.\0A\00"
@.str.17 = [23 x i8] c"PARENT: map[2] is %d.\0A\00"
@str = [23 x i8] c"CHILD: I am the child!\00"
@str.19 = [29 x i8] c"CHILD: First value for mmap?\00"
@str.20 = [30 x i8] c"CHILD: Second value for mmap?\00"
@str.21 = [29 x i8] c"CHILD: Third value for mmap?\00"
@str.22 = [17 x i8] c"CHILD: I'm done!\00"
@str.23 = [25 x i8] c"PARENT: I am the parent!\00"
@str.24 = [43 x i8] c"PARENT: My child set the following values:\00"
@str.25 = [18 x i8] c"PARENT: I'm done!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_CREAT
%7 = or i32 %6, %5
%8 = tail call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @SEEK_SET
%10 = tail call i32 @lseek(i32 %8, i32 3999, i32 %9)
%11 = tail call i32 @write(i32 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%12 = load i32, i32* @PROT_READ
%13 = load i32, i32* @PROT_WRITE
%14 = or i32 %13, %12
%15 = load i32, i32* @MAP_SHARED
%16 = tail call i8* @mmap(i32 0, i32 4000, i32 %14, i32 %15, i32 %8, i32 0)
%17 = tail call i32 @close(i32 %8)
%18 = bitcast i32* %1 to i8*
%19 = bitcast i32* %2 to i8*
%20 = bitcast i32* %3 to i8*
%21 = bitcast i32* %4 to i8*
%22 = tail call i32 (...) @fork()
switch i32 %22, label %46 [
i32 -1, label %23
i32 0, label %26
]
23: ; preds = %0
%24 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%25 = tail call i32 @exit(i32 1)
unreachable
26: ; preds = %0
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%28 = tail call i32 (...) @getpid()
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %28)
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.19, i64 0, i64 0))
%31 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.20, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.21, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%36 = load i32, i32* %2
%37 = trunc i32 %36 to i8
store i8 %37, i8* %16
%38 = load i32, i32* %3
%39 = trunc i32 %38 to i8
%40 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %39, i8* %40
%41 = load i32, i32* %4
%42 = trunc i32 %41 to i8
%43 = getelementptr inbounds i8, i8* %16, i64 2
store i8 %42, i8* %43
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
%45 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %1)
br label %65
46: ; preds = %0
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.23, i64 0, i64 0))
%48 = tail call i32 (...) @getpid()
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %48)
%50 = call i32 @wait(i32* %1)
%51 = load i32, i32* %1
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0), i32 %51)
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.24, i64 0, i64 0))
%54 = load i8, i8* %16
%55 = sext i8 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), i32 %55)
%57 = getelementptr inbounds i8, i8* %16, i64 1
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds i8, i8* %16, i64 2
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %46, %26
%66 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @str.25, i64 0, i64 0), %46 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.22, i64 0, i64 0), %26 ]
%67 = call i32 @puts(i8* dereferenceable(1) %66)
ret i32 0
}