#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*/ pthread_t;
typedef char *pid_t;

/* Variables and functions */
char *getpid();
int /*<<< orphan*/ printf(char *, char *, char *, char *, int /*<<< orphan*/,
                          char *);
int /*<<< orphan*/ pthread_self();
void *processParentworker(void *arg) {
  pid_t pid = getpid();
  pthread_t tid = pthread_self();
  char prefix[] = "ProcessParentThread: ";
  char tprefix[] = "thread ";
  printf("%s%d %s%ld %s\n", prefix, pid, tprefix, tid, "step2");
  printf("%s%d %s%ld %s\n", prefix, pid, tprefix, tid, "step3");
  return NULL;
}


x86 assembly (clang, -O0):
<processParentworker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,-0x14(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea5(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea3(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xe9d(%rip),%ax
mov    %ax,-0x1c(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x38(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xe81(%rip),%rdi
lea    0xe89(%rip),%r9
call   1040 <printf@plt>
lea    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x38(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xe5e(%rip),%rdi
lea    0xe6c(%rip),%r9
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processParentworker>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%ebp
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x203a6461657268,%rax
mov    %rax,0x1e(%rsp)
movabs $0x20646165726874,%rax
mov    %rax,0x8(%rsp)
lea    0xe96(%rip),%r14
lea    0xe9e(%rip),%r9
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r12
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %ebp,%r8d
call   1040 <printf@plt>
lea    0xe7f(%rip),%r9
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %ebp,%r8d
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.processParentworker.prefix = [22 x i8] c"ProcessParentThread: \00"
@__const.processParentworker.tprefix = [8 x i8] c"thread \00"
@.str = [15 x i8] c"%s%d %s%ld %s\0A\00"
@.str.1 = [6 x i8] c"step2\00"
@.str.2 = [6 x i8] c"step3\00"
define i8* @processParentworker(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [22 x i8]
%6 = alloca [8 x i8]
store i8* %0, i8** %2
%7 = call i8* (...) @getpid()
store i8* %7, i8** %3
%8 = call i32 (...) @pthread_self()
store i32 %8, i32* %4
%9 = bitcast [22 x i8]* %5 to i8*
%10 = bitcast [8 x i8]* %6 to i8*
%11 = getelementptr inbounds [22 x i8], [22 x i8]* %5, i64 0, i64 0
%12 = load i8*, i8** %3
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i8* %13, i32 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%16 = getelementptr inbounds [22 x i8], [22 x i8]* %5, i64 0, i64 0
%17 = load i8*, i8** %3
%18 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%19 = load i32, i32* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17, i8* %18, i32 %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@__const.processParentworker.prefix = [22 x i8] c"ProcessParentThread: \00"
@.str = [15 x i8] c"%s%d %s%ld %s\0A\00"
@.str.1 = [6 x i8] c"step2\00"
@.str.2 = [6 x i8] c"step3\00"
define noalias i8* @processParentworker(i8* nocapture readnone %0) {
%2 = alloca [22 x i8]
%3 = alloca i64
%4 = tail call i8* (...) @getpid()
%5 = tail call i32 (...) @pthread_self()
%6 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%7 = bitcast i64* %3 to i8*
store i64 9117568731342964, i64* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %4, i8* %7, i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %4, i8* %7, i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i8* null
}