xunge/DecIR huggingface dataset:
/* Type definitions */
struct stack_st_OPENSSL_STRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_unshift(int /*<<< orphan*/ *, void const *);
int sk_OPENSSL_STRING_unshift(struct stack_st_OPENSSL_STRING *sk, char *ptr) {
  return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_STRING_unshift>:
jmp    1030 <OPENSSL_sk_unshift@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i32 @sk_OPENSSL_STRING_unshift(%struct.stack_st_OPENSSL_STRING* %0, i8* %1) {
%3 = alloca %struct.stack_st_OPENSSL_STRING*
%4 = alloca i8*
store %struct.stack_st_OPENSSL_STRING* %0, %struct.stack_st_OPENSSL_STRING** %3
store i8* %1, i8** %4
%5 = load %struct.stack_st_OPENSSL_STRING*, %struct.stack_st_OPENSSL_STRING** %3
%6 = bitcast %struct.stack_st_OPENSSL_STRING* %5 to i32*
%7 = load i8*, i8** %4
%8 = call i32 @OPENSSL_sk_unshift(i32* %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i32 @sk_OPENSSL_STRING_unshift(%struct.stack_st_OPENSSL_STRING* %0, i8* %1) {
%3 = getelementptr %struct.stack_st_OPENSSL_STRING, %struct.stack_st_OPENSSL_STRING* %0, i64 0, i32 0
%4 = tail call i32 @OPENSSL_sk_unshift(i32* %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int binsearch(int, int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int v[] = {0, 4, 8, 10, 123, 1233, 1234, 1235, 12333, 222222};
  printf("Output: %d", binsearch(11, v, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rsi
mov    $0xb,%edi
mov    $0xa,%edx
call   1030 <binsearch@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xb,%edi
mov    $0xa,%edx
call   1030 <binsearch@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.v = [10 x i32] [i32 0, i32 4, i32 8, i32 10, i32 123, i32 1233, i32 1234, i32 1235, i32 12333, i32 222222]
@.str = [11 x i8] c"Output: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @binsearch(i32 11, i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.v = [10 x i32] [i32 0, i32 4, i32 8, i32 10, i32 123, i32 1233, i32 1234, i32 1235, i32 12333, i32 222222]
@.str = [11 x i8] c"Output: %d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @binsearch(i32 11, i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test() {
  int a = 111;
  printf("%d hello world!\n", a);
}


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

x86 assembly (clang, -O2):
<test>:
lea    0xee9(%rip),%rdi
mov    $0x6f,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d hello world!\0A\00"
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
store i32 111, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d hello world!\0A\00"
define i32 @test() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 111)
ret i32 undef
}
void init_io() {}


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

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

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

LLVM IR (-O2):
define void @init_io() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *get_str(int /*<<< orphan*/);
int /*<<< orphan*/ pop();
int /*<<< orphan*/ stderr;
void builtin_boom() {
  char *s = get_str(pop());
  fprintf(stderr, "%s", s);
  exit(0);
}


x86 assembly (clang, -O0):
<builtin_boom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop@plt>
mov    %eax,%edi
call   1050 <get_str@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe92(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<builtin_boom>:
push   %rax
xor    %eax,%eax
call   1030 <pop@plt>
mov    %eax,%edi
call   1050 <get_str@plt>
mov    0x2e8a(%rip),%rcx
mov    (%rcx),%edi
lea    0xea1(%rip),%rsi
mov    %rax,%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @builtin_boom() {
%1 = tail call i32 (...) @pop()
%2 = tail call i8* @get_str(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_beacon(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0000 | 0x0080);
}


x86 assembly (clang, -O0):
<ieee80211_is_beacon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x80,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_beacon>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x80,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_beacon(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 128)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_beacon(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 128)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
char *const_cast_char_ptr(const char *str) { return (char *)str; }


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

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

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

LLVM IR (-O2):
define i8* @const_cast_char_ptr(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void start_a1(void) { printf("start_a1\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"start_a1\0A\00"
define void @start_a1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"start_a1\00"
define void @start_a1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int /*<<< orphan*/);
void mfree(void *p, int64_t size) { munmap(p, size); }


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

x86 assembly (clang, -O2):
<mfree>:
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @mfree(i8* %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 = load i32, i32* %4
%7 = call i32 @munmap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @mfree(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr(char *, int);
void sigintHandler(int signo) { pr("caught signal: %d\n", signo); }


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

x86 assembly (clang, -O2):
<sigintHandler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <pr@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"caught signal: %d\0A\00"
define void @sigintHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"caught signal: %d\0A\00"
define void @sigintHandler(i32 %0) {
%2 = tail call i32 @pr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_print(char const *);
void U_WMRCREATEBITMAP_print(const char *contents) {
  U_WMRNOTIMPLEMENTED_print(contents);
}


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

x86 assembly (clang, -O2):
<U_WMRCREATEBITMAP_print>:
jmp    1030 <U_WMRNOTIMPLEMENTED_print@plt>

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

LLVM IR (-O2):
define void @U_WMRCREATEBITMAP_print(i8* %0) {
%2 = tail call i32 @U_WMRNOTIMPLEMENTED_print(i8* %0)
ret void
}
/* Variables and functions */
float roundf(float);
float num_round(float a) { return roundf(a); }


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

x86 assembly (clang, -O2):
<num_round>:
jmp    1030 <roundf@plt>

LLVM IR (-O0):
define float @num_round(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.round.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @num_round(float %0) {
%2 = tail call float @llvm.round.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ testUnique();
int main() {
  testUnique();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testUnique()
ret i32 0
}
/* Variables and functions */
size_t strlen(char *str) {
  if (str == NULL)
    return 0;
  int len = 0;
  while (*str != 0x0) {
    len++;
    str++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <strlen+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1159 <strlen+0x59>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <strlen+0x51>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <strlen+0x27>
movslq -0x14(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
test   %rdi,%rdi
je     111f <strlen+0x1f>
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = add nuw nsw i32 %7, 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6
%14 = zext i32 %9 to i64
br label %15
15: ; preds = %3, %13, %1
%16 = phi i64 [ 0, %1 ], [ 0, %3 ], [ %14, %13 ]
ret i64 %16
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int ui32Gen;
typedef scalar_t__ ui32Base;

/* Variables and functions */
void PWMGenFaultConfigure(uint32_t ui32Base, uint32_t ui32Gen,
                          uint32_t ui32MinFaultPeriod,
                          uint32_t ui32FaultSenses) {
  ;
  ;
  ;

  ;
  (*((volatile uint32_t *)(((ui32Base) + (ui32Gen)) + 0x0000003C))) =
      ui32MinFaultPeriod;
  (*((volatile uint32_t *)(((ui32Base) + 0x00000800 +
                            ((ui32Gen)-0x00000040) * 2) +
                           0x00000000))) = ui32FaultSenses;
}


x86 assembly (clang, -O0):
<PWMGenFaultConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rcx,0x3c(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rdx
sub    $0x40,%rdx
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenFaultConfigure>:
mov    %rdx,0x3c(%rdi,%rsi,1)
mov    %rcx,0x780(%rdi,%rsi,2)
ret

LLVM IR (-O0):
define void @PWMGenFaultConfigure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = add nsw i64 %10, %11
%13 = add nsw i64 %12, 60
%14 = inttoptr i64 %13 to i64*
store volatile i64 %9, i64* %14
%15 = load i64, i64* %8
%16 = load i64, i64* %5
%17 = add nsw i64 %16, 2048
%18 = load i64, i64* %6
%19 = sub nsw i64 %18, 64
%20 = mul nsw i64 %19, 2
%21 = add nsw i64 %17, %20
%22 = add nsw i64 %21, 0
%23 = inttoptr i64 %22 to i64*
store volatile i64 %15, i64* %23
ret void
}

LLVM IR (-O2):
define void @PWMGenFaultConfigure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %0, 60
%6 = add i64 %5, %1
%7 = inttoptr i64 %6 to i64*
store volatile i64 %2, i64* %7
%8 = shl i64 %1, 1
%9 = add i64 %0, 1920
%10 = add i64 %9, %8
%11 = inttoptr i64 %10 to i64*
store volatile i64 %3, i64* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_serial(int serialfd) { close(serialfd); }


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

x86 assembly (clang, -O2):
<close_serial>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_serial(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int xmlUCSIsThai(int code) { return (((code >= 0x0E00) && (code <= 0x0E7F))); }


x86 assembly (clang, -O0):
<xmlUCSIsThai>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xe00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsThai+0x26>
cmpl   $0xe7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsThai>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0xe00,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsThai(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 3584
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 3711
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsThai(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 3584
%4 = zext i1 %3 to i32
ret i32 %4
}
void test___atomic_fetch_xor_2(int *mem) { __atomic_fetch_xor(mem, -1, 4); }


x86 assembly (clang, -O0):
<test___atomic_fetch_xor_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
xor    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test___atomic_fetch_xor_2+0x4b>
jmp    1122 <test___atomic_fetch_xor_2+0x22>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_fetch_xor_2>:
lock xorl $0xffffffff,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_fetch_xor_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 -1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw xor i32* %5, i32 %6 acq_rel
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_fetch_xor_2(i32* nocapture %0) {
%2 = atomicrmw xor i32* %0, i32 -1 acq_rel
ret void
}
void BIO_get_ex_data(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_get_ex_data() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ unaligned_write_le16(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/);
void unaligned_write_le32(void *_u, uint32_t a) {
  uint8_t *u = _u;
  unaligned_write_le16(u, (uint16_t)a);
  unaligned_write_le16(u + 2, (uint16_t)(a >> 16));
}


x86 assembly (clang, -O0):
<unaligned_write_le32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <unaligned_write_le16@plt>
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
mov    -0xc(%rbp),%esi
sar    $0x10,%esi
call   1030 <unaligned_write_le16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned_write_le32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <unaligned_write_le16@plt>
add    $0x8,%rbx
sar    $0x10,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <unaligned_write_le16@plt>

LLVM IR (-O0):
define void @unaligned_write_le32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = call i32 @unaligned_write_le16(i32* %8, i32 %9)
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %4
%14 = ashr i32 %13, 16
%15 = call i32 @unaligned_write_le16(i32* %12, i32 %14)
ret void
}

LLVM IR (-O2):
define void @unaligned_write_le32(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @unaligned_write_le16(i32* %3, i32 %1)
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i32*
%7 = ashr i32 %1, 16
%8 = tail call i32 @unaligned_write_le16(i32* %6, i32 %7)
ret void
}
void gdk_keymap_get_direction() {}


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

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

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

LLVM IR (-O2):
define void @gdk_keymap_get_direction() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo() {
  int i;
  int j;
  int k;
  i = j ? k : i;
  i = j ? i : k;
  assert(i == k);
  return i ? j : j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
cmpl   $0x0,-0x8(%rbp)
je     112d <foo+0x1d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <foo+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <foo+0x3e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <foo+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x4(%rbp)
je     1182 <foo+0x72>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1188 <foo+0x78>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help00(void) {
  printf("  help              show a list of commands\n");
  printf("  help <cmd>        show help for <cmd>\n");
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c" help show a list of commands\0A\00"
@.str.1 = [41 x i8] c" help <cmd> show help for <cmd>\0A\00"
define void @help00() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c" help show a list of commands\00"
@str.2 = [40 x i8] c" help <cmd> show help for <cmd>\00"
define void @help00() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.2, i64 0, i64 0))
ret void
}
void func5(double x1, double x2, int *x_min, int *x_max) {
  *x_min = (int)x1;
  *x_max = (int)x2 + 1;
}


x86 assembly (clang, -O0):
<func5>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
cvttsd2si -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cvttsd2si -0x10(%rbp),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func5>:
cvttsd2si %xmm0,%eax
mov    %eax,(%rdi)
cvttsd2si %xmm1,%eax
add    $0x1,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @func5(double %0, double %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store double %1, double* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = fptosi double %9 to i32
%11 = load i32*, i32** %7
store i32 %10, i32* %11
%12 = load double, double* %6
%13 = fptosi double %12 to i32
%14 = add nsw i32 %13, 1
%15 = load i32*, i32** %8
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @func5(double %0, double %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = fptosi double %0 to i32
store i32 %5, i32* %2
%6 = fptosi double %1 to i32
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NVIC_SystemReset();
void __attribute__((weak, noreturn)) __reset_hardware() { NVIC_SystemReset(); }


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

x86 assembly (clang, -O2):
<__reset_hardware>:
push   %rax
xor    %eax,%eax
call   1030 <NVIC_SystemReset@plt>

LLVM IR (-O0):
define weak void @__reset_hardware() {
%1 = call i32 (...) @NVIC_SystemReset()
unreachable
}

LLVM IR (-O2):
define weak void @__reset_hardware() {
%1 = tail call i32 (...) @NVIC_SystemReset()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bf2c(char *);
int /*<<< orphan*/ warning();
int main(int argc, char *argv[]) {
  if (argc != 2) {
    warning();
  } else if (argc == 2) {
    bf2c(argv[1]);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
mov    $0x0,%al
call   1030 <warning@plt>
jmp    1168 <main+0x48>
cmpl   $0x2,-0x8(%rbp)
jne    1163 <main+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <bf2c@plt>
jmp    1168 <main+0x48>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1040 <bf2c@plt>
jmp    1138 <main+0x18>
xor    %eax,%eax
call   1030 <warning@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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @warning()
br label %19
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @bf2c(i8* %16)
br label %18
18: ; preds = %13, %10
br label %19
19: ; preds = %18, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @warning()
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @bf2c(i8* %8)
br label %10
10: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void exiterr(const char *str) {
  fputs(str, stderr);
  fputs("\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<exiterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exiterr>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @exiterr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
void rl_replace_line(const char *c, int i) {}


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

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

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

LLVM IR (-O2):
define void @rl_replace_line(i8* nocapture %0, i32 %1) {
ret void
}
int cmp(const void *a, const void *b) { return *(double *)b - *(double *)a; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
movsd  (%rsi),%xmm0
subsd  (%rdi),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to double*
%4 = load double, double* %3
%5 = bitcast i8* %0 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_command(void) { printf("help_command\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"help_command\0A\00"
define void @help_command() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"help_command\00"
define void @help_command() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ piece(char *, char, char *, int);
char *load_shef_comma_piece(char *destination, char *source, int offset) {
  if (!piece(destination, ',', source, offset))
    return (char *)0;
  return destination;
}


x86 assembly (clang, -O0):
<load_shef_comma_piece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x2c,%esi
call   1030 <piece@plt>
cmp    $0x0,%eax
jne    114e <load_shef_comma_piece+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1156 <load_shef_comma_piece+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_shef_comma_piece>:
push   %rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    $0x2c,%esi
call   1030 <piece@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovne %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @load_shef_comma_piece(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @piece(i8* %0, i8 signext 44, i8* %1, i32 %2)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* null, i8* %0
ret i8* %6
}
int test_imm_E3int16_reg(short val) {
  return ((val) & (-0xE3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E3int16_reg>:
test   $0xff1d,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E3int16_reg(i16 signext %0) {
%2 = and i16 %0, -227
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void __ipipe_clear_taskflags(struct task_struct *p) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @__ipipe_clear_taskflags(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int recebe_num(int);
void preencher_vetor(int *vet, int n) {
  int i;
  for (i = 0; i < n; i++) {
    vet[i] = recebe_num(i);
  }
}


x86 assembly (clang, -O0):
<preencher_vetor>:
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    1155 <preencher_vetor+0x45>
mov    -0x10(%rbp),%edi
call   1030 <recebe_num@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <preencher_vetor+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @preencher_vetor(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32, i32* %5
%12 = call i32 @recebe_num(i32 %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @preencher_vetor(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = trunc i64 %7 to i32
%9 = tail call i32 @recebe_num(i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n >= 0) {
    printf("The number is positive.\n");
  } else {
    printf("The number is negative.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <main+0x46>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xedd(%rip),%rax
lea    0xebe(%rip),%rdi
cmovns %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [25 x i8] c"The number is positive.\0A\00"
@.str.2 = [25 x i8] c"The number is negative.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [24 x i8] c"The number is negative.\00"
@str.3 = [24 x i8] c"The number is positive.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, -1
%6 = select i1 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int iintand(int x, int y) {
  x &= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<iintand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x18,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <iintand+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iintand>:
push   %rbx
mov    %edi,%ebx
and    $0x18,%ebx
jne    111f <iintand+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @iintand(i32 %0, i32 %1) {
%3 = and i32 %0, 24
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int indexFor(int h, int length) { return h & (length - 1); }


x86 assembly (clang, -O0):
<indexFor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexFor>:
lea    -0x1(%rsi),%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @indexFor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @indexFor(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
void rop3_160_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D & T;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_160_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_160_0_1>:
and    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_160_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = load i8, i8* %6
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = or i32 %19, %25
%27 = load i8, i8* %6
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = and i32 %32, %35
%37 = or i32 %26, %36
%38 = trunc i32 %37 to i8
%39 = load i8*, i8** %4
store i8 %38, i8* %39
ret void
}

LLVM IR (-O2):
define void @rop3_160_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
store i8 %5, i8* %0
ret void
}
void foo565(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo565(i32 %0) {
ret void
}
int co_ctx_sdir(unsigned long psp) {
  int nav = 0;
  unsigned long csp = (unsigned long)&nav;
  return psp > csp ? -1 : +1;
}


x86 assembly (clang, -O0):
<co_ctx_sdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_ctx_sdir>:
lea    -0x4(%rsp),%rax
xor    %ecx,%ecx
cmp    %rdi,%rax
setae  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @co_ctx_sdir(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i64 %0, i64* %2
store i32 0, i32* %3
%5 = ptrtoint i32* %3 to i64
store i64 %5, i64* %4
%6 = load i64, i64* %2
%7 = load i64, i64* %4
%8 = icmp ugt i64 %6, %7
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @co_ctx_sdir(i64 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = ptrtoint i32* %2 to i64
%5 = icmp ult i64 %4, %0
%6 = select i1 %5, i32 -1, i32 1
ret i32 %6
}