#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 */
scalar_t__ _xmit(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int, long);
scalar_t__ time(int /*<<< orphan*/ *);
void _notify_job(long my_job_id) {
  time_t now = time(NULL);
  char out_msg[256];
  snprintf(out_msg, sizeof(out_msg),
           "TS=%u AUTH=root DT=CMD=NOTIFYJOB ARG=%ld "
           "MSG=this_is_a_test",
           (uint32_t)now, my_job_id);
  if (_xmit(out_msg))
    exit(1);
}


x86 assembly (clang, -O0):
<_notify_job>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    $0x100,%esi
lea    0xe87(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <_xmit@plt>
cmp    $0x0,%rax
je     119e <_notify_job+0x5e>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_notify_job>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <time@plt>
lea    0xea5(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
mov    %eax,%ecx
mov    %rbx,%r8
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1040 <_xmit@plt>
test   %rax,%rax
jne    1188 <_notify_job+0x48>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"TS=%u AUTH=root DT=CMD=NOTIFYJOB ARG=%ld MSG=this_is_a_test\00"
define void @_notify_job(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca [256 x i8]
store i64 %0, i64* %2
%5 = call i64 @time(i32* null)
store i64 %5, i64* %3
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = load i64, i64* %2
%10 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %8, i64 %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%12 = call i64 @_xmit(i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"TS=%u AUTH=root DT=CMD=NOTIFYJOB ARG=%ld MSG=this_is_a_test\00"
define void @_notify_job(i64 %0) {
%2 = alloca [256 x i8]
%3 = tail call i64 @time(i32* null)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = trunc i64 %3 to i32
%6 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %0)
%7 = call i64 @_xmit(i8* %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret void
}