#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ help();
int sscanf(char *, char *, unsigned long *, char *);
int /*<<< orphan*/ stderr;
unsigned long get_tx_secs(char *arg) {
  unsigned long ret = -1;
  char junk[80];
  int test = sscanf(arg, "%d%s", &ret, junk);
  if (test == 1) {
    return ret;
  } else {
    fprintf(stderr, "-t requires a numerical value.\n");
    help();
    exit(1);
  }
}


x86 assembly (clang, -O0):
<get_tx_secs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rcx
lea    0xe9d(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <sscanf@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x1,-0x64(%rbp)
jne    1183 <get_tx_secs+0x43>
mov    -0x10(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <help@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<get_tx_secs>:
sub    $0x68,%rsp
movq   $0xffffffffffffffff,0x8(%rsp)
ff ff
lea    0xeac(%rip),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    1172 <get_tx_secs+0x32>
mov    0x8(%rsp),%rax
add    $0x68,%rsp
ret
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
lea    0xe83(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <help@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d%s\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"-t requires a numerical value.\0A\00"
define i64 @get_tx_secs(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca [80 x i8]
%5 = alloca i32
store i8* %0, i8** %2
store i64 -1, i64* %3
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%8 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i64, i64* %3
ret i64 %12
13: ; preds = %1
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 (...) @help()
%17 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%s\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"-t requires a numerical value.\0A\00"
define i64 @get_tx_secs(i8* nocapture %0) {
%2 = alloca i64
%3 = alloca [80 x i8]
%4 = bitcast i64* %2 to i8*
store i64 -1, i64* %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2, i8* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i64, i64* %2
ret i64 %9
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (...) @help()
%14 = call i32 @exit(i32 1)
unreachable
}