xunge/DecIR huggingface dataset:
/* Variables and functions */
bool is_alphabet(char c) { return (c | 32) >= 'a' && (c | 32) <= 'z'; }


x86 assembly (clang, -O0):
<is_alphabet>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
or     $0x20,%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     112f <is_alphabet+0x2f>
movsbl -0x1(%rbp),%eax
or     $0x20,%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alphabet>:
or     $0x20,%dil
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alphabet(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = or i32 %4, 32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = or i32 %9, 32
%11 = icmp sle i32 %10, 122
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_alphabet(i8 signext %0) {
%2 = or i8 %0, 32
%3 = add i8 %2, -97
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
int /*<<< orphan*/ string_iterate_lines(char **, void *);
void string_array_destroy(char **array) {
  string_iterate_lines(array, (void *)free);
  free(array);
}


x86 assembly (clang, -O0):
<string_array_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rsi
call   1030 <string_iterate_lines@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_destroy>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rsi
call   1030 <string_iterate_lines@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>

LLVM IR (-O0):
define void @string_array_destroy(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i32 @string_iterate_lines(i8** %3, i8* bitcast (i32 (i8**)* @free to i8*))
%5 = load i8**, i8*** %2
%6 = call i32 @free(i8** %5)
ret void
}

LLVM IR (-O2):
define void @string_array_destroy(i8** %0) {
%2 = tail call i32 @string_iterate_lines(i8** %0, i8* bitcast (i32 (i8**)* @free to i8*))
%3 = tail call i32 @free(i8** %0)
ret void
}
void sys_close(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<sys_close>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_close>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.sys_close = [10 x i8] c"sys_close\00"
define void @sys_close() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.sys_close, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.sys_close = [10 x i8] c"sys_close\00"
define void @sys_close() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.sys_close, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MTU2_ch3_clear();
int /*<<< orphan*/ MTU2_ch3_start();
int /*<<< orphan*/ MTU2_ch3_stop();
void MTU2_ch3_restart(void) {
  MTU2_ch3_stop();
  MTU2_ch3_clear();
  MTU2_ch3_start();
}


x86 assembly (clang, -O0):
<MTU2_ch3_restart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <MTU2_ch3_stop@plt>
mov    $0x0,%al
call   1030 <MTU2_ch3_clear@plt>
mov    $0x0,%al
call   1040 <MTU2_ch3_start@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MTU2_ch3_restart>:
push   %rax
xor    %eax,%eax
call   1050 <MTU2_ch3_stop@plt>
xor    %eax,%eax
call   1030 <MTU2_ch3_clear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <MTU2_ch3_start@plt>

LLVM IR (-O0):
define void @MTU2_ch3_restart() {
%1 = call i32 (...) @MTU2_ch3_stop()
%2 = call i32 (...) @MTU2_ch3_clear()
%3 = call i32 (...) @MTU2_ch3_start()
ret void
}

LLVM IR (-O2):
define void @MTU2_ch3_restart() {
%1 = tail call i32 (...) @MTU2_ch3_stop()
%2 = tail call i32 (...) @MTU2_ch3_clear()
%3 = tail call i32 (...) @MTU2_ch3_start()
ret void
}
/* Variables and functions */
float smrand_uniform_do();
float smrand_uniformv() { return smrand_uniform_do(); }


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

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

LLVM IR (-O0):
define float @smrand_uniformv() {
%1 = call float (...) @smrand_uniform_do()
ret float %1
}

LLVM IR (-O2):
define float @smrand_uniformv() {
%1 = tail call float (...) @smrand_uniform_do()
ret float %1
}
/* Variables and functions */
int svtParseLong(char const *, long *);
int svtParseInt(const char *str, int *val) {
  long l;
  int ret;
  ret = svtParseLong(str, &l);
  *val = (int)l;
  return ret;
}


x86 assembly (clang, -O0):
<svtParseInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <svtParseLong@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svtParseInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <svtParseLong@plt>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @svtParseInt(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = load i8*, i8** %3
%8 = call i32 @svtParseLong(i8* %7, i64* %5)
store i32 %8, i32* %6
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @svtParseInt(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @svtParseLong(i8* %0, i64* %3)
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
ret i32 %5
}
int execute_rt_sigpending() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_rt_sigpending() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_rt_sigpending() {
ret i32 0
}
int pldummy_vga() { return 0; }


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

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

LLVM IR (-O0):
define i32 @pldummy_vga() {
ret i32 0
}

LLVM IR (-O2):
define i32 @pldummy_vga() {
ret i32 0
}
void UARTDMADisable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x40)))) |= ((0x00000001u));
  (*((volatile unsigned int *)(baseAdd + (0x40)))) &= ~((0x00000006u));
}


