xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
char *timlib_trim_trailing_character(char *source_destination, char character) {
  char *end_ptr;
  end_ptr = source_destination + strlen(source_destination) - 1;
  if (*end_ptr == character)
    *end_ptr = '\0';
  return source_destination;
}


x86 assembly (clang, -O0):
<timlib_trim_trailing_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1161 <timlib_trim_trailing_character+0x51>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_trim_trailing_character>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmp    %bpl,-0x1(%rbx,%rax,1)
jne    112b <timlib_trim_trailing_character+0x1b>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @timlib_trim_trailing_character(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 -1
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %14, %16
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = load i8*, i8** %5
store i8 0, i8* %19
br label %20
20: ; preds = %18, %2
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @timlib_trim_trailing_character(i8* returned %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 -1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %1
br i1 %8, label %9, label %10
9: ; preds = %2
store i8 0, i8* %6
br label %10
10: ; preds = %9, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("CLOCK_PROCESS_CPUTIME_ID unsupported\n");
  return 4;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"CLOCK_PROCESS_CPUTIME_ID unsupported\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@str = [37 x i8] c"CLOCK_PROCESS_CPUTIME_ID unsupported\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_fast_convergence(void) {
  record_linux_param_description("tcp_bic.c", "fast_convergence",
                                 "turn on/off fast convergence");
}


x86 assembly (clang, -O0):
<module_param_desc_fast_convergence>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xef2(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_fast_convergence>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xef6(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"tcp_bic.c\00"
@.str.1 = [17 x i8] c"fast_convergence\00"
@.str.2 = [29 x i8] c"turn on/off fast convergence\00"
define void @module_param_desc_fast_convergence() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"tcp_bic.c\00"
@.str.1 = [17 x i8] c"fast_convergence\00"
@.str.2 = [29 x i8] c"turn on/off fast convergence\00"
define void @module_param_desc_fast_convergence() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}
long long int128max(void) {
  long long x = 9223372036854775807LL;
  x <<= 32;
  x <<= 32;
  x += 9223372036854775807LL;
  x += 9223372036854775807LL;
  x += 1;
  return x;
}


x86 assembly (clang, -O0):
<int128max>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x20,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x20,%rax
mov    %rax,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int128max>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @int128max() {
%1 = alloca i64
store i64 9223372036854775807, i64* %1
%2 = load i64, i64* %1
%3 = shl i64 %2, 32
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = shl i64 %4, 32
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = add nsw i64 %6, 9223372036854775807
store i64 %7, i64* %1
%8 = load i64, i64* %1
%9 = add nsw i64 %8, 9223372036854775807
store i64 %9, i64* %1
%10 = load i64, i64* %1
%11 = add nsw i64 %10, 1
store i64 %11, i64* %1
%12 = load i64, i64* %1
ret i64 %12
}

LLVM IR (-O2):
define i64 @int128max() {
ret i64 -1
}
/* Type definitions */
typedef char uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
uint64_t hash(char *key) {
  uint64_t hash = 14695981039346656037u;
  assert(key != NULL);
  while (*key) {
    hash ^= *key;
    hash *= 1099511628211u;
    key++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x25,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1176 <hash+0x66>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x9(%rbp)
movsbq -0x9(%rbp),%rax
movabs $0x100000001b3,%rcx
imul   %rcx,%rax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <hash+0x22>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     1145 <hash+0x35>
add    $0x1,%rbx
mov    $0x25,%al
xchg   %ax,%ax
xor    %al,%cl
movzbl %cl,%eax
imul   $0xffffffb3,%eax,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <hash+0x20>
pop    %rbx
ret
mov    $0x25,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 37, i8* %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
br label %8
8: ; preds = %12, %1
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = xor i32 %17, %15
%19 = trunc i32 %18 to i8
store i8 %19, i8* %3
%20 = load i8, i8* %3
%21 = sext i8 %20 to i64
%22 = mul i64 %21, 1099511628211
%23 = trunc i64 %22 to i8
store i8 %23, i8* %3
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %2
br label %8
26: ; preds = %8
%27 = load i8, i8* %3
ret i8 %27
}

LLVM IR (-O2):
define signext i8 @hash(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1, %7
%8 = phi i8 [ %14, %7 ], [ %5, %1 ]
%9 = phi i8 [ %12, %7 ], [ 37, %1 ]
%10 = phi i8* [ %13, %7 ], [ %0, %1 ]
%11 = xor i8 %8, %9
%12 = mul i8 %11, -77
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %1
%17 = phi i8 [ 37, %1 ], [ %12, %7 ]
ret i8 %17
}
void INT_Excep_SCI0_TEI0(void) {}


x86 assembly (clang, -O0):
<INT_Excep_SCI0_TEI0>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_Excep_SCI0_TEI0>:
ret

LLVM IR (-O0):
define void @INT_Excep_SCI0_TEI0() {
ret void
}

LLVM IR (-O2):
define void @INT_Excep_SCI0_TEI0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void handle_sighup(int signum) { system("netconfig restart"); }


x86 assembly (clang, -O0):
<handle_sighup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sighup>:
lea    0xee9(%rip),%rdi
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"netconfig restart\00"
define void @handle_sighup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"netconfig restart\00"
define void @handle_sighup(i32 %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_fmt(char *, char *, size_t);
void log_size(char *name, size_t v) { log_fmt(name, "%zu", v); }


x86 assembly (clang, -O0):
<log_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <log_fmt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_size>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <log_fmt@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%zu\00"
define void @log_size(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @log_fmt(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%zu\00"
define void @log_size(i8* %0, i64 %1) {
%3 = tail call i32 @log_fmt(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %1)
ret void
}
int Media_GetMediaTime() {
  int ptime = 0;
  return ptime;
}


x86 assembly (clang, -O0):
<Media_GetMediaTime>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Media_GetMediaTime>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Media_GetMediaTime() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @Media_GetMediaTime() {
ret i32 0
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
unsigned char Termios2TncomStopSize(struct termios *);
int /*<<< orphan*/ tcgetattr(int, struct termios *);
unsigned char GetPortStopSize(int PortFd) {
  struct termios PortSettings;
  tcgetattr(PortFd, &PortSettings);
  return Termios2TncomStopSize(&PortSettings);
}


x86 assembly (clang, -O0):
<GetPortStopSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <tcgetattr@plt>
lea    -0x8(%rbp),%rdi
call   1030 <Termios2TncomStopSize@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPortStopSize>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <tcgetattr@plt>
mov    %rbx,%rdi
call   1030 <Termios2TncomStopSize@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define zeroext i8 @GetPortStopSize(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.termios
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @tcgetattr(i32 %4, %struct.termios* %3)
%6 = call zeroext i8 @Termios2TncomStopSize(%struct.termios* %3)
ret i8 %6
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define zeroext i8 @GetPortStopSize(i32 %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = call i32 @tcgetattr(i32 %0, %struct.termios* %2)
%5 = call zeroext i8 @Termios2TncomStopSize(%struct.termios* %2)
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ scrputs(char *);
void scrclrup(void) { scrputs("\033[0J"); }


x86 assembly (clang, -O0):
<scrclrup>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <scrputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrclrup>:
lea    0xee9(%rip),%rdi
jmp    1030 <scrputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0J\00"
define void @scrclrup() {
%1 = call i32 @scrputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0J\00"
define void @scrclrup() {
%1 = tail call i32 @scrputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ date_ge(int, int, int, int, int, int);
int date_lt(int year, int month, int day, int y2, int m2, int d2) {
  return (!date_ge(year, month, day, y2, m2, d2));
}


x86 assembly (clang, -O0):
<date_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <date_ge@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_lt>:
push   %rax
call   1030 <date_ge@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @date_lt(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @date_ge(i32 %13, i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @date_lt(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @date_ge(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
double modf(double, double *);
double frapart(double param) {
  double intpart;
  double fracpart = modf(param, &intpart);
  return fracpart;
}


x86 assembly (clang, -O0):
<frapart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frapart>:
push   %rax
mov    %rsp,%rdi
call   1030 <modf@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @frapart(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @modf(double %5, double* %3)
store double %6, double* %4
%7 = load double, double* %4
ret double %7
}

LLVM IR (-O2):
define double @frapart(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call double @modf(double %0, double* %2)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void generate_timeString(time_t timer, char *output) {
  struct tm *tm_info = localtime(&timer);
  strftime(output, 32, "%a, %e %b %G %T GTM+1", tm_info);
}


x86 assembly (clang, -O0):
<generate_timeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x20,%esi
lea    0xeb0(%rip),%rdx
call   1040 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_timeString>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [22 x i8] c"%a, %e %b %G %T GTM+1\00"
define void @generate_timeString(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.tm*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %5
%7 = load i8*, i8** %4
%8 = load %struct.tm*, %struct.tm** %5
%9 = call i32 @strftime(i8* %7, i32 32, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [22 x i8] c"%a, %e %b %G %T GTM+1\00"
define void @generate_timeString(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call %struct.tm* @localtime(i32* %3)
%5 = call i32 @strftime(i8* %1, i32 32, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret void
}
__attribute__((always_)) int is_normal_idx(int idx) { return (idx == 1); }


x86 assembly (clang, -O0):
<is_normal_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_normal_idx>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_normal_idx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_normal_idx(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void doubt_faith(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 150)) {
    add_status(target, 14);
  }
}


x86 assembly (clang, -O0):
<doubt_faith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x96,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1180 <doubt_faith+0x50>
mov    -0x10(%rbp),%rdi
mov    $0xe,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubt_faith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x96,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    1171 <doubt_faith+0x41>
mov    %r14,%rdi
mov    $0xe,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @doubt_faith(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 150)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 14)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @doubt_faith(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 150)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 14)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float const *, int);
void glmCopyMatrix2f(const float source[4], float target[4]) {
  memcpy(target, source, 4 * sizeof(float));
}


x86 assembly (clang, -O0):
<glmCopyMatrix2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmCopyMatrix2f>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x10,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @glmCopyMatrix2f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = load float*, float** %3
%7 = call i32 @memcpy(float* %5, float* %6, i32 16)
ret void
}

LLVM IR (-O2):
define void @glmCopyMatrix2f(float* %0, float* %1) {
%3 = tail call i32 @memcpy(float* %1, float* %0, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void Welcome() {
  printf("Welcome to %s, version %s\n\n", "WiFi Mesh Simulator Pro", "1.1.3");
}


x86 assembly (clang, -O0):
<Welcome>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xefa(%rip),%rsi
lea    0xf0b(%rip),%rdx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Welcome>:
lea    0xee9(%rip),%rdi
lea    0xefe(%rip),%rsi
lea    0xf0f(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Welcome to %s, version %s\0A\0A\00"
@.str.1 = [24 x i8] c"WiFi Mesh Simulator Pro\00"
@.str.2 = [6 x i8] c"1.1.3\00"
define void @Welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Welcome to %s, version %s\0A\0A\00"
@.str.1 = [24 x i8] c"WiFi Mesh Simulator Pro\00"
@.str.2 = [6 x i8] c"1.1.3\00"
define void @Welcome() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
unsigned long FanChannelDutyGet(unsigned long ulBase, unsigned long ulChannel) {
  unsigned long ulDuty;
  ;
  ;
  ulDuty = (*((volatile unsigned long *)(ulBase + 0x00000014 +
                                         (ulChannel * 0x10)))) &
           0x01FF0000;
  ulDuty >>= 16;
  return (ulDuty);
}


x86 assembly (clang, -O0):
<FanChannelDutyGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    -0x10(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
and    $0x1ff0000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x10,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanChannelDutyGet>:
shl    $0x4,%rsi
mov    0x14(%rdi,%rsi,1),%rax
shr    $0x10,%eax
and    $0x1ff,%eax
ret

LLVM IR (-O0):
define i64 @FanChannelDutyGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 20
%8 = load i64, i64* %4
%9 = mul i64 %8, 16
%10 = add i64 %7, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 33488896
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = lshr i64 %14, 16
store i64 %15, i64* %5
%16 = load i64, i64* %5
ret i64 %16
}

LLVM IR (-O2):
define i64 @FanChannelDutyGet(i64 %0, i64 %1) {
%3 = add i64 %0, 20
%4 = shl i64 %1, 4
%5 = add i64 %3, %4
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = lshr i64 %7, 16
%9 = and i64 %8, 511
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ n32016_get_startpc();
uint32_t dbg_get_instr_addr() { return n32016_get_startpc(); }


x86 assembly (clang, -O0):
<dbg_get_instr_addr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <n32016_get_startpc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_get_instr_addr>:
xor    %eax,%eax
jmp    1030 <n32016_get_startpc@plt>

LLVM IR (-O0):
define i32 @dbg_get_instr_addr() {
%1 = call i32 (...) @n32016_get_startpc()
ret i32 %1
}

LLVM IR (-O2):
define i32 @dbg_get_instr_addr() {
%1 = tail call i32 (...) @n32016_get_startpc()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Z_FreeAll();
void Qcommon_Shutdown(void) { Z_FreeAll(); }


x86 assembly (clang, -O0):
<Qcommon_Shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Z_FreeAll@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qcommon_Shutdown>:
xor    %eax,%eax
jmp    1030 <Z_FreeAll@plt>

LLVM IR (-O0):
define void @Qcommon_Shutdown() {
%1 = call i32 (...) @Z_FreeAll()
ret void
}

LLVM IR (-O2):
define void @Qcommon_Shutdown() {
%1 = tail call i32 (...) @Z_FreeAll()
ret void
}
float mult(float x, float y) { return x * y; }


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mult(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @mult(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
int MPI_Comm_c2f(int comm) { return comm; }


x86 assembly (clang, -O0):
<MPI_Comm_c2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Comm_c2f>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @MPI_Comm_c2f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @MPI_Comm_c2f(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test(int M) {
  int i;
  for (i = 0; i <= M + 1; i++) {
    {
      hash(1);
      hash(i);
    };
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1153 <test+0x43>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <test+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
cmp    $0xffffffff,%edi
jl     1138 <test+0x28>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
nop
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <test+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @test(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = icmp sle i32 %5, %7
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = call i32 @hash(i32 1)
%11 = load i32, i32* %3
%12 = call i32 @hash(i32 %11)
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @test(i32 %0) {
%2 = icmp slt i32 %0, -1
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = add i32 %0, 1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = tail call i32 @hash(i32 1)
%8 = tail call i32 @hash(i32 %6)
%9 = add nuw i32 %6, 1
%10 = icmp eq i32 %6, %4
br i1 %10, label %11, label %5
11: ; preds = %5, %1
ret void
}
int dns_v_abi(void) { return 0x20121013; }


x86 assembly (clang, -O0):
<dns_v_abi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20121013,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_v_abi>:
mov    $0x20121013,%eax
ret

LLVM IR (-O0):
define i32 @dns_v_abi() {
ret i32 538054675
}

LLVM IR (-O2):
define i32 @dns_v_abi() {
ret i32 538054675
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void pchar(char c) { putchar(c); }


x86 assembly (clang, -O0):
<pchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pchar>:
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @pchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @putchar(i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @pchar(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
/* Type definitions */
struct ifconf {
  int dummy;
};
typedef int /*<<< orphan*/ ifc;

/* Variables and functions */
int main(void) {
  struct ifconf ifc = {};
  (void)ifc;
  return sizeof(ifc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    $0x4,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x4,%eax
ret

LLVM IR (-O0):
%struct.ifconf = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.ifconf
store i32 0, i32* %1
%3 = bitcast %struct.ifconf* %2 to i8*
ret i32 4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
void azt_bin2bcd(unsigned char *p) {
  int u;
  int t;
  {
    u = (int)*p % 10;
    t = (int)*p / 10;
    *p = (unsigned char)(u | (t << 4));
    return;
  }
}


x86 assembly (clang, -O0):
<azt_bin2bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<azt_bin2bcd>:
movzbl (%rdi),%eax
imul   $0xcd,%eax,%ecx
shr    $0xb,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%al
shl    $0x4,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @azt_bin2bcd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = srem i32 %7, 10
store i32 %8, i32* %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = sdiv i32 %11, 10
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = shl i32 %14, 4
%16 = or i32 %13, %15
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %2
store i8 %17, i8* %18
ret void
}

LLVM IR (-O2):
define void @azt_bin2bcd(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = urem i8 %2, 10
%4 = udiv i8 %2, 10
%5 = shl i8 %4, 4
%6 = or i8 %5, %3
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int statement(int);
int statement_list() {
  int count = 0;
  while (statement(count + 2) == 1) {
    count++;
  }
  if (count <= 0) {
    printf("Must have at least 1 statement\n");
  }
  return count;
}


x86 assembly (clang, -O0):
<statement_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1030 <statement@plt>
cmp    $0x1,%eax
jne    1151 <statement_list+0x31>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <statement_list+0xf>
cmpl   $0x0,-0x4(%rbp)
jg     1167 <statement_list+0x47>
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statement_list>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    0x3(%rbx),%edi
call   1040 <statement@plt>
add    $0x1,%ebx
cmp    $0x1,%eax
je     1130 <statement_list+0x10>
test   %ebx,%ebx
jne    1150 <statement_list+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Must have at least 1 statement\0A\00"
define i32 @statement_list() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 2
%5 = call i32 @statement(i32 %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = load i32, i32* %1
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@str = [31 x i8] c"Must have at least 1 statement\00"
define i32 @statement_list() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = add nuw nsw i32 %2, 2
%4 = tail call i32 @statement(i32 %3)
%5 = icmp eq i32 %4, 1
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = icmp eq i32 %2, 0
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
int main() {
  printf("Before sleep\n");
  usleep(500);
  printf("After sleep\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1f4,%edi
call   1040 <usleep@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1f4,%edi
call   1040 <usleep@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Before sleep\0A\00"
@.str.1 = [13 x i8] c"After sleep\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @usleep(i32 500)
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Before sleep\00"
@str.2 = [12 x i8] c"After sleep\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @usleep(i32 500)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void ThreadError() {
  fprintf(stderr, "\nError: worker thread could not be created or joined.");
  fprintf(stderr, "\nTerminating program.");
  exit(0);
}


x86 assembly (clang, -O0):
<ThreadError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeed(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ThreadError>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"\0AError: worker thread could not be created or joined.\00"
@.str.1 = [22 x i8] c"\0ATerminating program.\00"
define void @ThreadError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"\0AError: worker thread could not be created or joined.\00"
@.str.1 = [22 x i8] c"\0ATerminating program.\00"
define void @ThreadError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_1Eint16_reg(short val) {
  return ((val) & (0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x1e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Eint16_reg>:
test   $0x1e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Eint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 30
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_1Eint16_reg(i16 signext %0) {
%2 = and i16 %0, 30
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int __byte(int *, int /*<<< orphan*/);
bool UARTSpaceAvail(uint32_t ui32Base) {
  ;
  return ((__byte((int *)(ui32Base + 0x4), 0) & 0x80) ? true : false);
}


x86 assembly (clang, -O0):
<UARTSpaceAvail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
mov    %eax,%edx
and    $0x80,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTSpaceAvail>:
push   %rax
add    $0x4,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
shr    $0x7,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @UARTSpaceAvail(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
%5 = inttoptr i64 %4 to i32*
%6 = call i32 @__byte(i32* %5, i32 0)
%7 = and i32 %6, 128
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @UARTSpaceAvail(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @__byte(i32* %3, i32 0)
%5 = lshr i32 %4, 7
%6 = and i32 %5, 1
ret i32 %6
}
char const *pubnub_sdk_name(void) { return "Microchip.Harmony"; }


x86 assembly (clang, -O0):
<pubnub_sdk_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pubnub_sdk_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Microchip.Harmony\00"
define i8* @pubnub_sdk_name() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"Microchip.Harmony\00"
define i8* @pubnub_sdk_name() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
void __cpuid(int dst[4], int ax) {
  asm volatile("cpuid"
               : "=a"(dst[0]), "=b"(dst[1]), "=c"(dst[2]), "=d"(dst[3])
               : "0"(ax));
}


x86 assembly (clang, -O0):
<__cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%r8
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cpuid>:
push   %rbx
mov    %esi,%eax
cpuid
mov    %eax,(%rdi)
mov    %ebx,0x4(%rdi)
mov    %ecx,0x8(%rdi)
mov    %edx,0xc(%rdi)
pop    %rbx
ret

LLVM IR (-O0):
define void @__cpuid(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %4
%14 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %13)
%15 = extractvalue { i32, i32, i32, i32 } %14, 0
%16 = extractvalue { i32, i32, i32, i32 } %14, 1
%17 = extractvalue { i32, i32, i32, i32 } %14, 2
%18 = extractvalue { i32, i32, i32, i32 } %14, 3
store i32 %15, i32* %6
store i32 %16, i32* %8
store i32 %17, i32* %10
store i32 %18, i32* %12
ret void
}

LLVM IR (-O2):
define void @__cpuid(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %1)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %0
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cduck_command_print_usage();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_usage_and_exit(const char *invocation) {
  printf("Usage: %s [command] [arguments]\n", invocation);
  printf("Available commands:\n");
  cduck_command_print_usage();
  printf("\n");
  exit(0);
}


x86 assembly (clang, -O0):
<print_usage_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <cduck_command_print_usage@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage_and_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1040 <cduck_command_print_usage@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: %s [command] [arguments]\0A\00"
@.str.1 = [21 x i8] c"Available commands:\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_usage_and_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @cduck_command_print_usage()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: %s [command] [arguments]\0A\00"
@str = [20 x i8] c"Available commands:\00"
define void @print_usage_and_exit(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @cduck_command_print_usage()
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct sched_param {
  int sched_priority;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int SCHED_FIFO;
int SCHED_OTHER;
int sched_setscheduler(int /*<<< orphan*/, int, struct sched_param *);
int set_thread_prio(pid_t pid, int prio) {
  struct sched_param sp = {.sched_priority = prio};
  int policy = SCHED_FIFO;
  if (!prio)
    policy = SCHED_OTHER;
  return sched_setscheduler(pid, policy, &sp);
}


x86 assembly (clang, -O0):
<set_thread_prio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1146 <set_thread_prio+0x36>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_thread_prio>:
push   %rax
mov    %esi,(%rsp)
test   %esi,%esi
jne    1121 <set_thread_prio+0x11>
mov    0x2eb9(%rip),%rax
jmp    1128 <set_thread_prio+0x18>
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <sched_setscheduler@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
@SCHED_OTHER = global i32 0
define i32 @set_thread_prio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sched_param
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %5, i32 0, i32 0
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i32, i32* @SCHED_FIFO
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = load i32, i32* @SCHED_OTHER
store i32 %13, i32* %6
br label %14
14: ; preds = %12, %2
%15 = load i32, i32* %3
%16 = load i32, i32* %6
%17 = call i32 @sched_setscheduler(i32 %15, i32 %16, %struct.sched_param* %5)
ret i32 %17
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
@SCHED_OTHER = global i32 0
define i32 @set_thread_prio(i32 %0, i32 %1) {
%3 = alloca %struct.sched_param
%4 = bitcast %struct.sched_param* %3 to i8*
%5 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = icmp eq i32 %1, 0
%7 = load i32, i32* @SCHED_OTHER
%8 = load i32, i32* @SCHED_FIFO
%9 = select i1 %6, i32 %7, i32 %8
%10 = call i32 @sched_setscheduler(i32 %0, i32 %9, %struct.sched_param* %3)
ret i32 %10
}