#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*/ printf(char *, ...);
int /*<<< orphan*/ ts_print_ascii_logo(int);
char *tslib_version();
void usage(char **argv) {
  ts_print_ascii_logo(16);
  printf("%s", tslib_version());
  printf("\n");
  printf("Usage: %s device_name wait_for_sec\n", argv[0]);
  printf("\tdevice_name  - tdevice to probe, example /dev/input/event0\n");
  printf("\twait_for_sec - wait seconds for touch event, if 0 - don't wait!\n");
  printf("\tReturn codes:\n");
  printf("\t  0          - timeout expired without receiving event.\n");
  printf("\t               But this maybe is TouchScreen.\n");
  printf("\t -1          - this is NOT TouchScreen device!\n");
  printf("\t  1          - this is TouchScreen for shure!\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10,%edi
call   1050 <ts_print_ascii_logo@plt>
mov    $0x0,%al
call   1040 <tslib_version@plt>
mov    %rax,%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    $0x10,%edi
call   1070 <ts_print_ascii_logo@plt>
xor    %eax,%eax
call   1060 <tslib_version@plt>
lea    0xe84(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rbx),%rsi
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7f(%rip),%rdi
call   1040 <puts@plt>
lea    0xeaf(%rip),%rdi
call   1040 <puts@plt>
lea    0xee4(%rip),%rdi
call   1040 <puts@plt>
lea    0xee7(%rip),%rdi
call   1040 <puts@plt>
lea    0xf14(%rip),%rdi
call   1040 <puts@plt>
lea    0xf37(%rip),%rdi
call   1040 <puts@plt>
lea    0xf5b(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [36 x i8] c"Usage: %s device_name wait_for_sec\0A\00"
@.str.3 = [61 x i8] c"\09device_name - tdevice to probe, example /dev/input/event0\0A\00"
@.str.4 = [66 x i8] c"\09wait_for_sec - wait seconds for touch event, if 0 - don't wait!\0A\00"
@.str.5 = [16 x i8] c"\09Return codes:\0A\00"
@.str.6 = [58 x i8] c"\09 0 - timeout expired without receiving event.\0A\00"
@.str.7 = [48 x i8] c"\09 But this maybe is TouchScreen.\0A\00"
@.str.8 = [49 x i8] c"\09 -1 - this is NOT TouchScreen device!\0A\00"
@.str.9 = [48 x i8] c"\09 1 - this is TouchScreen for shure!\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @ts_print_ascii_logo(i32 16)
%4 = call i8* (...) @tslib_version()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8**, i8*** %2
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0))
%18 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.2 = [36 x i8] c"Usage: %s device_name wait_for_sec\0A\00"
@str = [60 x i8] c"\09device_name - tdevice to probe, example /dev/input/event0\00"
@str.10 = [65 x i8] c"\09wait_for_sec - wait seconds for touch event, if 0 - don't wait!\00"
@str.11 = [15 x i8] c"\09Return codes:\00"
@str.12 = [57 x i8] c"\09 0 - timeout expired without receiving event.\00"
@str.13 = [47 x i8] c"\09 But this maybe is TouchScreen.\00"
@str.14 = [48 x i8] c"\09 -1 - this is NOT TouchScreen device!\00"
@str.15 = [47 x i8] c"\09 1 - this is TouchScreen for shure!\00"
define void @usage(i8** nocapture %0) {
%2 = tail call i32 @ts_print_ascii_logo(i32 16)
%3 = tail call i8* (...) @tslib_version()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @putchar(i32 10)
%6 = load i8*, i8** %0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.10, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.11, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.12, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.13, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.14, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.15, i64 0, i64 0))
%15 = tail call i32 @exit(i32 -1)
unreachable
}