xunge/DecIR huggingface dataset:
void platform_copy_memory(void *destination, void *source, long size) {}


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

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

LLVM IR (-O0):
define void @platform_copy_memory(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
ret void
}

LLVM IR (-O2):
define void @platform_copy_memory(i8* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_stack(int);
int main(int argc, char *argv[]) {
  test_stack(0);
  test_stack(16);
  test_stack(237);
  test_stack(1024);
  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)
xor    %edi,%edi
call   1030 <test_stack@plt>
mov    $0x10,%edi
call   1030 <test_stack@plt>
mov    $0xed,%edi
call   1030 <test_stack@plt>
mov    $0x400,%edi
call   1030 <test_stack@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <test_stack@plt>
mov    $0x10,%edi
call   1030 <test_stack@plt>
mov    $0xed,%edi
call   1030 <test_stack@plt>
mov    $0x400,%edi
call   1030 <test_stack@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 @test_stack(i32 0)
%7 = call i32 @test_stack(i32 16)
%8 = call i32 @test_stack(i32 237)
%9 = call i32 @test_stack(i32 1024)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_stack(i32 0)
%4 = tail call i32 @test_stack(i32 16)
%5 = tail call i32 @test_stack(i32 237)
%6 = tail call i32 @test_stack(i32 1024)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M500_f(char *s) {
  debug("M500_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M500_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M500_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M500_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M500_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
one1(a) { nop(); }


x86 assembly (clang, -O0):
<one1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nop@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @one1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @nop()
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @one1(i32 %0) {
%2 = tail call i32 (...) @nop()
ret i32 undef
}
void _backlight_off(void) { (*(volatile unsigned long *)0x80000340) &= ~0x2; }


x86 assembly (clang, -O0):
<_backlight_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000340,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0x80000340,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_backlight_off>:
mov    $0x80000340,%eax
andq   $0xfffffffffffffffd,(%rax)
ret

LLVM IR (-O0):
define void @_backlight_off() {
%1 = load volatile i64, i64* inttoptr (i64 2147484480 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2147484480 to i64*)
ret void
}

LLVM IR (-O2):
define void @_backlight_off() {
%1 = load volatile i64, i64* inttoptr (i64 2147484480 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2147484480 to i64*)
ret void
}
/* Type definitions */
struct type {
  int dummy;
};
struct compile_state {
  int dummy;
};

/* Variables and functions */
size_t reg_size_of(struct compile_state *, struct type *);
size_t registers_of(struct compile_state *state, struct type *type) {
  size_t registers;
  registers = reg_size_of(state, type);
  registers += 32 - 1;
  registers /= 32;
  return registers;
}


x86 assembly (clang, -O0):
<registers_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <reg_size_of@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1f,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x5,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<registers_of>:
push   %rax
call   1030 <reg_size_of@plt>
add    $0x1f,%rax
shr    $0x5,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.compile_state = type { i32 }
%struct.type = type { i32 }
define i64 @registers_of(%struct.compile_state* %0, %struct.type* %1) {
%3 = alloca %struct.compile_state*
%4 = alloca %struct.type*
%5 = alloca i64
store %struct.compile_state* %0, %struct.compile_state** %3
store %struct.type* %1, %struct.type** %4
%6 = load %struct.compile_state*, %struct.compile_state** %3
%7 = load %struct.type*, %struct.type** %4
%8 = call i64 @reg_size_of(%struct.compile_state* %6, %struct.type* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = add i64 %9, 31
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = udiv i64 %11, 32
store i64 %12, i64* %5
%13 = load i64, i64* %5
ret i64 %13
}

LLVM IR (-O2):
%struct.compile_state = type { i32 }
%struct.type = type { i32 }
define i64 @registers_of(%struct.compile_state* %0, %struct.type* %1) {
%3 = tail call i64 @reg_size_of(%struct.compile_state* %0, %struct.type* %1)
%4 = add i64 %3, 31
%5 = lshr i64 %4, 5
ret i64 %5
}
void put_4_le(unsigned char *ptr, unsigned int data) {
  ptr[0] = data & 0xff;
  ptr[1] = (data >> 8) & 0xff;
  ptr[2] = (data >> 16) & 0xff;
  ptr[3] = (data >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<put_4_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_4_le>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @put_4_le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = lshr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = lshr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @put_4_le(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_scheme_comment_entities();
int /*<<< orphan*/ test_scheme_comments();
void all_scheme_tests() {
  test_scheme_comments();
  test_scheme_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_scheme_tests() {
%1 = call i32 (...) @test_scheme_comments()
%2 = call i32 (...) @test_scheme_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_scheme_tests() {
%1 = tail call i32 (...) @test_scheme_comments()
%2 = tail call i32 (...) @test_scheme_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_disable_interrupts();
void INTERRUPT_GlobalDisable(void) { __builtin_disable_interrupts(); }


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

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

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

LLVM IR (-O2):
define void @INTERRUPT_GlobalDisable() {
%1 = tail call i32 (...) @__builtin_disable_interrupts()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ tzset();
int /*<<< orphan*/ unsetenv(char *);
void tz_pop(char *oldtz) {
  if (oldtz) {
    setenv("TZ", oldtz, 1);
    free(oldtz);
  } else {
    unsetenv("TZ");
  }
  tzset();
}


x86 assembly (clang, -O0):
<tz_pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117a <tz_pop+0x3a>
mov    -0x8(%rbp),%rsi
lea    0xe9e(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    1186 <tz_pop+0x46>
lea    0xe7f(%rip),%rdi
call   1060 <unsetenv@plt>
mov    $0x0,%al
call   1050 <tzset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tz_pop>:
push   %rbx
test   %rdi,%rdi
je     1167 <tz_pop+0x27>
mov    %rdi,%rbx
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1173 <tz_pop+0x33>
lea    0xe92(%rip),%rdi
call   1060 <unsetenv@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <tzset@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"TZ\00"
define void @tz_pop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6, i32 1)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
br label %12
10: ; preds = %1
%11 = call i32 @unsetenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %5
%13 = call i32 (...) @tzset()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"TZ\00"
define void @tz_pop(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
%5 = tail call i32 @free(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @unsetenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = tail call i32 (...) @tzset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ packet_data_last(int /*<<< orphan*/, int /*<<< orphan*/);
void packet_data_last0(uint8_t cnt) { packet_data_last(cnt, 0); }


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

x86 assembly (clang, -O2):
<packet_data_last0>:
xor    %esi,%esi
jmp    1030 <packet_data_last@plt>

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

LLVM IR (-O2):
define void @packet_data_last0(i32 %0) {
%2 = tail call i32 @packet_data_last(i32 %0, i32 0)
ret void
}
void shUnpremultiplyFramebuffer() {}


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

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

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

LLVM IR (-O2):
define void @shUnpremultiplyFramebuffer() {
ret void
}
unsigned long pack(unsigned char *b) {
  return ((unsigned long)b[3] << 24) | ((unsigned long)b[2] << 16) |
         ((unsigned long)b[1] << 8) | (unsigned long)b[0];
}


x86 assembly (clang, -O0):
<pack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @pack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl i64 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl i64 %11, 16
%13 = or i64 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = shl i64 %17, 8
%19 = or i64 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = zext i8 %22 to i64
%24 = or i64 %19, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @pack(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = shl nuw nsw i64 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i64
%9 = shl nuw nsw i64 %8, 16
%10 = or i64 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = shl nuw nsw i64 %13, 8
%15 = or i64 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Variables and functions */
scalar_t__ isspace(int);
void stress_munmap_clean_path(char *path) {
  char *ptr = path;
  while (*ptr) {
    if (isspace((int)*ptr)) {
      *ptr = '\0';
      break;
    }
    ptr++;
  }
}


x86 assembly (clang, -O0):
<stress_munmap_clean_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <stress_munmap_clean_path+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1153 <stress_munmap_clean_path+0x43>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1164 <stress_munmap_clean_path+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <stress_munmap_clean_path+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_munmap_clean_path>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <stress_munmap_clean_path+0x28>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    113a <stress_munmap_clean_path+0x2a>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <stress_munmap_clean_path+0x10>
pop    %rbx
ret
movb   $0x0,-0x1(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @stress_munmap_clean_path(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %4
store i8 0, i8* %6
br label %15
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1, %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ASIC_Finish();
int /*<<< orphan*/ AudioEvent_Finish();
int /*<<< orphan*/ Cartridge_Remove();
int /*<<< orphan*/ Cassette_Finish();
int /*<<< orphan*/ DiskImage_Finish();
int /*<<< orphan*/ ExpansionRom_Finish();
int /*<<< orphan*/ FreeEmulatorMemory();
int /*<<< orphan*/ Render_Finish();
int /*<<< orphan*/ Tape_Remove();
void CPC_Finish(void) {
  Render_Finish();
  Cassette_Finish();
  AudioEvent_Finish();
  Cartridge_Remove();
  ASIC_Finish();
  ExpansionRom_Finish();
  FreeEmulatorMemory();
  DiskImage_Finish();
  Tape_Remove();
}


x86 assembly (clang, -O0):
<CPC_Finish>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Render_Finish@plt>
mov    $0x0,%al
call   1070 <Cassette_Finish@plt>
mov    $0x0,%al
call   1050 <AudioEvent_Finish@plt>
mov    $0x0,%al
call   10a0 <Cartridge_Remove@plt>
mov    $0x0,%al
call   1080 <ASIC_Finish@plt>
mov    $0x0,%al
call   1090 <ExpansionRom_Finish@plt>
mov    $0x0,%al
call   1040 <FreeEmulatorMemory@plt>
mov    $0x0,%al
call   10b0 <DiskImage_Finish@plt>
mov    $0x0,%al
call   1060 <Tape_Remove@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPC_Finish>:
push   %rax
xor    %eax,%eax
call   1030 <Render_Finish@plt>
xor    %eax,%eax
call   1070 <Cassette_Finish@plt>
xor    %eax,%eax
call   1050 <AudioEvent_Finish@plt>
xor    %eax,%eax
call   10a0 <Cartridge_Remove@plt>
xor    %eax,%eax
call   1080 <ASIC_Finish@plt>
xor    %eax,%eax
call   1090 <ExpansionRom_Finish@plt>
xor    %eax,%eax
call   1040 <FreeEmulatorMemory@plt>
xor    %eax,%eax
call   10b0 <DiskImage_Finish@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <Tape_Remove@plt>

LLVM IR (-O0):
define void @CPC_Finish() {
%1 = call i32 (...) @Render_Finish()
%2 = call i32 (...) @Cassette_Finish()
%3 = call i32 (...) @AudioEvent_Finish()
%4 = call i32 (...) @Cartridge_Remove()
%5 = call i32 (...) @ASIC_Finish()
%6 = call i32 (...) @ExpansionRom_Finish()
%7 = call i32 (...) @FreeEmulatorMemory()
%8 = call i32 (...) @DiskImage_Finish()
%9 = call i32 (...) @Tape_Remove()
ret void
}

LLVM IR (-O2):
define void @CPC_Finish() {
%1 = tail call i32 (...) @Render_Finish()
%2 = tail call i32 (...) @Cassette_Finish()
%3 = tail call i32 (...) @AudioEvent_Finish()
%4 = tail call i32 (...) @Cartridge_Remove()
%5 = tail call i32 (...) @ASIC_Finish()
%6 = tail call i32 (...) @ExpansionRom_Finish()
%7 = tail call i32 (...) @FreeEmulatorMemory()
%8 = tail call i32 (...) @DiskImage_Finish()
%9 = tail call i32 (...) @Tape_Remove()
ret void
}
/* Variables and functions */
int __syscall_fsync(int);
int __libc_fsync(int fd) {
  if (1)
    return __syscall_fsync(fd);
}


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

x86 assembly (clang, -O2):
<__libc_fsync>:
jmp    1030 <__syscall_fsync@plt>

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

LLVM IR (-O2):
define i32 @__libc_fsync(i32 %0) {
%2 = tail call i32 @__syscall_fsync(i32 %0)
ret i32 %2
}
/* Variables and functions */
float __ocml_sqrt_rtp_f32(float);
float __fsqrt_rd(float x) { return __ocml_sqrt_rtp_f32(x); }


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

x86 assembly (clang, -O2):
<__fsqrt_rd>:
jmp    1030 <__ocml_sqrt_rtp_f32@plt>

LLVM IR (-O0):
define float @__fsqrt_rd(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__ocml_sqrt_rtp_f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__fsqrt_rd(float %0) {
%2 = tail call float @__ocml_sqrt_rtp_f32(float %0)
ret float %2
}
int compare_ulong(const void *a, const void *b) {
  return *(unsigned long *)a - *(unsigned long *)b;
}


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

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

LLVM IR (-O0):
define i32 @compare_ulong(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare_ulong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void displayArray(int *array, int count) {
  for (int i = 0; i < count; i++) {
    printf("Value in array at index[%d]= %d\n", i, array[i]);
  }
}


x86 assembly (clang, -O0):
<displayArray>:
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    115a <displayArray+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <displayArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <displayArray+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <displayArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Value in array at index[%d]= %d\0A\00"
define void @displayArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Value in array at index[%d]= %d\0A\00"
define void @displayArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stderr;
__attribute__((visibility("default"))) FILE *get_stderr() { return stderr; }


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

x86 assembly (clang, -O2):
<get_stderr>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stderr = global i32* null
define i32* @get_stderr() {
%1 = load i32*, i32** @stderr
ret i32* %1
}

LLVM IR (-O2):
@stderr = global i32* null
define i32* @get_stderr() {
%1 = load i32*, i32** @stderr
ret i32* %1
}
void all_threads_running(void) {}


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

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

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

LLVM IR (-O2):
define void @all_threads_running() {
ret void
}
void RasterNibbleModeDisable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x28)))) &= ~(0x00400000u);
}


x86 assembly (clang, -O0):
<RasterNibbleModeDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffbfffff,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterNibbleModeDisable>:
add    $0x28,%edi
andl   $0xffbfffff,(%rdi)
ret

LLVM IR (-O0):
define void @RasterNibbleModeDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 40
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -4194305
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @RasterNibbleModeDisable(i32 %0) {
%2 = add i32 %0, 40
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -4194305
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
char *cgi_ltrim(int /*<<< orphan*/);
int /*<<< orphan*/ cgi_rtrim(char *);
char *cgi_trim(char *str) { return cgi_ltrim(cgi_rtrim(str)); }


x86 assembly (clang, -O0):
<cgi_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cgi_rtrim@plt>
mov    %eax,%edi
call   1030 <cgi_ltrim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgi_trim>:
push   %rax
call   1040 <cgi_rtrim@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <cgi_ltrim@plt>

LLVM IR (-O0):
define i8* @cgi_trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cgi_rtrim(i8* %3)
%5 = call i8* @cgi_ltrim(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @cgi_trim(i8* %0) {
%2 = tail call i32 @cgi_rtrim(i8* %0)
%3 = tail call i8* @cgi_ltrim(i32 %2)
ret i8* %3
}
void removeLF(char *str) {
  int i = 0;
  while (str[i] != '\0')
    ++i;
  if (i == 0)
    return;
  str[i - 1] = 0;
}


x86 assembly (clang, -O0):
<removeLF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <removeLF+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <removeLF+0xf>
cmpl   $0x0,-0xc(%rbp)
jne    1141 <removeLF+0x41>
jmp    1152 <removeLF+0x52>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeLF>:
movabs $0xfffffffe00000000,%rax
ff ff ff
xor    %edx,%edx
movabs $0x100000000,%rcx
cs nopw 0x0(%rax,%rax,1)
add    %rcx,%rax
cmpb   $0x0,(%rdi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <removeLF+0x20>
cmp    $0x1,%edx
je     113a <removeLF+0x3a>
sar    $0x20,%rax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @removeLF(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = shl i64 %3, 32
%13 = add i64 %12, -4294967296
%14 = ashr exact i64 %13, 32
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %8, %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetVolumeDBRange(void *, int,
                                                                  int);
int /*<<< orphan*/ printf(char *, unsigned int, char *);
void UPnPRenderingControl_GetVolumeDBRange(void *upnptoken,
                                           unsigned int InstanceID,
                                           char *Channel) {
  printf("Invoke: UPnPRenderingControl_GetVolumeDBRange(%u,%s);\r\n",
         InstanceID, Channel);
  UPnPResponse_RenderingControl_GetVolumeDBRange(upnptoken, 25000, 25000);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetVolumeDBRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x61a8,%edx
mov    %edx,%esi
call   1030 <UPnPResponse_RenderingControl_GetVolumeDBRange@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_GetVolumeDBRange>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x61a8,%esi
mov    $0x61a8,%edx
pop    %rbx
jmp    1030 <UPnPResponse_RenderingControl_GetVolumeDBRange@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"Invoke: UPnPRenderingControl_GetVolumeDBRange(%u,%s);\0D\0A\00"
define void @UPnPRenderingControl_GetVolumeDBRange(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_RenderingControl_GetVolumeDBRange(i8* %10, i32 25000, i32 25000)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"Invoke: UPnPRenderingControl_GetVolumeDBRange(%u,%s);\0D\0A\00"
define void @UPnPRenderingControl_GetVolumeDBRange(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = tail call i32 @UPnPResponse_RenderingControl_GetVolumeDBRange(i8* %0, i32 25000, i32 25000)
ret void
}
unsigned char f23(unsigned char x, int y) { return (x >> (8 - y)) ^ (x << y); }


x86 assembly (clang, -O0):
<f23>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f23>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f23(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sub nsw i32 8, %7
%9 = ashr i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = shl i32 %11, %12
%14 = xor i32 %9, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @f23(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub nsw i32 8, %1
%5 = lshr i32 %3, %4
%6 = shl i32 %3, %1
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
int nrfx_usbd_errata_type_52840();
bool nrfx_usbd_errata_type_52840_eng_a(void) {
  return nrfx_usbd_errata_type_52840();
}


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

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

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

LLVM IR (-O2):
define i32 @nrfx_usbd_errata_type_52840_eng_a() {
%1 = tail call i32 (...) @nrfx_usbd_errata_type_52840()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  const double SCALE = 0.333;
  double shoe, foot;
  shoe = 9.0;
  foot = SCALE * shoe + 7.31;
  printf("Shoe size (men's) foot length\n");
  printf("%10.1f %15.2f inches\n", shoe, foot);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xead(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
movsd  0xeb4(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Shoe size (men's) foot length\0A\00"
@.str.1 = [22 x i8] c"%10.1f %15.2f inches\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 3.330000e-01, double* %2
store double 9.000000e+00, double* %3
%5 = load double, double* %3
%6 = call double @llvm.fmuladd.f64(double 3.330000e-01, double %5, double 7.310000e+00)
store double %6, double* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %8, double %9)
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"%10.1f %15.2f inches\0A\00"
@str = [30 x i8] c"Shoe size (men's) foot length\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double 9.000000e+00, double 1.030700e+01)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
int main() {
  int x;
  x = 1;
  if ((x << 1) != 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cmp    $0x2,%eax
je     112d <main+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <main+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = icmp ne i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_tebahpla();
int main(void) {
  print_tebahpla();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @print_tebahpla()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_tebahpla()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgldlb(int n) { ngen("%s\t%d(%%rbp),%%al", "movb", n); }


x86 assembly (clang, -O0):
<cgldlb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgldlb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s\09%d(%%rbp),%%al\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgldlb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s\09%d(%%rbp),%%al\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgldlb(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
do_read(void *cookie, char *p, int n) {
  printf("%s, cookie=%p, p=%p, n=%d\n", __func__, cookie, p, n);
  strncpy(p, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", n);
  return n;
}


x86 assembly (clang, -O0):
<do_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xeba(%rip),%rdi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_read>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%rdx
lea    0xecd(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    %r14,%rcx
mov    %ebx,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
movslq %ebx,%rbx
lea    0xed2(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%s, cookie=%p, p=%p, n=%d\0A\00"
@__func__.do_read = [8 x i8] c"do_read\00"
@.str.1 = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i32 @do_read(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.do_read, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = call i8* @strncpy(i8* %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i64 %13)
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s, cookie=%p, p=%p, n=%d\0A\00"
@__func__.do_read = [8 x i8] c"do_read\00"
@.str.1 = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i32 @do_read(i8* %0, i8* %1, i32 returned %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.do_read, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%5 = sext i32 %2 to i64
%6 = tail call i8* @strncpy(i8* dereferenceable(1) %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i64 %5)
ret i32 %2
}
/* Variables and functions */
double mod2pi_positive(double);
double mod2pi(double vin) {
  if (vin < 0)
    return -mod2pi_positive(-vin);
  else
    return mod2pi_positive(vin);
}


x86 assembly (clang, -O0):
<mod2pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116d <mod2pi+0x5d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <mod2pi_positive@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117c <mod2pi+0x6c>
movsd  -0x10(%rbp),%xmm0
call   1030 <mod2pi_positive@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2pi>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1132 <mod2pi+0x22>
push   %rax
xorpd  0xedd(%rip),%xmm0
call   1030 <mod2pi_positive@plt>
xorpd  0xed0(%rip),%xmm0
pop    %rax
ret
jmp    1030 <mod2pi_positive@plt>

LLVM IR (-O0):
define double @mod2pi(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = call double @mod2pi_positive(double %8)
%10 = fneg double %9
store double %10, double* %2
br label %14
11: ; preds = %1
%12 = load double, double* %3
%13 = call double @mod2pi_positive(double %12)
store double %13, double* %2
br label %14
14: ; preds = %11, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @mod2pi(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @mod2pi_positive(double %4)
%6 = fneg double %5
br label %9
7: ; preds = %1
%8 = tail call double @mod2pi_positive(double %0)
br label %9
9: ; preds = %7, %3
%10 = phi double [ %6, %3 ], [ %8, %7 ]
ret double %10
}
unsigned int g(unsigned int b) { return b & 0xfff0ffff; }


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

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
and    $0xfff0ffff,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = and i32 %0, -983041
ret i32 %2
}
/* Type definitions */
struct dirent {
  char *d_name;
};

/* Variables and functions */
int filter(const struct dirent *dir) {
  if (dir->d_name[0] == '.')
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<filter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1127 <filter+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <filter+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmpb   $0x2e,(%rcx)
setne  %al
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i32 @filter(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 46
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i32 @filter(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 46
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct mm_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
void flush_tlb_mm(struct mm_struct *mm) { BUG(); }


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

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

LLVM IR (-O0):
%struct.mm_struct = type { i32 }
define void @flush_tlb_mm(%struct.mm_struct* %0) {
%2 = alloca %struct.mm_struct*
store %struct.mm_struct* %0, %struct.mm_struct** %2
%3 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
%struct.mm_struct = type { i32 }
define void @flush_tlb_mm(%struct.mm_struct* nocapture readnone %0) {
%2 = tail call i32 (...) @BUG()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ readPWM(int);
void PWM_ISR_2() { readPWM(2); }


x86 assembly (clang, -O0):
<PWM_ISR_2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <readPWM@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWM_ISR_2>:
mov    $0x2,%edi
jmp    1030 <readPWM@plt>

LLVM IR (-O0):
define void @PWM_ISR_2() {
%1 = call i32 @readPWM(i32 2)
ret void
}

LLVM IR (-O2):
define void @PWM_ISR_2() {
%1 = tail call i32 @readPWM(i32 2)
ret void
}