#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 /*<<< orphan*/ WINDOW;

/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
scalar_t__ sscanf(char *, char *, int *);
int /*<<< orphan*/ wtouchln(int /*<<< orphan*/ *, int, int, int);
void cmd_wtouchln(int nargs, char **args) {
  WINDOW *win;
  int line, n, changed;
  if (check_arg_count(nargs, 4) == 1)
    return;
  if (sscanf(args[0], "%p", &win) == 0) {
    report_count(1);
    report_error("BAD ARGUMENT");
    return;
  }
  if (sscanf(args[1], "%d", &line) == 0) {
    report_count(1);
    report_error("BAD ARGUMENT");
    return;
  }
  if (sscanf(args[2], "%d", &n) == 0) {
    report_count(1);
    report_error("BAD ARGUMENT");
    return;
  }
  if (sscanf(args[3], "%d", &changed) == 0) {
    report_count(1);
    report_error("BAD ARGUMENT");
    return;
  }
  report_count(1);
  report_return(wtouchln(win, line, n, changed));
}


x86 assembly (clang, -O0):
<cmd_wtouchln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    118a <cmd_wtouchln+0x2a>
jmp    12a0 <cmd_wtouchln+0x140>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0x18(%rbp),%rdx
lea    0xe64(%rip),%rsi
call   1070 <sscanf@plt>
cmp    $0x0,%rax
jne    11c6 <cmd_wtouchln+0x66>
mov    $0x1,%edi
call   1060 <report_count@plt>
lea    0xe47(%rip),%rdi
call   1080 <report_error@plt>
jmp    12a0 <cmd_wtouchln+0x140>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3b(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1070 <sscanf@plt>
cmp    $0x0,%rax
jne    1203 <cmd_wtouchln+0xa3>
mov    $0x1,%edi
call   1060 <report_count@plt>
lea    0xe0a(%rip),%rdi
call   1080 <report_error@plt>
jmp    12a0 <cmd_wtouchln+0x140>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdfe(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1070 <sscanf@plt>
cmp    $0x0,%rax
jne    1240 <cmd_wtouchln+0xe0>
mov    $0x1,%edi
call   1060 <report_count@plt>
lea    0xdcd(%rip),%rdi
call   1080 <report_error@plt>
jmp    12a0 <cmd_wtouchln+0x140>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdc1(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1070 <sscanf@plt>
cmp    $0x0,%rax
jne    127d <cmd_wtouchln+0x11d>
mov    $0x1,%edi
call   1060 <report_count@plt>
lea    0xd90(%rip),%rdi
call   1080 <report_error@plt>
jmp    12a0 <cmd_wtouchln+0x140>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1030 <wtouchln@plt>
mov    %eax,%edi
call   1040 <report_return@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_wtouchln>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    $0x4,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
je     1224 <cmd_wtouchln+0xc4>
mov    (%rbx),%rdi
lea    0xe7b(%rip),%rsi
lea    0x18(%rsp),%rdx
call   1070 <sscanf@plt>
test   %rax,%rax
je     120e <cmd_wtouchln+0xae>
mov    0x8(%rbx),%rdi
lea    0xe71(%rip),%rsi
lea    0x14(%rsp),%rdx
call   1070 <sscanf@plt>
test   %rax,%rax
je     120e <cmd_wtouchln+0xae>
mov    0x10(%rbx),%rdi
lea    0xe57(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1070 <sscanf@plt>
test   %rax,%rax
je     120e <cmd_wtouchln+0xae>
mov    0x18(%rbx),%rdi
lea    0xe3d(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1070 <sscanf@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1060 <report_count@plt>
test   %rbx,%rbx
je     1218 <cmd_wtouchln+0xb8>
mov    0x18(%rsp),%rdi
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
call   1030 <wtouchln@plt>
mov    %eax,%edi
call   1040 <report_return@plt>
jmp    1224 <cmd_wtouchln+0xc4>
mov    $0x1,%edi
call   1060 <report_count@plt>
lea    0xde4(%rip),%rdi
call   1080 <report_error@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%p\00"
@.str.1 = [13 x i8] c"BAD ARGUMENT\00"
@.str.2 = [3 x i8] c"%d\00"
define void @cmd_wtouchln(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = load i32, i32* %3
%10 = call i32 @check_arg_count(i32 %9, i32 4)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %2
br label %58
13: ; preds = %2
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = bitcast i32** %5 to i32*
%18 = call i64 @sscanf(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %13
%21 = call i32 @report_count(i32 1)
%22 = call i32 @report_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %58
23: ; preds = %13
%24 = load i8**, i8*** %4
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @sscanf(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = call i32 @report_count(i32 1)
%31 = call i32 @report_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %58
32: ; preds = %23
%33 = load i8**, i8*** %4
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i64 @sscanf(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %32
%39 = call i32 @report_count(i32 1)
%40 = call i32 @report_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %58
41: ; preds = %32
%42 = load i8**, i8*** %4
%43 = getelementptr inbounds i8*, i8** %42, i64 3
%44 = load i8*, i8** %43
%45 = call i64 @sscanf(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %41
%48 = call i32 @report_count(i32 1)
%49 = call i32 @report_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %58
50: ; preds = %41
%51 = call i32 @report_count(i32 1)
%52 = load i32*, i32** %5
%53 = load i32, i32* %6
%54 = load i32, i32* %7
%55 = load i32, i32* %8
%56 = call i32 @wtouchln(i32* %52, i32 %53, i32 %54, i32 %55)
%57 = call i32 @report_return(i32 %56)
br label %58
58: ; preds = %50, %47, %38, %29, %20, %12
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
@.str.1 = [13 x i8] c"BAD ARGUMENT\00"
@.str.2 = [3 x i8] c"%d\00"
define void @cmd_wtouchln(i32 %0, i8** nocapture %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32** %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = tail call i32 @check_arg_count(i32 %0, i32 4)
%12 = icmp eq i32 %11, 1
br i1 %12, label %52, label %13
13: ; preds = %2
%14 = load i8*, i8** %1
%15 = bitcast i32** %3 to i32*
%16 = call i64 @sscanf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = call i32 @report_count(i32 1)
%20 = call i32 @report_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %52
21: ; preds = %13
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = call i32 @report_count(i32 1)
%28 = call i32 @report_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %52
29: ; preds = %21
%30 = getelementptr inbounds i8*, i8** %1, i64 2
%31 = load i8*, i8** %30
%32 = call i64 @sscanf(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = call i32 @report_count(i32 1)
%36 = call i32 @report_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %52
37: ; preds = %29
%38 = getelementptr inbounds i8*, i8** %1, i64 3
%39 = load i8*, i8** %38
%40 = call i64 @sscanf(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%41 = icmp eq i64 %40, 0
%42 = call i32 @report_count(i32 1)
br i1 %41, label %43, label %45
43: ; preds = %37
%44 = call i32 @report_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %52
45: ; preds = %37
%46 = load i32*, i32** %3
%47 = load i32, i32* %4
%48 = load i32, i32* %5
%49 = load i32, i32* %6
%50 = call i32 @wtouchln(i32* %46, i32 %47, i32 %48, i32 %49)
%51 = call i32 @report_return(i32 %50)
br label %52
52: ; preds = %2, %45, %43, %34, %26, %18
ret void
}