#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*/ printf(char *, ...);
int /*<<< orphan*/ send_befor(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sendjob_tonode(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  int i = 0;
  for (i = 0; i < 20; i++)
    send_befor(NULL, i);
  sleep(1);
  printf("send...\n");
  char c[20] = "0aaadfsdad";
  for (i = 0; i < 20; i++) {
    printf("%s \n", c);
    sendjob_tonode(c, i);
    c[0] = ((int)c[0] + (int)1);
    if (c[0] == 'z')
      c[0] = '0';
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1181 <main+0x41>
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1050 <send_befor@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115d <main+0x1d>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0xe70(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe6d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe6b(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1215 <main+0xd5>
lea    -0x20(%rbp),%rsi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <sendjob_tonode@plt>
movsbl -0x20(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x20(%rbp)
movsbl -0x20(%rbp),%eax
cmp    $0x7a,%eax
jne    1202 <main+0xc2>
movb   $0x30,-0x20(%rbp)
jmp    1207 <main+0xc7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11bf <main+0x7f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %edi,%edi
xor    %esi,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x4,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x5,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x7,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x9,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0xa,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0xb,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0xc,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0xd,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0xe,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0xf,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x11,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x12,%esi
call   1060 <send_befor@plt>
xor    %edi,%edi
mov    $0x13,%esi
call   1060 <send_befor@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
lea    0xdc1(%rip),%rdi
call   1040 <puts@plt>
movaps 0xd9c(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xd9d(%rip),%r14
mov    %rsp,%rbx
mov    $0x30,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <sendjob_tonode@plt>
movzbl (%rsp),%eax
add    $0x1,%al
cmp    $0x7a,%al
movzbl %al,%eax
cmove  %r15d,%eax
mov    %al,(%rsp)
add    $0x1,%ebp
cmp    $0x14,%ebp
jne    1290 <main+0x140>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"send...\0A\00"
@__const.main.c = [20 x i8] c"0aaadfsdad\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 20
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @send_befor(i32* null, i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = call i32 @sleep(i32 1)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%16 = bitcast [20 x i8]* %3 to i8*
store i32 0, i32* %2
br label %17
17: ; preds = %39, %13
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 20
br i1 %19, label %20, label %42
20: ; preds = %17
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%24 = load i32, i32* %2
%25 = call i32 @sendjob_tonode(i8* %23, i32 %24)
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = add nsw i32 %28, 1
%30 = trunc i32 %29 to i8
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
store i8 %30, i8* %31
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 122
br i1 %35, label %36, label %38
36: ; preds = %20
%37 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
store i8 48, i8* %37
br label %38
38: ; preds = %36, %20
br label %39
39: ; preds = %38
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %17
42: ; preds = %17
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
@__const.main.c = [20 x i8] c"0aaadfsdad\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [5 x i8] c"%s \0A\00"
@str = [8 x i8] c"send...\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = tail call i32 @send_befor(i32* null, i32 0)
%3 = tail call i32 @send_befor(i32* null, i32 1)
%4 = tail call i32 @send_befor(i32* null, i32 2)
%5 = tail call i32 @send_befor(i32* null, i32 3)
%6 = tail call i32 @send_befor(i32* null, i32 4)
%7 = tail call i32 @send_befor(i32* null, i32 5)
%8 = tail call i32 @send_befor(i32* null, i32 6)
%9 = tail call i32 @send_befor(i32* null, i32 7)
%10 = tail call i32 @send_befor(i32* null, i32 8)
%11 = tail call i32 @send_befor(i32* null, i32 9)
%12 = tail call i32 @send_befor(i32* null, i32 10)
%13 = tail call i32 @send_befor(i32* null, i32 11)
%14 = tail call i32 @send_befor(i32* null, i32 12)
%15 = tail call i32 @send_befor(i32* null, i32 13)
%16 = tail call i32 @send_befor(i32* null, i32 14)
%17 = tail call i32 @send_befor(i32* null, i32 15)
%18 = tail call i32 @send_befor(i32* null, i32 16)
%19 = tail call i32 @send_befor(i32* null, i32 17)
%20 = tail call i32 @send_befor(i32* null, i32 18)
%21 = tail call i32 @send_befor(i32* null, i32 19)
%22 = tail call i32 @sleep(i32 1)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%24 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
br label %25
25: ; preds = %0, %25
%26 = phi i32 [ 0, %0 ], [ %33, %25 ]
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%28 = call i32 @sendjob_tonode(i8* %24, i32 %26)
%29 = load i8, i8* %24
%30 = add i8 %29, 1
%31 = icmp eq i8 %30, 122
%32 = select i1 %31, i8 48, i8 %30
store i8 %32, i8* %24
%33 = add nuw nsw i32 %26, 1
%34 = icmp eq i32 %33, 20
br i1 %34, label %35, label %25
35: ; preds = %25
ret i32 0
}