#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 */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ pulseOrSaveTS(int, struct timespec *, struct timespec *);
void pulseMicro(int gpio, int up, int down) {
  struct timespec tsUP, tsDOWN;
  tsUP.tv_sec = 0;
  tsUP.tv_nsec = up * 1000;
  tsDOWN.tv_sec = 0;
  tsDOWN.tv_nsec = down * 1000;
  pulseOrSaveTS(gpio, &tsUP, &tsDOWN);
}


x86 assembly (clang, -O0):
<pulseMicro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
imul   $0x3e8,-0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <pulseOrSaveTS@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pulseMicro>:
sub    $0x28,%rsp
movq   $0x0,0x20(%rsp)
imul   $0x3e8,%esi,%eax
mov    %eax,0x18(%rsp)
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%edx,%eax
mov    %eax,0x8(%rsp)
lea    0x18(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <pulseOrSaveTS@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @pulseMicro(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.timespec
%8 = alloca %struct.timespec
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i64 0, i64* %9
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 1000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
store i32 %11, i32* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
store i64 0, i64* %13
%14 = load i32, i32* %6
%15 = mul nsw i32 %14, 1000
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
store i32 %15, i32* %16
%17 = load i32, i32* %4
%18 = call i32 @pulseOrSaveTS(i32 %17, %struct.timespec* %7, %struct.timespec* %8)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @pulseMicro(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.timespec
%5 = alloca %struct.timespec
%6 = bitcast %struct.timespec* %4 to i8*
%7 = bitcast %struct.timespec* %5 to i8*
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
store i64 0, i64* %8
%9 = mul nsw i32 %1, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
store i32 %9, i32* %10
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 1
store i64 0, i64* %11
%12 = mul nsw i32 %2, 1000
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 0
store i32 %12, i32* %13
%14 = call i32 @pulseOrSaveTS(i32 %0, %struct.timespec* %4, %struct.timespec* %5)
ret void
}