x86 assembly (clang, -O0):
<UARTDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffff9,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMADisable>:
add    $0x40,%edi
orl    $0x1,(%rdi)
andl   $0xfffffff9,(%rdi)
ret

LLVM IR (-O0):
define void @UARTDMADisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 64
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1
store volatile i32 %8, i32* %6
%9 = load i32, i32* %2
%10 = add i32 %9, 64
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, -7
store volatile i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @UARTDMADisable(i32 %0) {
%2 = add i32 %0, 64
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1
store volatile i32 %6, i32* %4
%7 = load volatile i32, i32* %4
%8 = and i32 %7, -7
store volatile i32 %8, i32* %4
ret void
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int /*<<< orphan*/);
int getopt(int argc, char *const *argv, const char *optstring) {
  return _getopt_internal(argc, argv, optstring, (const struct option *)0,
                          (int *)0, 0);
}


x86 assembly (clang, -O0):
<getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 @_getopt_internal(i32 %7, i8** %8, i8* %9, %struct.option* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* null, i32* null, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
char *strerror(int /*<<< orphan*/);
void unix_error(char *msg) {
  fprintf(stdout, "***%s: %s\n", msg, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<unix_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unix_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebp
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [11 x i8] c"***%s: %s\0A\00"
@errno = global i32 0
define void @unix_error(i8* %0) {
%2 = load i32, i32* @stdout
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
void testErrorInMacro(int *p) {
  int i = (((p) != 0) ? 0 : *p);
  (void)i;
}


x86 assembly (clang, -O0):
<testErrorInMacro>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111d <testErrorInMacro+0x1d>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <testErrorInMacro+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @testErrorInMacro(i32* nocapture %0) {
ret void
}
/* Variables and functions */
void *realloc_func(void *, size_t);
void *default_realloc_ex(void *str, size_t num, const char *file, int line) {
  return realloc_func(str, num);
}


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

x86 assembly (clang, -O2):
<default_realloc_ex>:
jmp    1030 <realloc_func@plt>

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

LLVM IR (-O2):
define i8* @default_realloc_ex(i8* %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i8* @realloc_func(i8* %0, i64 %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ concat(char *, char *);
void diran(char *binary, int data, int h) {
  for (; h; h >>= 1) {
    concat(binary, data & h ? "1" : "0");
  }
}


x86 assembly (clang, -O0):
<diran>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115e <diran+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    -0x10(%rbp),%ecx
lea    0xec5(%rip),%rsi
lea    0xebc(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
call   1030 <concat@plt>
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1122 <diran+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diran>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     115b <diran+0x4b>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%r13
lea    0xed4(%rip),%r15
lea    0xecb(%rip),%r12
mov    %edx,%ebp
nopw   0x0(%rax,%rax,1)
test   %r14d,%ebx
mov    %r12,%rsi
cmove  %r15,%rsi
mov    %r13,%rdi
call   1030 <concat@plt>
sar    %ebp
cmp    $0x1,%ebx
mov    %ebp,%ebx
ja     1140 <diran+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @diran(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %19, %3
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%18 = call i32 @concat(i8* %11, i8* %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %6
%21 = ashr i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @diran(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ %2, %3 ]
%7 = and i32 %6, %1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%10 = tail call i32 @concat(i8* %0, i8* %9)
%11 = ashr i32 %6, 1
%12 = icmp ult i32 %6, 2
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __lock_page_nosync(struct page *);
int /*<<< orphan*/ trylock_page(struct page *);
__attribute__((always_)) void lock_page_nosync(struct page *page) {
  do {
    do {
    } while (0);
  } while (0);
  if (!trylock_page(page))
    __lock_page_nosync(page);
}


x86 assembly (clang, -O0):
<lock_page_nosync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1131 <lock_page_nosync+0x11>
jmp    1136 <lock_page_nosync+0x16>
jmp    113b <lock_page_nosync+0x1b>
mov    -0x8(%rbp),%rdi
call   1030 <trylock_page@plt>
cmp    $0x0,%eax
jne    1156 <lock_page_nosync+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <__lock_page_nosync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_page_nosync>:
push   %rbx
mov    %rdi,%rbx
call   1030 <trylock_page@plt>
test   %eax,%eax
je     112f <lock_page_nosync+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__lock_page_nosync@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @lock_page_nosync(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5
%7 = load %struct.page*, %struct.page** %2
%8 = call i32 @trylock_page(%struct.page* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = load %struct.page*, %struct.page** %2
%12 = call i32 @__lock_page_nosync(%struct.page* %11)
br label %13
13: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @lock_page_nosync(%struct.page* %0) {
%2 = tail call i32 @trylock_page(%struct.page* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @__lock_page_nosync(%struct.page* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ is_little_endian();
uint32_t swap_if_little32(uint32_t val) {
  if (is_little_endian())
    return (val >> 24) | ((val >> 8) & 0xFF00) | ((val << 8) & 0xFF0000) |
           (val << 24);
  else
    return val;
}


x86 assembly (clang, -O0):
<swap_if_little32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <is_little_endian@plt>
cmp    $0x0,%rax
je     115e <swap_if_little32+0x4e>
mov    -0x8(%rbp),%eax
sar    $0x18,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <swap_if_little32+0x54>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_if_little32>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <is_little_endian@plt>
test   %rax,%rax
je     1143 <swap_if_little32+0x33>
mov    %ebx,%eax
sar    $0x18,%eax
mov    %ebx,%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
mov    %ebx,%edx
shl    $0x8,%edx
and    $0xff0000,%edx
shl    $0x18,%ebx
or     %eax,%ebx
or     %ecx,%ebx
or     %edx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @swap_if_little32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @is_little_endian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %1
%7 = load i32, i32* %3
%8 = ashr i32 %7, 24
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = and i32 %10, 65280
%12 = or i32 %8, %11
%13 = load i32, i32* %3
%14 = shl i32 %13, 8
%15 = and i32 %14, 16711680
%16 = or i32 %12, %15
%17 = load i32, i32* %3
%18 = shl i32 %17, 24
%19 = or i32 %16, %18
store i32 %19, i32* %2
br label %22
20: ; preds = %1
%21 = load i32, i32* %3
store i32 %21, i32* %2
br label %22
22: ; preds = %20, %6
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @swap_if_little32(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = ashr i32 %0, 24
%6 = lshr i32 %0, 8
%7 = and i32 %6, 65280
%8 = shl i32 %0, 8
%9 = and i32 %8, 16711680
%10 = shl i32 %0, 24
%11 = or i32 %10, %5
%12 = or i32 %11, %7
%13 = or i32 %12, %9
br label %14
14: ; preds = %1, %4
%15 = phi i32 [ %13, %4 ], [ %0, %1 ]
ret i32 %15
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
int get_XMotionEvent_send_event(void *_p) {
  return (int)((XMotionEvent *)_p)->send_event;
}


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

x86 assembly (clang, -O2):
<get_XMotionEvent_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XMotionEvent_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XMotionEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void gtk_rc_get_style_by_paths() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_get_style_by_paths() {
ret void
}
int main() {
  int x;
  int y;
  x = 3;
  y = --x;
  return y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
void halt_execution(void) {
  if (is_privileged()) {
    asm("hlt");
  }
}


x86 assembly (clang, -O0):
<halt_execution>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_privileged@plt>
cmp    $0x0,%eax
je     1125 <halt_execution+0x15>
hlt
pop    %rbp
ret

x86 assembly (clang, -O2):
<halt_execution>:
push   %rax
xor    %eax,%eax
call   1030 <is_privileged@plt>
test   %eax,%eax
je     111d <halt_execution+0xd>
hlt
pop    %rax
ret

LLVM IR (-O0):
define void @halt_execution() {
%1 = call i32 (...) @is_privileged()
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %4
4: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @halt_execution() {
%1 = tail call i32 (...) @is_privileged()
%2 = icmp eq i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %4
4: ; preds = %3, %0
ret void
}
/* Variables and functions */
int PAPI_assign_eventset_component(int, int);
void PAPIF_ASSIGN_EVENTSET_COMPONENT(int *EventSet, int *cidx, int *check) {
  *check = PAPI_assign_eventset_component(*EventSet, *cidx);
}


x86 assembly (clang, -O0):
<PAPIF_ASSIGN_EVENTSET_COMPONENT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <PAPI_assign_eventset_component@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_ASSIGN_EVENTSET_COMPONENT>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <PAPI_assign_eventset_component@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_ASSIGN_EVENTSET_COMPONENT(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = call i32 @PAPI_assign_eventset_component(i32 %8, i32 %10)
%12 = load i32*, i32** %6
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @PAPIF_ASSIGN_EVENTSET_COMPONENT(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @PAPI_assign_eventset_component(i32 %4, i32 %5)
store i32 %6, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_cstr(char **);
char *strdup(char const *);
int set_cstr(char **str, const char *src) {
  free_cstr(str);
  if (src != NULL)
    *str = strdup(src);
  return (*str != NULL);
}


x86 assembly (clang, -O0):
<set_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free_cstr@plt>
cmpq   $0x0,-0x10(%rbp)
je     1157 <set_cstr+0x37>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <free_cstr@plt>
test   %r14,%r14
je     1141 <set_cstr+0x21>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
jmp    1144 <set_cstr+0x24>
mov    (%rbx),%rax
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @set_cstr(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = call i32 @free_cstr(i8** %5)
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i8* @strdup(i8* %10)
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
br label %13
13: ; preds = %9, %2
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = icmp ne i8* %15, null
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @set_cstr(i8** %0, i8* %1) {
%3 = tail call i32 @free_cstr(i8** %0)
%4 = icmp eq i8* %1, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = load i8*, i8** %0
br label %9
7: ; preds = %2
%8 = tail call i8* @strdup(i8* %1)
store i8* %8, i8** %0
br label %9
9: ; preds = %5, %7
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
%11 = icmp ne i8* %10, null
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
scalar_t__ system(char *);
void output_bad_records(char *station_bad_file, char *shef_bad_file,
                        char *insert_bad_file) {
  char sys_string[1024];
  sprintf(sys_string, "cat %s %s %s | html_table.e '^^Bad Records' '' ''",
          station_bad_file, shef_bad_file, insert_bad_file);
  if (system(sys_string)) {
  };
}


x86 assembly (clang, -O0):
<output_bad_records>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xeaf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x420(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1171 <output_bad_records+0x51>
jmp    1171 <output_bad_records+0x51>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_bad_records>:
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xec8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"cat %s %s %s | html_table.e '^^Bad Records' '' ''\00"
define void @output_bad_records(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i64 @system(i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
br label %17
17: ; preds = %16, %3
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"cat %s %s %s | html_table.e '^^Bad Records' '' ''\00"
define void @output_bad_records(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%7 = call i64 @system(i8* %5)
ret void
}
void echoline(line, length) char *line;
int length;
{
  int i;
  for (i = 0; i < length; i++) {
    echo(*line++);
  }
}


x86 assembly (clang, -O0):
<echoline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <echoline+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <echoline+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echoline>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <echoline+0x35>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
xor    %eax,%eax
call   1030 <echo@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <echoline+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @echoline(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i8* [ %7, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @echo to i32 (i32, ...)*)(i32 %9)
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
short unalShort(const short *adr) {
  int *p = (int *)((int)adr & 0xfffffffc);
  int v = *p;
  int w = ((int)adr & 3);
  if (w == 0)
    return (v & 0xffff);
  else
    return (v >> 16);
}


x86 assembly (clang, -O0):
<unalShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffc,%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1143 <unalShort+0x43>
mov    -0x1c(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0x2(%rbp)
jmp    114d <unalShort+0x4d>
mov    -0x1c(%rbp),%eax
sar    $0x10,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unalShort>:
mov    %edi,%eax
and    $0xfffffffc,%eax
mov    (%rax),%ecx
mov    %ecx,%eax
shr    $0x10,%eax
test   $0x3,%dil
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @unalShort(i16* %0) {
%2 = alloca i16
%3 = alloca i16*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i16* %0, i16** %3
%7 = load i16*, i16** %3
%8 = ptrtoint i16* %7 to i32
%9 = and i32 %8, -4
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %4
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i16*, i16** %3
%15 = ptrtoint i16* %14 to i32
%16 = and i32 %15, 3
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %1
%20 = load i32, i32* %5
%21 = and i32 %20, 65535
%22 = trunc i32 %21 to i16
store i16 %22, i16* %2
br label %27
23: ; preds = %1
%24 = load i32, i32* %5
%25 = ashr i32 %24, 16
%26 = trunc i32 %25 to i16
store i16 %26, i16* %2
br label %27
27: ; preds = %23, %19
%28 = load i16, i16* %2
ret i16 %28
}

LLVM IR (-O2):
define signext i16 @unalShort(i16* %0) {
%2 = ptrtoint i16* %0 to i64
%3 = and i64 %2, 4294967292
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* %4
%6 = and i64 %2, 3
%7 = icmp eq i64 %6, 0
%8 = lshr i32 %5, 16
%9 = select i1 %7, i32 %5, i32 %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Variables and functions */
int GetMemW(unsigned long);
long GetMemL(unsigned long address) {
  return ((GetMemW(address) << 16) | GetMemW(address + 2));
}


x86 assembly (clang, -O0):
<GetMemL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <GetMemW@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <GetMemW@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMemL>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <GetMemW@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
add    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <GetMemW@plt>
or     %ebp,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @GetMemL(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @GetMemW(i64 %3)
%5 = shl i32 %4, 16
%6 = load i64, i64* %2
%7 = add i64 %6, 2
%8 = call i32 @GetMemW(i64 %7)
%9 = or i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @GetMemL(i64 %0) {
%2 = tail call i32 @GetMemW(i64 %0)
%3 = shl i32 %2, 16
%4 = add i64 %0, 2
%5 = tail call i32 @GetMemW(i64 %4)
%6 = or i32 %3, %5
%7 = sext i32 %6 to i64
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t rtcp_xr_get_bt(const uint8_t *p_rtcp_xr_b) { return p_rtcp_xr_b[0]; }


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

x86 assembly (clang, -O2):
<rtcp_xr_get_bt>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rtcp_xr_get_bt(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rtcp_xr_get_bt(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, size_t, int);
size_t b_string_memset(void *dummy) {
  char *buf = (char *)malloc(500000);
  size_t i;
  for (i = 0; i < 100; i++)
    memset(buf + i, i, 500000 - i);
  free(buf);
  return 0;
}


x86 assembly (clang, -O0):
<b_string_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7a120,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x64,-0x18(%rbp)
jae    118a <b_string_memset+0x5a>
mov    -0x10(%rbp),%rdi
add    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x7a120,%eax
sub    -0x18(%rbp),%rax
mov    %eax,%edx
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <b_string_memset+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_string_memset>:
push   %rbp
push   %r14
push   %rbx
mov    $0x7a120,%ebp
mov    $0x7a120,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%r14,%rbx,1),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memset@plt>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x64,%rbx
jne    1150 <b_string_memset+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @b_string_memset(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = call i64 @malloc(i32 500000)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
store i64 0, i64* %4
br label %7
7: ; preds = %19, %1
%8 = load i64, i64* %4
%9 = icmp ult i64 %8, 100
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i64, i64* %4
%15 = load i64, i64* %4
%16 = sub i64 500000, %15
%17 = trunc i64 %16 to i32
%18 = call i32 @memset(i8* %13, i64 %14, i32 %17)
br label %19
19: ; preds = %10
%20 = load i64, i64* %4
%21 = add i64 %20, 1
store i64 %21, i64* %4
br label %7
22: ; preds = %7
%23 = load i8*, i8** %3
%24 = call i32 @free(i8* %23)
ret i64 0
}

LLVM IR (-O2):
define i64 @b_string_memset(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 500000)
%3 = inttoptr i64 %2 to i8*
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %10, %4 ]
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = trunc i64 %5 to i32
%8 = sub nuw nsw i32 500000, %7
%9 = tail call i32 @memset(i8* %6, i64 %5, i32 %8)
%10 = add nuw nsw i64 %5, 1
%11 = icmp eq i64 %10, 100
br i1 %11, label %12, label %4
12: ; preds = %4
%13 = tail call i32 @free(i8* %3)
ret i64 0
}
int TryAssemble_IMPORT(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @TryAssemble_IMPORT() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ParamWrite(int, int);
void init_app_adt7310() {
  ParamWrite(0x0000, 0x0000);
  ParamWrite(0x0001, 0x0000);
  ParamWrite(0x0002, 0x000A);
  ParamWrite(0x0003, 0x0000);
  ParamWrite(0x0004, 0x5DC0);
  ParamWrite(0x0005, 0x001E);
}


x86 assembly (clang, -O0):
<init_app_adt7310>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <ParamWrite@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <ParamWrite@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x4,%edi
mov    $0x5dc0,%esi
call   1030 <ParamWrite@plt>
mov    $0x5,%edi
mov    $0x1e,%esi
call   1030 <ParamWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_app_adt7310>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <ParamWrite@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x4,%edi
mov    $0x5dc0,%esi
call   1030 <ParamWrite@plt>
mov    $0x5,%edi
mov    $0x1e,%esi
pop    %rax
jmp    1030 <ParamWrite@plt>

LLVM IR (-O0):
define void @init_app_adt7310() {
%1 = call i32 @ParamWrite(i32 0, i32 0)
%2 = call i32 @ParamWrite(i32 1, i32 0)
%3 = call i32 @ParamWrite(i32 2, i32 10)
%4 = call i32 @ParamWrite(i32 3, i32 0)
%5 = call i32 @ParamWrite(i32 4, i32 24000)
%6 = call i32 @ParamWrite(i32 5, i32 30)
ret void
}

LLVM IR (-O2):
define void @init_app_adt7310() {
%1 = tail call i32 @ParamWrite(i32 0, i32 0)
%2 = tail call i32 @ParamWrite(i32 1, i32 0)
%3 = tail call i32 @ParamWrite(i32 2, i32 10)
%4 = tail call i32 @ParamWrite(i32 3, i32 0)
%5 = tail call i32 @ParamWrite(i32 4, i32 24000)
%6 = tail call i32 @ParamWrite(i32 5, i32 30)
ret void
}
int ptyControlGet(int fd, char *name) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @ptyControlGet(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t get_frame_id() {
  static uint8_t frame_id;
  if (frame_id == 255)
    frame_id = 0;
  return ++frame_id;
}


x86 assembly (clang, -O0):
<get_frame_id>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0xff,0x2f16(%rip)
jne    111e <get_frame_id+0x1e>
movl   $0x0,0x2f06(%rip)
mov    0x2f00(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef7(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_frame_id>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
cmp    $0xff,%eax
mov    $0x1,%eax
cmovne %ecx,%eax
mov    %eax,0x2f08(%rip)
ret

LLVM IR (-O0):
@get_frame_id.frame_id = internal global i32 0
define i32 @get_frame_id() {
%1 = load i32, i32* @get_frame_id.frame_id
%2 = icmp eq i32 %1, 255
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @get_frame_id.frame_id
br label %4
4: ; preds = %3, %0
%5 = load i32, i32* @get_frame_id.frame_id
%6 = add nsw i32 %5, 1
store i32 %6, i32* @get_frame_id.frame_id
ret i32 %6
}

LLVM IR (-O2):
@get_frame_id.frame_id = internal unnamed_addr global i32 0
define i32 @get_frame_id() {
%1 = load i32, i32* @get_frame_id.frame_id
%2 = icmp eq i32 %1, 255
%3 = add nsw i32 %1, 1
%4 = select i1 %2, i32 1, i32 %3
store i32 %4, i32* @get_frame_id.frame_id
ret i32 %4
}
void ARGBAddRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGBAddRow_C() {
ret void
}
/* Type definitions */
struct dthr_semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dthr_semaphore_drop_no_yield(struct dthr_semaphore *);
int /*<<< orphan*/ dthr_thread_yield();
void dthr_semaphore_drop(struct dthr_semaphore *sema) {
  ;
  ;
  dthr_semaphore_drop_no_yield(sema);
  dthr_thread_yield();
  ;
  ;
}


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

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

LLVM IR (-O0):
%struct.dthr_semaphore = type { i32 }
define void @dthr_semaphore_drop(%struct.dthr_semaphore* %0) {
%2 = alloca %struct.dthr_semaphore*
store %struct.dthr_semaphore* %0, %struct.dthr_semaphore** %2
%3 = load %struct.dthr_semaphore*, %struct.dthr_semaphore** %2
%4 = call i32 @dthr_semaphore_drop_no_yield(%struct.dthr_semaphore* %3)
%5 = call i32 (...) @dthr_thread_yield()
ret void
}

LLVM IR (-O2):
%struct.dthr_semaphore = type { i32 }
define void @dthr_semaphore_drop(%struct.dthr_semaphore* %0) {
%2 = tail call i32 @dthr_semaphore_drop_no_yield(%struct.dthr_semaphore* %0)
%3 = tail call i32 (...) @dthr_thread_yield()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo_len(char const *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  const char *a = "OLOL";
  printf("size of a = %d\n", foo_len(a));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <foo_len@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <foo_len@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"OLOL\00"
@.str.1 = [16 x i8] c"size of a = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @foo_len(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"OLOL\00"
@.str.1 = [16 x i8] c"size of a = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo_len(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
int cmp_doubles(const void *e1, const void *e2) {
  double *d1, *d2;
  d1 = (double *)e1;
  d2 = (double *)e2;
  if (*d1 > *d2)
    return 1;
  if (*d1 < *d2)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_doubles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    113e <cmp_doubles+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    116b <cmp_doubles+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1164 <cmp_doubles+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <cmp_doubles+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_doubles>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_doubles(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = fcmp olt double %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}