#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 */

/* Variables and functions */
int /*<<< orphan*/ Exit();
int MyPriority();
int MyTid();
int /*<<< orphan*/ Send(int, int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ Write(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strLen(char *);
main() {
  int taskB, taskC;
  char strWrite[50];
  sprintf(strWrite, "I am TaskB[%d], priority[%d] \n", MyTid(), MyPriority());
  Write(strWrite, strLen(strWrite), 1);
  Send(7, 0, 0, 0, 0);
  sprintf(strWrite, "TaskB replied from TaskC\n");
  Write(strWrite, strLen(strWrite), 1);
  sprintf(strWrite, "I am TaskB[%d], priority[%d] \n", MyTid(), MyPriority());
  Write(strWrite, strLen(strWrite), 1);
  Exit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x40(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    $0x0,%al
call   1030 <MyTid@plt>
mov    %eax,-0x6c(%rbp)
mov    $0x0,%al
call   1070 <MyPriority@plt>
mov    -0x78(%rbp),%rdi
mov    -0x6c(%rbp),%edx
mov    %eax,%ecx
lea    0xe5c(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x40(%rbp),%rdi
call   1050 <strLen@plt>
mov    -0x68(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <Write@plt>
mov    $0x7,%edi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1060 <Send@plt>
lea    -0x40(%rbp),%rdi
lea    0xe32(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x40(%rbp),%rdi
call   1050 <strLen@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <Write@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    $0x0,%al
call   1030 <MyTid@plt>
mov    %eax,-0x4c(%rbp)
mov    $0x0,%al
call   1070 <MyPriority@plt>
mov    -0x58(%rbp),%rdi
mov    -0x4c(%rbp),%edx
mov    %eax,%ecx
lea    0xdc2(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
call   1050 <strLen@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <Write@plt>
mov    $0x0,%al
call   1080 <Exit@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
xor    %eax,%eax
call   1030 <MyTid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1070 <MyPriority@plt>
lea    0xe71(%rip),%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <Write@plt>
mov    $0x7,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1060 <Send@plt>
movups 0xe4b(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe4a(%rip),%xmm0
movups %xmm0,0xa(%rsp)
mov    %rbx,%rdi
call   1050 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <Write@plt>
xor    %eax,%eax
call   1030 <MyTid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1070 <MyPriority@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <Write@plt>
xor    %eax,%eax
call   1080 <Exit@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"I am TaskB[%d], priority[%d] \0A\00"
@.str.1 = [26 x i8] c"TaskB replied from TaskC\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = call i32 (...) @MyTid()
%6 = call i32 (...) @MyPriority()
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%10 = call i32 @strLen(i8* %9)
%11 = call i32 @Write(i8* %8, i32 %10, i32 1)
%12 = call i32 @Send(i32 7, i32 0, i32 0, i32 0, i32 0)
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%14 = call i32 (i8*, i8*, ...) @sprintf(i8* %13, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%17 = call i32 @strLen(i8* %16)
%18 = call i32 @Write(i8* %15, i32 %17, i32 1)
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%20 = call i32 (...) @MyTid()
%21 = call i32 (...) @MyPriority()
%22 = call i32 (i8*, i8*, ...) @sprintf(i8* %19, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21)
%23 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%24 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%25 = call i32 @strLen(i8* %24)
%26 = call i32 @Write(i8* %23, i32 %25, i32 1)
%27 = call i32 (...) @Exit()
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"I am TaskB[%d], priority[%d] \0A\00"
@.str.1 = [26 x i8] c"TaskB replied from TaskC\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @MyTid()
%4 = tail call i32 (...) @MyPriority()
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 @strLen(i8* %2)
%7 = call i32 @Write(i8* %2, i32 %6, i32 1)
%8 = call i32 @Send(i32 7, i32 0, i32 0, i32 0, i32 0)
%9 = call i32 @strLen(i8* %2)
%10 = call i32 @Write(i8* %2, i32 %9, i32 1)
%11 = call i32 (...) @MyTid()
%12 = call i32 (...) @MyPriority()
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = call i32 @strLen(i8* %2)
%15 = call i32 @Write(i8* %2, i32 %14, i32 1)
%16 = call i32 (...) @Exit()
ret i32 0
}