#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 */
struct timeval {
  int dummy;
};

/* Variables and functions */
scalar_t__ adjtime(struct timeval *, struct timeval *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ str_to_tv(char *, struct timeval *);
char *strerror(int /*<<< orphan*/);
char *tv_to_str(struct timeval *);
int main(int argc, char **argv) {
  struct timeval tv, otv;
  if (argc != 2) {
    fprintf(stderr,
            "%s: use \"%s <delta>\"\n"
            "   <delta> is a floating-point number of seconds\n",
            argv[0], argv[0]);
    exit(1);
  }
  if (str_to_tv(argv[1], &tv) < 0) {
    fprintf(stderr, "%s: not a time (float) number \"%s\"\n", argv[0], argv[1]);
    exit(1);
  }
  fprintf(stderr, "Requesting adjustment: %s seconds\n", tv_to_str(&tv));
  if (adjtime(&tv, &otv) < 0) {
    fprintf(stderr, "%s: adjtime(): %s\n", argv[0], strerror(errno));
    exit(1);
  }
  fprintf(stderr, "Previous adjustment: %s seconds\n", tv_to_str(&otv));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11af <main+0x4f>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xe62(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <str_to_tv@plt>
cmp    $0x0,%rax
jge    11fa <main+0x9a>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xe5e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <tv_to_str@plt>
mov    -0x24(%rbp),%edi
mov    %rax,%rdx
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <adjtime@plt>
cmp    $0x0,%rax
jge    1281 <main+0x121>
mov    0x2d9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    0x2d80(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rdx
mov    %rax,%rcx
lea    0xe1e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    0x2d58(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <tv_to_str@plt>
mov    -0x38(%rbp),%edi
mov    %rax,%rdx
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    11a1 <main+0x41>
mov    0x8(%rbx),%rdi
lea    0x10(%rsp),%rsi
call   1040 <str_to_tv@plt>
mov    0x2e59(%rip),%r15
mov    (%r15),%ebp
test   %rax,%rax
jns    11b9 <main+0x59>
mov    (%rbx),%rdx
mov    0x8(%rbx),%rcx
lea    0xeaa(%rip),%rsi
mov    %ebp,%edi
jmp    120e <main+0xae>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rcx
lea    0xe4c(%rip),%rsi
mov    %rcx,%rdx
jmp    120e <main+0xae>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <tv_to_str@plt>
lea    0xe9e(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1050 <adjtime@plt>
mov    (%r15),%ebp
test   %rax,%rax
jns    121f <main+0xbf>
mov    (%rbx),%rbx
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
lea    0xe88(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
lea    0x8(%rsp),%rdi
call   1030 <tv_to_str@plt>
lea    0xe71(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@stderr = global i32 0
@.str = [71 x i8] c"%s: use \22%s <delta>\22\0A <delta> is a floating-point number of seconds\0A\00"
@.str.1 = [36 x i8] c"%s: not a time (float) number \22%s\22\0A\00"
@.str.2 = [35 x i8] c"Requesting adjustment: %s seconds\0A\00"
@.str.3 = [19 x i8] c"%s: adjtime(): %s\0A\00"
@errno = global i32 0
@.str.4 = [33 x i8] c"Previous adjustment: %s seconds\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
%7 = alloca %struct.timeval
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @str_to_tv(i8* %23, %struct.timeval* %6)
%25 = icmp slt i64 %24, 0
br i1 %25, label %26, label %36
26: ; preds = %20
%27 = load i32, i32* @stderr
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 0
%30 = load i8*, i8** %29
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %30, i8* %33)
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %20
%37 = load i32, i32* @stderr
%38 = call i8* @tv_to_str(%struct.timeval* %6)
%39 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %38)
%40 = call i64 @adjtime(%struct.timeval* %6, %struct.timeval* %7)
%41 = icmp slt i64 %40, 0
br i1 %41, label %42, label %51
42: ; preds = %36
%43 = load i32, i32* @stderr
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 0
%46 = load i8*, i8** %45
%47 = load i32, i32* @errno
%48 = call i8* @strerror(i32 %47)
%49 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %46, i8* %48)
%50 = call i32 @exit(i32 1)
unreachable
51: ; preds = %36
%52 = load i32, i32* @stderr
%53 = call i8* @tv_to_str(%struct.timeval* %7)
%54 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %53)
%55 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@stderr = global i32 0
@.str = [71 x i8] c"%s: use \22%s <delta>\22\0A <delta> is a floating-point number of seconds\0A\00"
@.str.1 = [36 x i8] c"%s: not a time (float) number \22%s\22\0A\00"
@.str.2 = [35 x i8] c"Requesting adjustment: %s seconds\0A\00"
@.str.3 = [19 x i8] c"%s: adjtime(): %s\0A\00"
@errno = global i32 0
@.str.4 = [33 x i8] c"Previous adjustment: %s seconds\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %3 to i8*
%6 = bitcast %struct.timeval* %4 to i8*
%7 = icmp eq i32 %0, 2
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %10)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @str_to_tv(i8* %15, %struct.timeval* %3)
%17 = icmp slt i64 %16, 0
%18 = load i32, i32* @stderr
br i1 %17, label %19, label %24
19: ; preds = %13
%20 = load i8*, i8** %1
%21 = load i8*, i8** %14
%22 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %20, i8* %21)
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %13
%25 = call i8* @tv_to_str(%struct.timeval* %3)
%26 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %25)
%27 = call i64 @adjtime(%struct.timeval* %3, %struct.timeval* %4)
%28 = icmp slt i64 %27, 0
%29 = load i32, i32* @stderr
br i1 %28, label %30, label %36
30: ; preds = %24
%31 = load i8*, i8** %1
%32 = load i32, i32* @errno
%33 = call i8* @strerror(i32 %32)
%34 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %31, i8* %33)
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %24
%37 = call i8* @tv_to_str(%struct.timeval* %4)
%38 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %37)
%39 = call i32 @exit(i32 0)
unreachable
}