#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 uint32_t;
typedef scalar_t__ time_t;
typedef int /*<<< orphan*/ out_msg;

/* Variables and functions */
int _xmit(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int, long);
scalar_t__ time(int /*<<< orphan*/ *);
void _start_job(long my_job_id) {
  time_t now = time(NULL);
  char out_msg[128];
  int i, rc;
  snprintf(out_msg, sizeof(out_msg),
           "TS=%u AUTH=root DT=CMD=STARTJOB ARG=%ld "
           "COMMENT=\'start comment\' "
           "TASKLIST=",
           (uint32_t)now, my_job_id);
  for (i = 0; i < 10; i++) {
    if (i)
      sleep(10);
    rc = _xmit(out_msg);
    if (rc == 0)
      break;
  }
  if (rc != 0)
    exit(1);
}


x86 assembly (clang, -O0):
<_start_job>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    $0x80,%esi
lea    0xe77(%rip),%rdx
call   1030 <snprintf@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0xa,-0x94(%rbp)
jge    11f9 <_start_job+0xa9>
cmpl   $0x0,-0x94(%rbp)
je     11bc <_start_job+0x6c>
mov    $0xa,%edi
call   1070 <sleep@plt>
lea    -0x90(%rbp),%rdi
call   1040 <_xmit@plt>
mov    %eax,-0x98(%rbp)
cmpl   $0x0,-0x98(%rbp)
jne    11e0 <_start_job+0x90>
jmp    11f9 <_start_job+0xa9>
jmp    11e5 <_start_job+0x95>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1198 <_start_job+0x48>
cmpl   $0x0,-0x98(%rbp)
je     1210 <_start_job+0xc0>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start_job>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <time@plt>
lea    0xe95(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
mov    %rbx,%r8
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
je     1262 <_start_job+0x112>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
je     1262 <_start_job+0x112>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
je     1262 <_start_job+0x112>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
je     1262 <_start_job+0x112>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
je     1262 <_start_job+0x112>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
je     1262 <_start_job+0x112>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
je     1262 <_start_job+0x112>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
je     1262 <_start_job+0x112>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
je     1262 <_start_job+0x112>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1040 <_xmit@plt>
test   %eax,%eax
jne    126d <_start_job+0x11d>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"TS=%u AUTH=root DT=CMD=STARTJOB ARG=%ld COMMENT='start comment' TASKLIST=\00"
define void @_start_job(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca [128 x i8]
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %2
%7 = call i64 @time(i32* null)
store i64 %7, i64* %3
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i32
%11 = load i64, i64* %2
%12 = call i32 @snprintf(i8* %8, i32 128, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %10, i64 %11)
store i32 0, i32* %5
br label %13
13: ; preds = %28, %1
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 10
br i1 %15, label %16, label %31
16: ; preds = %13
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @sleep(i32 10)
br label %21
21: ; preds = %19, %16
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%23 = call i32 @_xmit(i8* %22)
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %21
br label %31
27: ; preds = %21
br label %28
28: ; preds = %27
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %13
31: ; preds = %26, %13
%32 = load i32, i32* %6
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %31
ret void
}

LLVM IR (-O2):
@.str = [74 x i8] c"TS=%u AUTH=root DT=CMD=STARTJOB ARG=%ld COMMENT='start comment' TASKLIST=\00"
define void @_start_job(i64 %0) {
%2 = alloca [128 x i8]
%3 = tail call i64 @time(i32* null)
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = trunc i64 %3 to i32
%6 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %0)
%7 = call i32 @_xmit(i8* %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %47, label %9
9: ; preds = %1
%10 = call i32 @sleep(i32 10)
%11 = call i32 @_xmit(i8* %4)
%12 = icmp eq i32 %11, 0
br i1 %12, label %47, label %13
13: ; preds = %9
%14 = call i32 @sleep(i32 10)
%15 = call i32 @_xmit(i8* %4)
%16 = icmp eq i32 %15, 0
br i1 %16, label %47, label %17
17: ; preds = %13
%18 = call i32 @sleep(i32 10)
%19 = call i32 @_xmit(i8* %4)
%20 = icmp eq i32 %19, 0
br i1 %20, label %47, label %21
21: ; preds = %17
%22 = call i32 @sleep(i32 10)
%23 = call i32 @_xmit(i8* %4)
%24 = icmp eq i32 %23, 0
br i1 %24, label %47, label %25
25: ; preds = %21
%26 = call i32 @sleep(i32 10)
%27 = call i32 @_xmit(i8* %4)
%28 = icmp eq i32 %27, 0
br i1 %28, label %47, label %29
29: ; preds = %25
%30 = call i32 @sleep(i32 10)
%31 = call i32 @_xmit(i8* %4)
%32 = icmp eq i32 %31, 0
br i1 %32, label %47, label %33
33: ; preds = %29
%34 = call i32 @sleep(i32 10)
%35 = call i32 @_xmit(i8* %4)
%36 = icmp eq i32 %35, 0
br i1 %36, label %47, label %37
37: ; preds = %33
%38 = call i32 @sleep(i32 10)
%39 = call i32 @_xmit(i8* %4)
%40 = icmp eq i32 %39, 0
br i1 %40, label %47, label %41
41: ; preds = %37
%42 = call i32 @sleep(i32 10)
%43 = call i32 @_xmit(i8* %4)
%44 = icmp eq i32 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %41
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %41, %37, %33, %29, %25, %21, %17, %13, %9, %1
ret void
}