#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*/ lcdClear();
int /*<<< orphan*/ lcdSetPos(int /*<<< orphan*/, int);
int /*<<< orphan*/ lcdWriteStrC(char *);
int readLight();
double readTempF();
int /*<<< orphan*/ sprintf(char *, char *, int);
void showTempLight(void) {
  char buffer[10];
  lcdClear();
  lcdSetPos(0, 0);
  sprintf(buffer, "temp: %1.3f", readTempF());
  lcdWriteStrC(buffer);
  lcdSetPos(0, 1);
  sprintf(buffer, "light: %d", readLight());
  lcdWriteStrC(buffer);
}


x86 assembly (clang, -O0):
<showTempLight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1080 <lcdClear@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <lcdSetPos@plt>
lea    -0xa(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <readTempF@plt>
mov    -0x20(%rbp),%rdi
cvttsd2si %xmm0,%edx
lea    0xe6a(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0xa(%rbp),%rdi
call   1040 <lcdWriteStrC@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <lcdSetPos@plt>
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <readLight@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xe40(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0xa(%rbp),%rdi
call   1040 <lcdWriteStrC@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showTempLight>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1080 <lcdClear@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <lcdSetPos@plt>
xor    %eax,%eax
call   1060 <readTempF@plt>
cvttsd2si %xmm0,%edx
lea    0xe79(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <lcdWriteStrC@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <lcdSetPos@plt>
xor    %eax,%eax
call   1050 <readLight@plt>
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <lcdWriteStrC@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"temp: %1.3f\00"
@.str.1 = [10 x i8] c"light: %d\00"
define void @showTempLight() {
%1 = alloca [10 x i8]
%2 = call i32 (...) @lcdClear()
%3 = call i32 @lcdSetPos(i32 0, i32 0)
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call double (...) @readTempF()
%6 = fptosi double %5 to i32
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%9 = call i32 @lcdWriteStrC(i8* %8)
%10 = call i32 @lcdSetPos(i32 0, i32 1)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%12 = call i32 (...) @readLight()
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%15 = call i32 @lcdWriteStrC(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"temp: %1.3f\00"
@.str.1 = [10 x i8] c"light: %d\00"
define void @showTempLight() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @lcdClear()
%4 = tail call i32 @lcdSetPos(i32 0, i32 0)
%5 = tail call double (...) @readTempF()
%6 = fptosi double %5 to i32
%7 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @lcdWriteStrC(i8* %2)
%9 = call i32 @lcdSetPos(i32 0, i32 1)
%10 = call i32 (...) @readLight()
%11 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @lcdWriteStrC(i8* %2)
ret void
}