xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  long long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long lcec_get_ticks(void) {
  struct timespec tp;
  clock_gettime(CLOCK_MONOTONIC, &tp);
  return ((long)(tp.tv_sec * 100LL)) + (tp.tv_nsec / 10000000L);
}


x86 assembly (clang, -O0):
<lcec_get_ticks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x64,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcec_get_ticks>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x64,0x8(%rsp),%rsi
mov    0x10(%rsp),%rcx
movabs $0xd6bf94d5e57a42bd,%rdx
94 bf d6
mov    %rcx,%rax
imul   %rdx
add    %rdx,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x17,%rcx
add    %rax,%rcx
add    %rsi,%rcx
mov    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @lcec_get_ticks() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 100
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sdiv i64 %8, 10000000
%10 = add nsw i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @lcec_get_ticks() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul nsw i64 %6, 100
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = sdiv i64 %9, 10000000
%11 = add nsw i64 %10, %7
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ strcoll(char *, char *);
void uninivar_strcoll(void) {
  char *cs;
  char *ct;
  (void)strcoll(cs, ct);
}


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

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

LLVM IR (-O0):
define void @uninivar_strcoll() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcoll(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_strcoll() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ftp_close(int handle) {
  printf("ftp_close() called!\n");
  printf("ftp_close: not yet implemented\n");
}


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

x86 assembly (clang, -O2):
<ftp_close>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"ftp_close() called!\0A\00"
@.str.1 = [32 x i8] c"ftp_close: not yet implemented\0A\00"
define void @ftp_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"ftp_close() called!\00"
@str.2 = [31 x i8] c"ftp_close: not yet implemented\00"
define void @ftp_close(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ntohl(int);
int read_socket(int, char *, int);
int readInteger(int socketfd) {
  int numbytes, integerValue;
  numbytes = read_socket(socketfd, (char *)&integerValue, sizeof(int));
  return ntohl(integerValue);
}


x86 assembly (clang, -O0):
<readInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read_socket@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInteger>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <read_socket@plt>
mov    0x4(%rsp),%edi
call   1040 <ntohl@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @readInteger(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = bitcast i32* %4 to i8*
%7 = call i32 @read_socket(i32 %5, i8* %6, i32 4)
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @ntohl(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @readInteger(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @read_socket(i32 %0, i8* %3, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @ntohl(i32 %5)
ret i32 %6
}
/* Variables and functions */
unsigned int alphex_ctoui(char const);
unsigned int alphex_stoui(const char *alphex) {
  unsigned int i = alphex_ctoui(*alphex);
  while (*++alphex) {
    i <<= 6;
    i += alphex_ctoui(*alphex);
  }
  return i;
}


x86 assembly (clang, -O0):
<alphex_stoui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <alphex_ctoui@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,0x1(%rax)
je     1164 <alphex_stoui+0x54>
mov    -0xc(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <alphex_ctoui@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112b <alphex_stoui+0x1b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphex_stoui>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <alphex_ctoui@plt>
mov    %eax,%ebp
mov    0x1(%rbx),%al
test   %al,%al
je     1148 <alphex_stoui+0x38>
add    $0x2,%rbx
nopl   0x0(%rax,%rax,1)
shl    $0x6,%ebp
movsbl %al,%edi
call   1030 <alphex_ctoui@plt>
add    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <alphex_stoui+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @alphex_stoui(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @alphex_ctoui(i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %1, %7
%8 = phi i8 [ %15, %7 ], [ %5, %1 ]
%9 = phi i8* [ %14, %7 ], [ %4, %1 ]
%10 = phi i32 [ %13, %7 ], [ %3, %1 ]
%11 = shl i32 %10, 6
%12 = tail call i32 @alphex_ctoui(i8 signext %8)
%13 = add i32 %12, %11
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %1
%18 = phi i32 [ %3, %1 ], [ %13, %7 ]
ret i32 %18
}
void banko_writer_close(struct banko_writer *writer) {
  writer = writer;
  return;
}


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

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

LLVM IR (-O0):
%struct.banko_writer = type opaque
define void @banko_writer_close(%struct.banko_writer* %0) {
%2 = alloca %struct.banko_writer*
store %struct.banko_writer* %0, %struct.banko_writer** %2
%3 = load %struct.banko_writer*, %struct.banko_writer** %2
store %struct.banko_writer* %3, %struct.banko_writer** %2
ret void
}

LLVM IR (-O2):
%struct.banko_writer = type opaque
define void @banko_writer_close(%struct.banko_writer* nocapture %0) {
ret void
}
void RTHeapSimpleGetFreeSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHeapSimpleGetFreeSize() {
ret void
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t bswap(uint32_t x) {
  asm("bswap %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<bswap>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i8* @bswap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @bswap(i8* readnone %0) {
%2 = tail call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
void av_dict_set_int() {}


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

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

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

LLVM IR (-O2):
define void @av_dict_set_int() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fail(const char *why) {
  fprintf(stderr, "%s\n", why);
  exit(111);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x6f,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x6f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 111)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 111)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ debugf(char *);
void about() {
  static char statement[] =
      "\n    Elaborato IPC (@UNIVR 2015/2016) Copyright (C) 2016 Mario "
      "Alessandro Barbara\n    This program comes with ABSOLUTELY NO "
      "WARRANTY.\n    This is free software, and you are welcome to "
      "redistribute it\n    under certain conditions.\n    For details see the "
      "'LICENSE' file that should have been distributed\n    along with this "
      "proram, if not, see <http://www.gnu.org/licenses/>.\n\n\n";
  debugf(statement);
}


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

x86 assembly (clang, -O2):
<about>:
lea    0x2f19(%rip),%rdi
jmp    1030 <debugf@plt>

LLVM IR (-O0):
@about.statement = internal global [378 x i8] c"\0A Elaborato IPC (@UNIVR 2015/2016) Copyright (C) 2016 Mario Alessandro Barbara\0A This program comes with ABSOLUTELY NO WARRANTY.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions.\0A For details see the 'LICENSE' file that should have been distributed\0A along with this proram, if not, see <http://www.gnu.org/licenses/>.\0A\0A\0A\00"
define void @about() {
%1 = call i32 @debugf(i8* getelementptr inbounds ([378 x i8], [378 x i8]* @about.statement, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@about.statement = internal global [378 x i8] c"\0A Elaborato IPC (@UNIVR 2015/2016) Copyright (C) 2016 Mario Alessandro Barbara\0A This program comes with ABSOLUTELY NO WARRANTY.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions.\0A For details see the 'LICENSE' file that should have been distributed\0A along with this proram, if not, see <http://www.gnu.org/licenses/>.\0A\0A\0A\00"
define void @about() {
%1 = tail call i32 @debugf(i8* getelementptr inbounds ([378 x i8], [378 x i8]* @about.statement, i64 0, i64 0))
ret void
}
void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp) {
  return;
}


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

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
%struct.ubifs_lprops = type opaque
define void @dbg_dump_lprop(%struct.ubifs_info* %0, %struct.ubifs_lprops* %1) {
%3 = alloca %struct.ubifs_info*
%4 = alloca %struct.ubifs_lprops*
store %struct.ubifs_info* %0, %struct.ubifs_info** %3
store %struct.ubifs_lprops* %1, %struct.ubifs_lprops** %4
ret void
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.ubifs_lprops = type opaque
define void @dbg_dump_lprop(%struct.ubifs_info* nocapture %0, %struct.ubifs_lprops* nocapture %1) {
ret void
}
unsigned short whisper_ntoh16(unsigned short x) {
  unsigned char *p = (unsigned char *)&x;
  return (unsigned short)p[0] << 8 | (unsigned short)p[1];
}


x86 assembly (clang, -O0):
<whisper_ntoh16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<whisper_ntoh16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @whisper_ntoh16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8*
store i16 %0, i16* %2
%4 = bitcast i16* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = zext i16 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i16
%15 = zext i16 %14 to i32
%16 = or i32 %10, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @whisper_ntoh16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int thermal_genl_sampling_temp(int id, int temp) { return 0; }


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

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

LLVM IR (-O0):
define i32 @thermal_genl_sampling_temp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @thermal_genl_sampling_temp(i32 %0, i32 %1) {
ret i32 0
}
int main(argc, argv)
int argc;
char *argv[];
{
  MDString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [63 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @MDString to i32 (i8*, ...)*)(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @MDString to i32 (i8*, ...)*)(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void tvi_replace_c(char *s, char c1, char c2) {
  char *p;
  for (p = s; *p; ++p)
    if (*p == c1)
      *p = c2;
}


x86 assembly (clang, -O0):
<tvi_replace_c>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <tvi_replace_c+0x5a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <tvi_replace_c+0x44>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1149 <tvi_replace_c+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <tvi_replace_c+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tvi_replace_c>:
mov    (%rdi),%al
test   %al,%al
je     1125 <tvi_replace_c+0x25>
add    $0x1,%rdi
jmp    111b <tvi_replace_c+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <tvi_replace_c+0x25>
cmp    %sil,%al
jne    1110 <tvi_replace_c+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <tvi_replace_c+0x10>
ret

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

LLVM IR (-O2):
define void @tvi_replace_c(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _s2_priv_textab(float, float, float, int /*<<< orphan*/, int,
                                   int, int, char *);
void s2textxz(float ix, float iy, float iz, char *itext) {
  _s2_priv_textab(ix, iy, iz, 0, 2, 1., 1., itext);
}


x86 assembly (clang, -O0):
<s2textxz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mov    -0x18(%rbp),%r8
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1030 <_s2_priv_textab@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2textxz>:
mov    %rdi,%r8
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
jmp    1030 <_s2_priv_textab@plt>

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

LLVM IR (-O2):
define void @s2textxz(float %0, float %1, float %2, i8* %3) {
%5 = tail call i32 @_s2_priv_textab(float %0, float %1, float %2, i32 0, i32 2, i32 1, i32 1, i8* %3)
ret void
}
/* Variables and functions */
int is_smackfs_mounted();
int /*<<< orphan*/ printf(char *);
int status(void) {
  int ret = is_smackfs_mounted();
  switch (ret) {
  case 1:
    printf("SmackFS is mounted.\n");
    return 0;
  case 0:
    printf("SmackFS is not mounted.\n");
    return 0;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <is_smackfs_mounted@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     116e <status+0x4e>
jmp    1145 <status+0x25>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
jne    1186 <status+0x66>
jmp    1156 <status+0x36>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    118d <status+0x6d>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    118d <status+0x6d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status>:
push   %rax
xor    %eax,%eax
call   1040 <is_smackfs_mounted@plt>
cmp    $0x1,%eax
je     1141 <status+0x21>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
jne    114f <status+0x2f>
lea    0xec1(%rip),%rdi
jmp    1148 <status+0x28>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"SmackFS is mounted.\0A\00"
@.str.1 = [25 x i8] c"SmackFS is not mounted.\0A\00"
define i32 @status() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @is_smackfs_mounted()
store i32 %3, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 1, label %5
i32 0, label %7
]
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %10
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %10
9: ; preds = %0
store i32 -1, i32* %1
br label %10
10: ; preds = %9, %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@str = [24 x i8] c"SmackFS is not mounted.\00"
@str.2 = [20 x i8] c"SmackFS is mounted.\00"
define i32 @status() {
%1 = tail call i32 (...) @is_smackfs_mounted()
switch i32 %1, label %6 [
i32 1, label %3
i32 0, label %2
]
2: ; preds = %0
br label %3
3: ; preds = %0, %2
%4 = phi i8* [ getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0), %0 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
br label %6
6: ; preds = %3, %0
%7 = phi i32 [ -1, %0 ], [ 0, %3 ]
ret i32 %7
}
int fun446() { return 446; }


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

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

LLVM IR (-O0):
define i32 @fun446() {
ret i32 446
}

LLVM IR (-O2):
define i32 @fun446() {
ret i32 446
}
void testfunc_01(volatile const short *ap, volatile short *bp, short val) {
  bp[0] = ap[15];
  bp[2] = ap[5];
  bp[9] = ap[7];
  bp[0] = ap[15];
  bp[4] = val;
  bp[14] = val;
}


x86 assembly (clang, -O0):
<testfunc_01>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1e(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xa(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0xe(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x12(%rax)
mov    -0x8(%rbp),%rax
mov    0x1e(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x12(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x8(%rax)
mov    -0x12(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc_01>:
movzwl 0x1e(%rdi),%eax
mov    %ax,(%rsi)
movzwl 0xa(%rdi),%eax
mov    %ax,0x4(%rsi)
movzwl 0xe(%rdi),%eax
mov    %ax,0x12(%rsi)
movzwl 0x1e(%rdi),%eax
mov    %ax,(%rsi)
mov    %dx,0x8(%rsi)
mov    %dx,0x1c(%rsi)
ret

LLVM IR (-O0):
define void @testfunc_01(i16* %0, i16* %1, i16 signext %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16 %2, i16* %6
%7 = load i16*, i16** %4
%8 = getelementptr inbounds i16, i16* %7, i64 15
%9 = load volatile i16, i16* %8
%10 = load i16*, i16** %5
%11 = getelementptr inbounds i16, i16* %10, i64 0
store volatile i16 %9, i16* %11
%12 = load i16*, i16** %4
%13 = getelementptr inbounds i16, i16* %12, i64 5
%14 = load volatile i16, i16* %13
%15 = load i16*, i16** %5
%16 = getelementptr inbounds i16, i16* %15, i64 2
store volatile i16 %14, i16* %16
%17 = load i16*, i16** %4
%18 = getelementptr inbounds i16, i16* %17, i64 7
%19 = load volatile i16, i16* %18
%20 = load i16*, i16** %5
%21 = getelementptr inbounds i16, i16* %20, i64 9
store volatile i16 %19, i16* %21
%22 = load i16*, i16** %4
%23 = getelementptr inbounds i16, i16* %22, i64 15
%24 = load volatile i16, i16* %23
%25 = load i16*, i16** %5
%26 = getelementptr inbounds i16, i16* %25, i64 0
store volatile i16 %24, i16* %26
%27 = load i16, i16* %6
%28 = load i16*, i16** %5
%29 = getelementptr inbounds i16, i16* %28, i64 4
store volatile i16 %27, i16* %29
%30 = load i16, i16* %6
%31 = load i16*, i16** %5
%32 = getelementptr inbounds i16, i16* %31, i64 14
store volatile i16 %30, i16* %32
ret void
}

LLVM IR (-O2):
define void @testfunc_01(i16* %0, i16* %1, i16 signext %2) {
%4 = getelementptr inbounds i16, i16* %0, i64 15
%5 = load volatile i16, i16* %4
store volatile i16 %5, i16* %1
%6 = getelementptr inbounds i16, i16* %0, i64 5
%7 = load volatile i16, i16* %6
%8 = getelementptr inbounds i16, i16* %1, i64 2
store volatile i16 %7, i16* %8
%9 = getelementptr inbounds i16, i16* %0, i64 7
%10 = load volatile i16, i16* %9
%11 = getelementptr inbounds i16, i16* %1, i64 9
store volatile i16 %10, i16* %11
%12 = load volatile i16, i16* %4
store volatile i16 %12, i16* %1
%13 = getelementptr inbounds i16, i16* %1, i64 4
store volatile i16 %2, i16* %13
%14 = getelementptr inbounds i16, i16* %1, i64 14
store volatile i16 %2, i16* %14
ret void
}
void BlinkNoTimerTaskC$Leds$led1Toggle(void) { LedsP$Leds$led1Toggle(); }


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

x86 assembly (clang, -O2):
<BlinkNoTimerTaskC$Leds$led1Toggle>:
xor    %eax,%eax
jmp    1030 <LedsP$Leds$led1Toggle@plt>

LLVM IR (-O0):
define void @"BlinkNoTimerTaskC$Leds$led1Toggle"() {
%1 = call i32 (...) @"LedsP$Leds$led1Toggle"()
ret void
}

LLVM IR (-O2):
define void @"BlinkNoTimerTaskC$Leds$led1Toggle"() {
%1 = tail call i32 (...) @"LedsP$Leds$led1Toggle"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_rnd_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_pow_si(int /*<<< orphan*/, int /*<<< orphan*/, long,
                               int);
void mpfrpowsi(mpfr_t r2, mpfr_t r1, int *iexp, mpfr_rnd_t *irnd) {
  long int n1;
  int n2;
  n1 = *iexp;
  n2 = *irnd;
  mpfr_pow_si(r2, r1, n1, n2);
}


x86 assembly (clang, -O0):
<mpfrpowsi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <mpfr_pow_si@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfrpowsi>:
movslq (%rdx),%rdx
mov    (%rcx),%ecx
jmp    1030 <mpfr_pow_si@plt>

LLVM IR (-O0):
define void @mpfrpowsi(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
store i64 %13, i64* %9
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
store i32 %15, i32* %10
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i64, i64* %9
%19 = load i32, i32* %10
%20 = call i32 @mpfr_pow_si(i32 %16, i32 %17, i64 %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @mpfrpowsi(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = load i32, i32* %3
%8 = tail call i32 @mpfr_pow_si(i32 %0, i32 %1, i64 %6, i32 %7)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *__attribute__((no, noclone)) allocate_zeroed(size_t a, size_t b) {
  return calloc(a, b);
}


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

x86 assembly (clang, -O2):
<allocate_zeroed>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @allocate_zeroed(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @allocate_zeroed(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror("usage:\n"
          "RNAduplex [-e range] [-s]\n"
          "          [-T temp] [-4] [-d] [-noGU] [-noCloseGU]\n"
          "          [-noLP] [-P paramfile] [-nsp pairs] [-noconv]\n");
}


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

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

LLVM IR (-O0):
@.str = [141 x i8] c"usage:\0ARNAduplex [-e range] [-s]\0A [-T temp] [-4] [-d] [-noGU] [-noCloseGU]\0A [-noLP] [-P paramfile] [-nsp pairs] [-noconv]\0A\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [141 x i8] c"usage:\0ARNAduplex [-e range] [-s]\0A [-T temp] [-4] [-d] [-noGU] [-noCloseGU]\0A [-noLP] [-P paramfile] [-nsp pairs] [-noconv]\0A\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createAndExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x0004, expression1, expression2);
}


x86 assembly (clang, -O0):
<createAndExpression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x4,%edi
call   1030 <createExpression@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createAndExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x4,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createAndExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 4, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createAndExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 4, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
unsigned char bitrev(unsigned char byte) {
  unsigned char ret;
  unsigned char i;
  for (i = 0, ret = 0; i < 8; i++)
    if (7 - i * 2 > 0)
      ret |= (byte & 0x01 << i) << (7 - i * 2);
    else
      ret |= (byte & 0x01 << i) >> (i * 2 - 7);
  return ret;
}


x86 assembly (clang, -O0):
<bitrev>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x8,%eax
jge    11a5 <bitrev+0xa5>
movzbl -0x3(%rbp),%ecx
shl    $0x1,%ecx
mov    $0x7,%eax
sub    %ecx,%eax
cmp    $0x0,%eax
jle    1169 <bitrev+0x69>
movzbl -0x1(%rbp),%eax
movzbl -0x3(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
movzbl -0x3(%rbp),%edx
shl    $0x1,%edx
mov    $0x7,%ecx
sub    %edx,%ecx
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
jmp    1193 <bitrev+0x93>
movzbl -0x1(%rbp),%eax
movzbl -0x3(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
movzbl -0x3(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x7,%ecx
sar    %cl,%eax
mov    %eax,%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
jmp    1198 <bitrev+0x98>
mov    -0x3(%rbp),%al
add    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    1112 <bitrev+0x12>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitrev>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @bitrev(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %4
store i8 0, i8* %3
br label %5
5: ; preds = %48, %1
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %51
9: ; preds = %5
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %11, 2
%13 = sub nsw i32 7, %12
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %31
15: ; preds = %9
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 1, %19
%21 = and i32 %17, %20
%22 = load i8, i8* %4
%23 = zext i8 %22 to i32
%24 = mul nsw i32 %23, 2
%25 = sub nsw i32 7, %24
%26 = shl i32 %21, %25
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = or i32 %28, %26
%30 = trunc i32 %29 to i8
store i8 %30, i8* %3
br label %47
31: ; preds = %9
%32 = load i8, i8* %2
%33 = zext i8 %32 to i32
%34 = load i8, i8* %4
%35 = zext i8 %34 to i32
%36 = shl i32 1, %35
%37 = and i32 %33, %36
%38 = load i8, i8* %4
%39 = zext i8 %38 to i32
%40 = mul nsw i32 %39, 2
%41 = sub nsw i32 %40, 7
%42 = ashr i32 %37, %41
%43 = load i8, i8* %3
%44 = zext i8 %43 to i32
%45 = or i32 %44, %42
%46 = trunc i32 %45 to i8
store i8 %46, i8* %3
br label %47
47: ; preds = %31, %15
br label %48
48: ; preds = %47
%49 = load i8, i8* %4
%50 = add i8 %49, 1
store i8 %50, i8* %4
br label %5
51: ; preds = %5
%52 = load i8, i8* %3
ret i8 %52
}

LLVM IR (-O2):
define zeroext i8 @bitrev(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
void rgb2rgb_init_aarch64() {}


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

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

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

LLVM IR (-O2):
define void @rgb2rgb_init_aarch64() {
ret void
}
int test_imm_9Fint8_reg(signed char val) {
  return ((val) & (0x9F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Fint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x9f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_9Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 159
%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_9Fint8_reg(i8 signext %0) {
%2 = and i8 %0, -97
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ff_hevc_put_hevc_bi_w_epel_v12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_v12_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCDCharacter(char);
void LCDString(char *input) {
  while (*input) {
    LCDCharacter(*input);
    input++;
  }
}


x86 assembly (clang, -O0):
<LCDString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <LCDString+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <LCDCharacter@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <LCDString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @LCDString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @LCDCharacter(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int freq_to_channel(uint16_t freq) { return freq / 5 - 470; }


x86 assembly (clang, -O0):
<freq_to_channel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
sub    $0x1d6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freq_to_channel>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x21,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0xfffffe2a,%eax
ret

LLVM IR (-O0):
define i32 @freq_to_channel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 5
%5 = sub nsw i32 %4, 470
ret i32 %5
}

LLVM IR (-O2):
define i32 @freq_to_channel(i32 %0) {
%2 = sdiv i32 %0, 5
%3 = add nsw i32 %2, -470
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memmove4_impl(void *dest, const void *src, size_t n) {
  memmove(dest, src, n);
}


x86 assembly (clang, -O0):
<__aeabi_memmove4_impl>:
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 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memmove4_impl>:
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define weak void @__aeabi_memmove4_impl(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 i32 @memmove(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define weak void @__aeabi_memmove4_impl(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
char *get_file_handle(char const *, long *);
int /*<<< orphan*/ munmap(char *, long);
int /*<<< orphan*/ parse_grid(char *);
void parse_input(const char *grid_file) {
  long fsz;
  char *rh = get_file_handle(grid_file, &fsz);
  parse_grid(rh);
  munmap(rh, fsz);
}


x86 assembly (clang, -O0):
<parse_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <get_file_handle@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <parse_grid@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_input>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
call   1040 <get_file_handle@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <parse_grid@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <munmap@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @parse_input(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @get_file_handle(i8* %5, i64* %3)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @parse_grid(i8* %7)
%9 = load i8*, i8** %4
%10 = load i64, i64* %3
%11 = call i32 @munmap(i8* %9, i64 %10)
ret void
}

LLVM IR (-O2):
define void @parse_input(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i8* @get_file_handle(i8* %0, i64* %2)
%5 = call i32 @parse_grid(i8* %4)
%6 = load i64, i64* %2
%7 = call i32 @munmap(i8* %4, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic_blink(int);
int /*<<< orphan*/ uart0_write(char *);
int /*<<< orphan*/ uart0_write_hex(long);
void prefetch_abort(void) {
  register volatile char *r_14 asm("r14");
  long prev_pc = (long)r_14 - 4;
  uart0_write("prefetch abort!\r\n");
  uart0_write_hex(prev_pc);
  panic_blink(2);
}


x86 assembly (clang, -O0):
<prefetch_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rax
sub    $0x4,%rax
mov    %rax,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
call   1040 <uart0_write@plt>
mov    -0x10(%rbp),%rdi
call   1050 <uart0_write_hex@plt>
mov    $0x2,%edi
call   1030 <panic_blink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefetch_abort>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <uart0_write@plt>
call   1050 <uart0_write_hex@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <panic_blink@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"prefetch abort!\0D\0A\00"
define void @prefetch_abort() {
%1 = alloca i8*
%2 = alloca i64
%3 = load i8*, i8** %1
%4 = ptrtoint i8* %3 to i64
%5 = sub nsw i64 %4, 4
store i64 %5, i64* %2
%6 = call i32 @uart0_write(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = load i64, i64* %2
%8 = call i32 @uart0_write_hex(i64 %7)
%9 = call i32 @panic_blink(i32 2)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"prefetch abort!\0D\0A\00"
define void @prefetch_abort() {
%1 = tail call i32 @uart0_write(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @uart0_write_hex(i64 undef)
%3 = tail call i32 @panic_blink(i32 2)
ret void
}
float test_atan2f(float x, float y) { return __builtin_atan2f(x, y); }


x86 assembly (clang, -O0):
<test_atan2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_atan2f>:
jmp    1030 <atan2f@plt>

LLVM IR (-O0):
define float @test_atan2f(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 = call float @atan2f(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @test_atan2f(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
ret float %3
}
void foo15() {}


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

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

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

LLVM IR (-O2):
define void @foo15() {
ret void
}
void plugin_exit_math(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_math() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t now(void) { return (time(NULL)); }


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i32 @now() {
%1 = call i32 @time(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @now() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
/* Variables and functions */
size_t atomic_postadd_size_t(size_t *, int);
size_t atomic_postinc_size_t(size_t *var) {
  return atomic_postadd_size_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_postinc_size_t>:
mov    $0x1,%esi
jmp    1030 <atomic_postadd_size_t@plt>

LLVM IR (-O0):
define i64 @atomic_postinc_size_t(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = call i64 @atomic_postadd_size_t(i64* %3, i32 1)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atomic_postinc_size_t(i64* %0) {
%2 = tail call i64 @atomic_postadd_size_t(i64* %0, i32 1)
ret i64 %2
}