xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dprintf(int, char *, char *);
int /*<<< orphan*/ exit(int);
void usage(char *argv0) {
  dprintf(2,
          "%s — hex escaper\n"
          "escapes only unprintable characters.\n"
          "works only on stdin, at the moment.\n\n"
          "  -a   escape all characters\n"
          "  -t   escape tabs\n"
          "  -n   escape newlines\n"
          "  -r   escape carriage returns\n"
          "  -s   escape spaces\n"
          "  -i   escape ansi\n"
          "  -u   urlencode\n"
          "  -o   octal\n"
          "  -H   html encoding\n"
          "  -N   no named escapes, just char codes\n"
          "  -w   no whitespace (analogous to -tnrs)\n"
          "  -h   this lovely help\n",
          argv0);
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xec4(%rip),%rsi
call   1030 <dprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
lea    0xed5(%rip),%rsi
mov    $0x2,%edi
call   1030 <dprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [394 x i8] c"%s \E2\80\94 hex escaper\0Aescapes only unprintable characters.\0Aworks only on stdin, at the moment.\0A\0A -a escape all characters\0A -t escape tabs\0A -n escape newlines\0A -r escape carriage returns\0A -s escape spaces\0A -i escape ansi\0A -u urlencode\0A -o octal\0A -H html encoding\0A -N no named escapes, just char codes\0A -w no whitespace (analogous to -tnrs)\0A -h this lovely help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @dprintf(i32 2, i8* getelementptr inbounds ([394 x i8], [394 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [394 x i8] c"%s \E2\80\94 hex escaper\0Aescapes only unprintable characters.\0Aworks only on stdin, at the moment.\0A\0A -a escape all characters\0A -t escape tabs\0A -n escape newlines\0A -r escape carriage returns\0A -s escape spaces\0A -i escape ansi\0A -u urlencode\0A -o octal\0A -H html encoding\0A -N no named escapes, just char codes\0A -w no whitespace (analogous to -tnrs)\0A -h this lovely help\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @dprintf(i32 2, i8* getelementptr inbounds ([394 x i8], [394 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _audio_ic_write(unsigned int);
void audio_ic_write(unsigned cmd) { _audio_ic_write(cmd); }


x86 assembly (clang, -O0):
<audio_ic_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_audio_ic_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_ic_write>:
jmp    1030 <_audio_ic_write@plt>

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

LLVM IR (-O2):
define void @audio_ic_write(i32 %0) {
%2 = tail call i32 @_audio_ic_write(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void rrn_usleep(unsigned long msecs) {
  if (msecs > 1)
    usleep((msecs - 1) * 1000);
}


x86 assembly (clang, -O0):
<rrn_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jbe    113b <rrn_usleep+0x2b>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
imul   $0x3e8,%rax,%rdi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrn_usleep>:
cmp    $0x2,%rdi
jb     1129 <rrn_usleep+0x19>
imul   $0x3e8,%rdi,%rdi
add    $0xfffffffffffffc18,%rdi
jmp    1030 <usleep@plt>
ret

LLVM IR (-O0):
define void @rrn_usleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ugt i64 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub i64 %6, 1
%8 = mul i64 %7, 1000
%9 = call i32 @usleep(i64 %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @rrn_usleep(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = mul i64 %0, 1000
%5 = add i64 %4, -1000
%6 = tail call i32 @usleep(i64 %5)
br label %7
7: ; preds = %3, %1
ret void
}
void cond_dummy_print(const struct XCSF *xcsf, const struct Cl *c) {
  (void)xcsf;
  (void)c;
}


x86 assembly (clang, -O0):
<cond_dummy_print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_print(%struct.XCSF* %0, %struct.Cl* %1) {
%3 = alloca %struct.XCSF*
%4 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %3
store %struct.Cl* %1, %struct.Cl** %4
%5 = load %struct.XCSF*, %struct.XCSF** %3
%6 = load %struct.Cl*, %struct.Cl** %4
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_print(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ grub_isspace(int);
int grub_iswordseparator(int c) {
  return (grub_isspace(c) || c == ',' || c == ';' || c == '|' || c == '&');
}


x86 assembly (clang, -O0):
<grub_iswordseparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <grub_isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116c <grub_iswordseparator+0x5c>
mov    $0x1,%al
cmpl   $0x2c,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <grub_iswordseparator+0x5c>
mov    $0x1,%al
cmpl   $0x3b,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <grub_iswordseparator+0x5c>
mov    $0x1,%al
cmpl   $0x7c,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <grub_iswordseparator+0x5c>
cmpl   $0x26,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grub_iswordseparator>:
push   %rbx
mov    %edi,%ebx
call   1030 <grub_isspace@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <grub_iswordseparator+0x17>
pop    %rbx
ret
cmp    $0x2c,%ebx
je     1125 <grub_iswordseparator+0x15>
cmp    $0x3b,%ebx
je     1125 <grub_iswordseparator+0x15>
cmp    $0x7c,%ebx
je     1125 <grub_iswordseparator+0x15>
xor    %eax,%eax
cmp    $0x26,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @grub_iswordseparator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @grub_isspace(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 44
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 59
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 124
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 38
br label %18
18: ; preds = %15, %12, %9, %6, %1
%19 = phi i1 [ true, %12 ], [ true, %9 ], [ true, %6 ], [ true, %1 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @grub_iswordseparator(i32 %0) {
%2 = tail call i64 @grub_isspace(i32 %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i32 %0, label %6 [
i32 124, label %9
i32 59, label %9
i32 44, label %9
]
6: ; preds = %5
%7 = icmp eq i32 %0, 38
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ], [ 1, %5 ]
ret i32 %10
}
call_program(p) char *p;
{ return (system(p)); }


x86 assembly (clang, -O0):
<call_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call_program(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @call_program(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __set_bit(unsigned long, unsigned long *);
void set_bit_string(unsigned long *bitmap, unsigned long i, int len) {
  unsigned long end = i + len;
  while (i < end) {
    __set_bit(i, bitmap);
    i++;
  }
}


x86 assembly (clang, -O0):
<set_bit_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    115e <set_bit_string+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <__set_bit@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1132 <set_bit_string+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_string>:
push   %r15
push   %r14
push   %rbx
movslq %edx,%r15
lea    (%r15,%rsi,1),%rax
cmp    %rsi,%rax
jbe    1145 <set_bit_string+0x35>
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <__set_bit@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <set_bit_string+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @set_bit_string(i64* %0, i64 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = add i64 %4, %1
%6 = icmp ugt i64 %5, %1
br i1 %6, label %7, label %12
7: ; preds = %3, %7
%8 = phi i64 [ %10, %7 ], [ %1, %3 ]
%9 = tail call i32 @__set_bit(i64 %8, i64* %0)
%10 = add i64 %8, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %7
12: ; preds = %7, %3
ret void
}
unsigned short speaker_Hz_to_period(unsigned Hz) {
  unsigned short period;
  period = (Hz > 18) ? (1193180U / Hz) : 65535;
  return period;
}


x86 assembly (clang, -O0):
<speaker_Hz_to_period>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x12,-0x4(%rbp)
jbe    1123 <speaker_Hz_to_period+0x23>
mov    $0x1234dc,%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1130 <speaker_Hz_to_period+0x30>
mov    $0xffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <speaker_Hz_to_period+0x30>
mov    -0xc(%rbp),%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<speaker_Hz_to_period>:
mov    $0xffff,%ax
cmp    $0x13,%edi
jb     1112 <speaker_Hz_to_period+0x12>
mov    $0x1234dc,%eax
xor    %edx,%edx
div    %edi
ret

LLVM IR (-O0):
define zeroext i16 @speaker_Hz_to_period(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ugt i32 %4, 18
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = udiv i32 1193180, %7
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %6
%11 = phi i32 [ %8, %6 ], [ 65535, %9 ]
%12 = trunc i32 %11 to i16
store i16 %12, i16* %3
%13 = load i16, i16* %3
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @speaker_Hz_to_period(i32 %0) {
%2 = icmp ugt i32 %0, 18
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = udiv i32 1193180, %0
%5 = trunc i32 %4 to i16
br label %6
6: ; preds = %1, %3
%7 = phi i16 [ %5, %3 ], [ -1, %1 ]
ret i16 %7
}
void _dcache_invalidate_all(void) { ; }


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

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

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

LLVM IR (-O2):
define void @_dcache_invalidate_all() {
ret void
}
int comparisonFunction(void *aPtr, void *bPtr) {
  int a = *((int *)aPtr);
  int b = *((int *)bPtr);
  if (a < b) {
    return -1;
  } else if (a == b) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<comparisonFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <comparisonFunction+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <comparisonFunction+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <comparisonFunction+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <comparisonFunction+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparisonFunction>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comparisonFunction(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 0, i32* %3
br label %24
23: ; preds = %18
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @comparisonFunction(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int _write_sysfs_int(char const *, char const *, int, int /*<<< orphan*/, int,
                     int);
int write_sysfs_int2(const char *filename, const char *basedir, int val,
                     int val2) {
  return _write_sysfs_int(filename, basedir, val, 0, 1, val2);
}


x86 assembly (clang, -O0):
<write_sysfs_int2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%r9d
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <_write_sysfs_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sysfs_int2>:
mov    %ecx,%r9d
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <_write_sysfs_int@plt>

LLVM IR (-O0):
define i32 @write_sysfs_int2(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @_write_sysfs_int(i8* %9, i8* %10, i32 %11, i32 0, i32 1, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @write_sysfs_int2(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @_write_sysfs_int(i8* %0, i8* %1, i32 %2, i32 0, i32 1, i32 %3)
ret i32 %5
}
unsigned long LPCChannelDMAConfigGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000120))) & 0x000000FF);
}


x86 assembly (clang, -O0):
<LPCChannelDMAConfigGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x120(%rax),%rax
and    $0xff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCChannelDMAConfigGet>:
mov    0x120(%rdi),%rax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i64 @LPCChannelDMAConfigGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 288
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 255
ret i64 %7
}

LLVM IR (-O2):
define i64 @LPCChannelDMAConfigGet(i64 %0) {
%2 = add i64 %0, 288
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 255
ret i64 %5
}
/* Variables and functions */
void write_size(void *ptr, size_t size) {
  size_t *sizep = ptr;
  *sizep = size;
}


x86 assembly (clang, -O0):
<write_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_size>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @write_size(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i64, i64* %4
%9 = load i64*, i64** %5
store i64 %8, i64* %9
ret void
}

LLVM IR (-O2):
define void @write_size(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
char *unescape_file(s)
char *s;
{
  char *p;
  p = s = unescape(s);
  while ((p = strchr(p, '\015')) != 0)
    *p++ = '\n';
  return s;
}


x86 assembly (clang, -O0):
<unescape_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <unescape@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1174 <unescape_file+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0xa,(%rax)
jmp    1141 <unescape_file+0x21>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape_file>:
push   %rbx
xor    %eax,%eax
call   1040 <unescape@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xchg   %ax,%ax
mov    $0xd,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     114b <unescape_file+0x2b>
movb   $0xa,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
jmp    1130 <unescape_file+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @unescape_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @unescape to i32 (i8*, ...)*)(i8* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %2
store i8* %7, i8** %3
br label %8
8: ; preds = %12, %1
%9 = load i8*, i8** %3
%10 = call i8* @strchr(i8* %9, i32 13)
store i8* %10, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 10, i8* %13
br label %8
15: ; preds = %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @unescape_file(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unescape to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = tail call i8* @strchr(i8* dereferenceable(1) %4, i32 13)
%6 = icmp eq i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %1, %7
%8 = phi i8* [ %10, %7 ], [ %5, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 10, i8* %8
%10 = tail call i8* @strchr(i8* dereferenceable(1) %9, i32 13)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %7
12: ; preds = %7, %1
ret i8* %4
}
__attribute__((gnu_)) int lookup_binfun(int x, int y, char *binfun) {
  return binfun[2 * x + y];
}


x86 assembly (clang, -O0):
<lookup_binfun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_binfun>:
lea    (%rsi,%rdi,2),%eax
cltq
movsbl (%rdx,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @lookup_binfun(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i32, i32* %4
%9 = mul nsw i32 2, %8
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %7, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @lookup_binfun(i32 %0, i32 %1, i8* nocapture %2) {
%4 = shl nsw i32 %0, 1
%5 = add nsw i32 %4, %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %2, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
ret i32 %9
}
/* Variables and functions */
int short_command(int, int, int, int /*<<< orphan*/, int, int /*<<< orphan*/,
                  void *);
int door_command(int priv, int fd, int cmd1, int cmd2, void *extra_data) {
  return short_command(priv, fd, cmd1, 0, cmd2, 0, extra_data);
}


x86 assembly (clang, -O0):
<door_command>:
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    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%r8d
mov    -0x18(%rbp),%rax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %rax,(%rsp)
call   1030 <short_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<door_command>:
push   %rax
mov    %ecx,%eax
mov    %r8,(%rsp)
xor    %ecx,%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <short_command@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @door_command(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @short_command(i32 %11, i32 %12, i32 %13, i32 0, i32 %14, i32 0, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @door_command(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @short_command(i32 %0, i32 %1, i32 %2, i32 0, i32 %3, i32 0, i8* %4)
ret i32 %6
}
int ti_linregslope_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_linregslope_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_linregslope_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_linregslope_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_linregslope_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
void homogenize_gapsym(char *s, char gapsym) {
  for (; *s != '\0'; s++)
    if (((*s) == ' ' || (*s) == '.' || (*s) == '_' || (*s) == '-'))
      *s = gapsym;
}


x86 assembly (clang, -O0):
<homogenize_gapsym>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117d <homogenize_gapsym+0x7d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     115e <homogenize_gapsym+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     115e <homogenize_gapsym+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     115e <homogenize_gapsym+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1167 <homogenize_gapsym+0x67>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    116c <homogenize_gapsym+0x6c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <homogenize_gapsym+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<homogenize_gapsym>:
movabs $0x8000000000006001,%rax
jmp    1124 <homogenize_gapsym+0x24>
nopl   0x0(%rax)
test   %cl,%cl
je     113d <homogenize_gapsym+0x3d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rdi
movzbl (%rdi),%ecx
lea    -0x20(%rcx),%edx
cmp    $0x3f,%dl
ja     1110 <homogenize_gapsym+0x10>
movzbl %dl,%edx
bt     %rdx,%rax
jae    1110 <homogenize_gapsym+0x10>
mov    %sil,(%rdi)
jmp    1120 <homogenize_gapsym+0x20>
ret

LLVM IR (-O0):
define void @homogenize_gapsym(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
br label %5
5: ; preds = %34, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %37
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 32
br i1 %14, label %30, label %15
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 46
br i1 %19, label %30, label %20
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 95
br i1 %24, label %30, label %25
25: ; preds = %20
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 45
br i1 %29, label %30, label %33
30: ; preds = %25, %20, %15, %10
%31 = load i8, i8* %4
%32 = load i8*, i8** %3
store i8 %31, i8* %32
br label %33
33: ; preds = %30, %25
br label %34
34: ; preds = %33
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %3
br label %5
37: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @homogenize_gapsym(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 32, label %6
i8 46, label %6
i8 95, label %6
i8 45, label %6
]
6: ; preds = %3, %3, %3, %3
store i8 %1, i8* %4
br label %7
7: ; preds = %3, %6
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello_command(int argc, char *argv[]) {
  printf("Hello RTEMS!\n");
  printf("Create your own command here!\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello RTEMS!\0A\00"
@.str.1 = [31 x i8] c"Create your own command here!\0A\00"
define i32 @hello_command(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello RTEMS!\00"
@str.2 = [30 x i8] c"Create your own command here!\00"
define i32 @hello_command(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_lua_comment_entities();
int /*<<< orphan*/ test_lua_comments();
void all_lua_tests() {
  test_lua_comments();
  test_lua_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_lua_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_lua_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_lua_comment_entities@plt>

LLVM IR (-O0):
define void @all_lua_tests() {
%1 = call i32 (...) @test_lua_comments()
%2 = call i32 (...) @test_lua_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_lua_tests() {
%1 = tail call i32 (...) @test_lua_comments()
%2 = tail call i32 (...) @test_lua_comment_entities()
ret void
}
double transition_linear(double n) { return n; }


x86 assembly (clang, -O0):
<transition_linear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @transition_linear(double returned %0) {
ret double %0
}
void av_bprint_chars() {}


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

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

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

LLVM IR (-O2):
define void @av_bprint_chars() {
ret void
}
void VMR3SetPowerOffInsteadOfReset(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3SetPowerOffInsteadOfReset() {
ret void
}
/* Variables and functions */
void *__memcpy(void *, void const *, size_t);
void *memcpy(void *dst0, const void *src0, size_t length) {
  return __memcpy(dst0, src0, length);
}


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

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <__memcpy@plt>

LLVM IR (-O0):
define i8* @memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @__memcpy(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @__memcpy(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
void kfree(void *addr) {}


x86 assembly (clang, -O0):
<kfree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @kfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @kfree(i8* nocapture %0) {
ret void
}
char *strlwr(char *psString) {
  char *ps;
  for (ps = psString; *ps; ++ps) {
    if ('A' <= *ps && *ps <= 'Z')
      *ps += 'a' - 'A';
  }
  return (psString);
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <strlwr+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     114d <strlwr+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114d <strlwr+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
jmp    1152 <strlwr+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlwr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <strlwr+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <strlwr+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <strlwr+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <strlwr+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <strlwr+0x10>
ret

LLVM IR (-O0):
define i8* @strlwr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %29
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 65, %12
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 32
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
br label %25
25: ; preds = %19, %14, %9
br label %26
26: ; preds = %25
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
%30 = load i8*, i8** %2
ret i8* %30
}

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ cpuADC();
int /*<<< orphan*/ cpuRORt();
void cpuRRA() {
  cpuRORt();
  cpuADC();
}


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

x86 assembly (clang, -O2):
<cpuRRA>:
push   %rax
xor    %eax,%eax
call   1030 <cpuRORt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cpuADC@plt>

LLVM IR (-O0):
define void @cpuRRA() {
%1 = call i32 (...) @cpuRORt()
%2 = call i32 (...) @cpuADC()
ret void
}

LLVM IR (-O2):
define void @cpuRRA() {
%1 = tail call i32 (...) @cpuRORt()
%2 = tail call i32 (...) @cpuADC()
ret void
}
int f1() { return 1; }


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

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

LLVM IR (-O0):
define i32 @f1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @f1() {
ret i32 1
}
int cairo_code_draw_casHarmWaveLabel_get_height() { return 55; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casHarmWaveLabel_get_height() {
ret i32 55
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casHarmWaveLabel_get_height() {
ret i32 55
}
char *skip_whitespace(char *ptr) {
  while ((*ptr == ' ') || (*ptr == '\t') || (*ptr == '\r') || (*ptr == '\n'))
    ++ptr;
  return ptr;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_whitespace+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_whitespace+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_whitespace+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <skip_whitespace+0x67>
jmp    1178 <skip_whitespace+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_whitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
mov    %rdi,%rax
movabs $0x100002600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <skip_whitespace+0x25>
bt     %rdx,%rcx
jae    1125 <skip_whitespace+0x25>
add    $0x1,%rax
jmp    1110 <skip_whitespace+0x10>
ret

LLVM IR (-O0):
define i8* @skip_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %25, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %23, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br i1 %12, label %23, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 10
br label %23
23: ; preds = %18, %13, %8, %3
%24 = phi i1 [ true, %13 ], [ true, %8 ], [ true, %3 ], [ %22, %18 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %3
28: ; preds = %23
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
void *list_remove(void *);
void list_free(void *node) {
  void *p;
  for (p = node; p; p = list_remove(p)) {
  }
}


x86 assembly (clang, -O0):
<list_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <list_free+0x36>
jmp    1134 <list_free+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <list_remove@plt>
mov    %rax,-0x10(%rbp)
jmp    1124 <list_free+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_free>:
push   %rax
test   %rdi,%rdi
je     112d <list_free+0x1d>
mov    %rdi,%rax
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <list_remove@plt>
test   %rax,%rax
jne    1120 <list_free+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @list_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load i8*, i8** %3
%11 = call i8* @list_remove(i8* %10)
store i8* %11, i8** %3
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @list_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %5, %3 ], [ %0, %1 ]
%5 = tail call i8* @list_remove(i8* %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
__attribute__((no, noclone)) char *f7(char *p, unsigned long int i) {
  return p + i;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i8* @f7(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 = getelementptr inbounds i8, i8* %5, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @f7(i8* readnone %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ CallBack1(int, int *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
void PauseUpdate(int *savePtr) {
  if (!CheckRunningInMainThread("PauseUpdate"))
    return;
  CallBack1(29, savePtr);
}


x86 assembly (clang, -O0):
<PauseUpdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1146 <PauseUpdate+0x26>
jmp    1154 <PauseUpdate+0x34>
mov    -0x8(%rbp),%rsi
mov    $0x1d,%edi
call   1030 <CallBack1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PauseUpdate>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1142 <PauseUpdate+0x22>
mov    $0x1d,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <CallBack1@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"PauseUpdate\00"
define void @PauseUpdate(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @CallBack1(i32 29, i32* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"PauseUpdate\00"
define void @PauseUpdate(i32* %0) {
%2 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @CallBack1(i32 29, i32* %0)
br label %6
6: ; preds = %1, %4
ret void
}
/* Type definitions */
typedef int fpu_control_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int fegetexcept(void) {
  fpu_control_t temp;
  _FPU_GETCW(temp);
  return (temp >> 5) & FE_ALL_EXCEPT;
}


x86 assembly (clang, -O0):
<fegetexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x4(%rbp),%eax
sar    $0x5,%eax
mov    0x2eb3(%rip),%rcx
and    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetexcept>:
push   %rax
call   1030 <_FPU_GETCW@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fegetexcept() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @_FPU_GETCW(i32 %2)
%4 = load i32, i32* %1
%5 = ashr i32 %4, 5
%6 = load i32, i32* @FE_ALL_EXCEPT
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fegetexcept() {
%1 = tail call i32 @_FPU_GETCW(i32 undef)
ret i32 0
}
void z_picture_table(void) {}


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

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

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

LLVM IR (-O2):
define void @z_picture_table() {
ret void
}
const char *ajXmlinTypeGetFields(void) { return "id acc"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"id acc\00"
define i8* @ajXmlinTypeGetFields() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"id acc\00"
define i8* @ajXmlinTypeGetFields() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ cio_cleanup(void *);
void cio_routine_cancel(void *arg) { cio_cleanup(arg); }


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

x86 assembly (clang, -O2):
<cio_routine_cancel>:
jmp    1030 <cio_cleanup@plt>

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

LLVM IR (-O2):
define void @cio_routine_cancel(i8* %0) {
%2 = tail call i32 @cio_cleanup(i8* %0)
ret void
}
int minBitsToRepresent(int code) {
  int numBits = 9;
  while (code > 1 << numBits) {
    numBits++;
  }
  return numBits;
}


x86 assembly (clang, -O0):
<minBitsToRepresent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jle    1133 <minBitsToRepresent+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <minBitsToRepresent+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minBitsToRepresent>:
mov    $0x8,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %edi,%eax
jl     1110 <minBitsToRepresent+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @minBitsToRepresent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 9, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = shl i32 1, %6
%8 = icmp sgt i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @minBitsToRepresent(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 9, %1 ], [ %6, %2 ]
%4 = shl nuw i32 1, %3
%5 = icmp slt i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
void ff_hevc_put_hevc_epel_h48_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h48_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ monitor_put(char);
void monitor_write(char *c) {
  int i = 0;
  while (c[i]) {
    monitor_put(c[i++]);
  }
}


x86 assembly (clang, -O0):
<monitor_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <monitor_write+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <monitor_put@plt>
jmp    1123 <monitor_write+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monitor_write>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <monitor_write+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <monitor_put@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <monitor_write+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @monitor_write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @monitor_put(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}