#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*/ DC_sendResult(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ create_file(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void send_subresult(int c) {
  char l[100];
  char p[100];
  char s[100];
  printf("cyc=%d Sending subresult...\n", c);
  sprintf(l, "l_%d", c);
  sprintf(p, "p_%d", c);
  sprintf(s, "subresult %d", c);
  create_file(p, s);
  DC_sendResult(l, p, (0));
}


x86 assembly (clang, -O0):
<send_subresult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0xe0(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea1(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x150(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe90(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0xe0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1050 <create_file@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
xor    %edx,%edx
call   1040 <DC_sendResult@plt>
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_subresult>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    %edi,%ebx
lea    0xea9(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rsi
lea    0xe0(%rsp),%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1060 <sprintf@plt>
lea    0xea4(%rip),%rsi
lea    0x70(%rsp),%r15
mov    %r15,%rdi
mov    %ebx,%edx
call   1060 <sprintf@plt>
lea    0xe93(%rip),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
mov    %ebx,%edx
call   1060 <sprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <create_file@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1040 <DC_sendResult@plt>
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [29 x i8] c"cyc=%d Sending subresult...\0A\00"
@.str.1 = [5 x i8] c"l_%d\00"
@.str.2 = [5 x i8] c"p_%d\00"
@.str.3 = [13 x i8] c"subresult %d\00"
define void @send_subresult(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%12 = load i32, i32* %2
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%15 = load i32, i32* %2
%16 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%19 = call i32 @create_file(i8* %17, i8* %18)
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%22 = call i32 @DC_sendResult(i8* %20, i8* %21, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"cyc=%d Sending subresult...\0A\00"
@.str.1 = [5 x i8] c"l_%d\00"
@.str.2 = [5 x i8] c"p_%d\00"
@.str.3 = [13 x i8] c"subresult %d\00"
define void @send_subresult(i32 %0) {
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
%9 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%10 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%11 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %0)
%12 = call i32 @create_file(i8* %6, i8* %7)
%13 = call i32 @DC_sendResult(i8* %5, i8* %6, i32 0)
ret void
}