#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 getCmdIdx(int);
int /*<<< orphan*/ snmp(int, int, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void setReset(int ii) {
  int idx = getCmdIdx(ii);
  char cmd[140] = "\0", cmdRes[140] = "\0";
  sprintf(cmd, "outputSwitch.u%i i %i", idx, 10);
  snmp(1, ii, cmd, cmdRes);
  return;
}


x86 assembly (clang, -O0):
<setReset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <getCmdIdx@plt>
mov    %eax,-0x8(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x8c,%edx
call   1030 <memset@plt>
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x8c,%edx
call   1030 <memset@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xe70(%rip),%rsi
mov    $0xa,%ecx
call   1060 <sprintf@plt>
mov    -0x4(%rbp),%esi
lea    -0xa0(%rbp),%rdx
lea    -0x130(%rbp),%rcx
mov    $0x1,%edi
call   1040 <snmp@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setReset>:
push   %r14
push   %rbx
sub    $0x128,%rsp
mov    %edi,%ebx
call   1040 <getCmdIdx@plt>
xorps  %xmm0,%xmm0
movups %xmm0,0x10c(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movups %xmm0,0x7c(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xe41(%rip),%rsi
lea    0x90(%rsp),%r14
mov    %r14,%rdi
mov    %eax,%edx
mov    $0xa,%ecx
call   1050 <sprintf@plt>
mov    %rsp,%rcx
mov    $0x1,%edi
mov    %ebx,%esi
mov    %r14,%rdx
call   1030 <snmp@plt>
add    $0x128,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"outputSwitch.u%i i %i\00"
define void @setReset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [140 x i8]
%5 = alloca [140 x i8]
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @getCmdIdx(i32 %6)
store i32 %7, i32* %3
%8 = bitcast [140 x i8]* %4 to i8*
%9 = bitcast [140 x i8]* %5 to i8*
%10 = getelementptr inbounds [140 x i8], [140 x i8]* %4, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %11, i32 10)
%13 = load i32, i32* %2
%14 = getelementptr inbounds [140 x i8], [140 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [140 x i8], [140 x i8]* %5, i64 0, i64 0
%16 = call i32 @snmp(i32 1, i32 %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"outputSwitch.u%i i %i\00"
define void @setReset(i32 %0) {
%2 = alloca [140 x i8]
%3 = alloca [140 x i8]
%4 = tail call i32 @getCmdIdx(i32 %0)
%5 = getelementptr inbounds [140 x i8], [140 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [140 x i8], [140 x i8]* %3, i64 0, i64 0
%7 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4, i32 10)
%8 = call i32 @snmp(i32 1, i32 %0, i8* %5, i8* %6)
ret void
}