#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 ESCDELAY;
int atoi(char *);
int /*<<< orphan*/ debug(char *, char *);
int /*<<< orphan*/ output_message(char *, char *, int, char *);
void cmd_delay(int argc, char *argv[]) {
  int delay = atoi(argv[1]);
  ESCDELAY = delay;
  output_message("(%s) "
                 "Esc delay changed to %d ms"
                 " (%s)",
                 argv[0], delay, argv[0]);
  debug("Delay changed to %s milliseconds", argv[1]);
}


x86 assembly (clang, -O0):
<cmd_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    0x2e87(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xe8d(%rip),%rdi
call   1050 <output_message@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <debug@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_delay>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    0x2e9c(%rip),%rcx
mov    %eax,(%rcx)
mov    (%rbx),%rcx
lea    0xeb0(%rip),%rdi
mov    %rcx,%rsi
mov    %eax,%edx
call   1050 <output_message@plt>
mov    0x8(%rbx),%rsi
lea    0xec0(%rip),%rdi
pop    %rbx
jmp    1030 <debug@plt>

LLVM IR (-O0):
@ESCDELAY = global i32 0
@.str = [37 x i8] c"(%s) Esc delay changed to %d ms (%s)\00"
@.str.1 = [33 x i8] c"Delay changed to %s milliseconds\00"
define void @cmd_delay(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
store i32 %10, i32* @ESCDELAY
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = load i32, i32* %5
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 @output_message(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i8* %17)
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @debug(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %21)
ret void
}

LLVM IR (-O2):
@ESCDELAY = global i32 0
@.str = [37 x i8] c"(%s) Esc delay changed to %d ms (%s)\00"
@.str.1 = [33 x i8] c"Delay changed to %s milliseconds\00"
define void @cmd_delay(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
store i32 %5, i32* @ESCDELAY
%6 = load i8*, i8** %1
%7 = tail call i32 @output_message(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %5, i8* %6)
%8 = load i8*, i8** %3
%9 = tail call i32 @debug(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}