#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 atoi(char *);
int print_color(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
void module_cpu_temp(char *s, char *conky) {
  int temp = atoi(conky);
  if (temp >= 60)
    sprintf(s, "%s%s", s, print_color("FF0000"));
  else
    sprintf(s, "%s%s", s, print_color(NULL));
  sprintf(s, "%s%d°C", s, temp);
}


x86 assembly (clang, -O0):
<module_cpu_temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3c,-0x14(%rbp)
jl     118d <module_cpu_temp+0x5d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xe98(%rip),%rdi
call   1050 <print_color@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
lea    0xe7d(%rip),%rsi
call   1040 <sprintf@plt>
jmp    11bc <module_cpu_temp+0x8c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <print_color@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    %eax,%ecx
lea    0xe49(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe3e(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_cpu_temp>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <atoi@plt>
mov    %eax,%ebp
xor    %edi,%edi
cmp    $0x3c,%eax
lea    0xeb9(%rip),%rax
cmovge %rax,%rdi
call   1050 <print_color@plt>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1040 <sprintf@plt>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
mov    %rbx,%rdx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [7 x i8] c"FF0000\00"
@.str.2 = [8 x i8] c"%s%d\C2\B0C\00"
define void @module_cpu_temp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @atoi(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 60
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @print_color(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
br label %20
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = load i8*, i8** %3
%18 = call i32 @print_color(i8* null)
%19 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18)
br label %20
20: ; preds = %15, %10
%21 = load i8*, i8** %3
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %22, i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [7 x i8] c"FF0000\00"
@.str.2 = [8 x i8] c"%s%d\C2\B0C\00"
define void @module_cpu_temp(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %1)
%4 = icmp sgt i32 %3, 59
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* null
%6 = tail call i32 @print_color(i8* %5)
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %6)
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32 %3)
ret void
}