#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*/ WSQ_AddOp(int, char *, char *, char *, char *);
int /*<<< orphan*/ WSQ_BeginSubgraph(int);
int /*<<< orphan*/ WSQ_BeginTransaction(int);
int /*<<< orphan*/ WSQ_EndSubgraph();
int /*<<< orphan*/ WSQ_EndTransaction();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void query_A() {
  printf("query a.\n");
  char addr[128];
  sprintf(
      addr,
      "UNSET__THIS_ADDR_SHOULD_NOT_BE_USED_IN_THE_CURRENT_IMPLEMENTATION | %d",
      5002);
  WSQ_BeginTransaction(1001);
  WSQ_BeginSubgraph(101);
  WSQ_AddOp(1, "ASCIIFileSource", "", "100", "-1 || TAQ.1000000");
  WSQ_AddOp(2, "ConnectRemoteOut", "100", "", addr);
  WSQ_EndSubgraph();
  WSQ_EndTransaction();
}


x86 assembly (clang, -O0):
<query_A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    0xe78(%rip),%rsi
mov    $0x138a,%edx
call   1090 <sprintf@plt>
mov    $0x3e9,%edi
call   1050 <WSQ_BeginTransaction@plt>
mov    $0x65,%edi
call   1070 <WSQ_BeginSubgraph@plt>
mov    $0x1,%edi
lea    0xe95(%rip),%rsi
lea    0xe46(%rip),%rdx
lea    0xe97(%rip),%rcx
lea    0xe94(%rip),%r8
call   1060 <WSQ_AddOp@plt>
lea    -0x80(%rbp),%r8
mov    $0x2,%edi
lea    0xe91(%rip),%rsi
lea    0xe74(%rip),%rdx
lea    0xe15(%rip),%rcx
call   1060 <WSQ_AddOp@plt>
mov    $0x0,%al
call   1040 <WSQ_EndSubgraph@plt>
mov    $0x0,%al
call   1080 <WSQ_EndTransaction@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_A>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xe71(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x138a,%edx
call   1090 <sprintf@plt>
mov    $0x3e9,%edi
call   1050 <WSQ_BeginTransaction@plt>
mov    $0x65,%edi
call   1070 <WSQ_BeginSubgraph@plt>
lea    0xe8d(%rip),%rsi
lea    0xec5(%rip),%r15
lea    0xe8f(%rip),%rbx
lea    0xe8c(%rip),%r8
mov    $0x1,%edi
mov    %r15,%rdx
mov    %rbx,%rcx
call   1060 <WSQ_AddOp@plt>
lea    0xe87(%rip),%rsi
mov    $0x2,%edi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1060 <WSQ_AddOp@plt>
xor    %eax,%eax
call   1040 <WSQ_EndSubgraph@plt>
xor    %eax,%eax
call   1080 <WSQ_EndTransaction@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"query a.\0A\00"
@.str.1 = [71 x i8] c"UNSET__THIS_ADDR_SHOULD_NOT_BE_USED_IN_THE_CURRENT_IMPLEMENTATION | %d\00"
@.str.2 = [16 x i8] c"ASCIIFileSource\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [4 x i8] c"100\00"
@.str.5 = [18 x i8] c"-1 || TAQ.1000000\00"
@.str.6 = [17 x i8] c"ConnectRemoteOut\00"
define void @query_A() {
%1 = alloca [128 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0), i32 5002)
%5 = call i32 @WSQ_BeginTransaction(i32 1001)
%6 = call i32 @WSQ_BeginSubgraph(i32 101)
%7 = call i32 @WSQ_AddOp(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%9 = call i32 @WSQ_AddOp(i32 2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%10 = call i32 (...) @WSQ_EndSubgraph()
%11 = call i32 (...) @WSQ_EndTransaction()
ret void
}

LLVM IR (-O2):
@.str.1 = [71 x i8] c"UNSET__THIS_ADDR_SHOULD_NOT_BE_USED_IN_THE_CURRENT_IMPLEMENTATION | %d\00"
@.str.2 = [16 x i8] c"ASCIIFileSource\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [4 x i8] c"100\00"
@.str.5 = [18 x i8] c"-1 || TAQ.1000000\00"
@.str.6 = [17 x i8] c"ConnectRemoteOut\00"
@str = [9 x i8] c"query a.\00"
define void @query_A() {
%1 = alloca [128 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0), i32 5002)
%5 = tail call i32 @WSQ_BeginTransaction(i32 1001)
%6 = tail call i32 @WSQ_BeginSubgraph(i32 101)
%7 = tail call i32 @WSQ_AddOp(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @WSQ_AddOp(i32 2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%9 = call i32 (...) @WSQ_EndSubgraph()
%10 = call i32 (...) @WSQ_EndTransaction()
ret void
}