xunge/DecIR huggingface dataset:
void foobar(void) { __builtin_trap(); }


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

x86 assembly (clang, -O2):
<foobar>:
ud2

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

LLVM IR (-O2):
define void @foobar() {
tail call void @llvm.trap()
unreachable
}
/* Type definitions */
struct predicate {
  int dummy;
};

/* Variables and functions */
bool pred_false(const char *path, int flags, struct predicate *pred) {
  return false;
}


x86 assembly (clang, -O0):
<pred_false>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.predicate = type { i32 }
define i32 @pred_false(i8* %0, i32 %1, %struct.predicate* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.predicate*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.predicate* %2, %struct.predicate** %6
ret i32 0
}

LLVM IR (-O2):
%struct.predicate = type { i32 }
define i32 @pred_false(i8* nocapture readnone %0, i32 %1, %struct.predicate* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int is_deleted(uint32_t hash) { return (hash >> 31) != 0; }


x86 assembly (clang, -O0):
<is_deleted>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_deleted>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @is_deleted(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_deleted(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
double amod(double);
double angle_dist(double a1, double a2) {
  a1 = amod(a1);
  a2 = amod(a2);
  if (a1 > a2) {
    return a1 - a2;
  } else {
    return a2 - a1;
  }
}


x86 assembly (clang, -O0):
<angle_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <amod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <amod@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1164 <angle_dist+0x54>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1173 <angle_dist+0x63>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_dist>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <amod@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <amod@plt>
movsd  0x8(%rsp),%xmm3
movapd %xmm3,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
subsd  %xmm3,%xmm2
cmpltsd %xmm3,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @angle_dist(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call double @amod(double %6)
store double %7, double* %4
%8 = load double, double* %5
%9 = call double @amod(double %8)
store double %9, double* %5
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fcmp ogt double %10, %11
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load double, double* %4
%15 = load double, double* %5
%16 = fsub double %14, %15
store double %16, double* %3
br label %21
17: ; preds = %2
%18 = load double, double* %5
%19 = load double, double* %4
%20 = fsub double %18, %19
store double %20, double* %3
br label %21
21: ; preds = %17, %13
%22 = load double, double* %3
ret double %22
}

LLVM IR (-O2):
define double @angle_dist(double %0, double %1) {
%3 = tail call double @amod(double %0)
%4 = tail call double @amod(double %1)
%5 = fcmp ogt double %3, %4
%6 = fsub double %3, %4
%7 = fsub double %4, %3
%8 = select i1 %5, double %6, double %7
ret double %8
}
void foo_2_1_2_2_2_1_2_1_2() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void element_empty_column_output(FILE *output_file) {
  fprintf(output_file, "<td></td>\n");
}


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

x86 assembly (clang, -O2):
<element_empty_column_output>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"<td></td>\0A\00"
define void @element_empty_column_output(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"<td></td>\0A\00"
define void @element_empty_column_output(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reply(int, char *, char const *);
void ack(const char *s) { reply(250, "%s command successful.", s); }


x86 assembly (clang, -O0):
<ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0xfa,%edi
lea    0xed4(%rip),%rsi
call   1030 <reply@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ack>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0xfa,%edi
jmp    1030 <reply@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s command successful.\00"
define void @ack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @reply(i32 250, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s command successful.\00"
define void @ack(i8* %0) {
%2 = tail call i32 @reply(i32 250, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RateDesiredHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void RateDesiredUpdated() { UAVObjUpdated(RateDesiredHandle()); }


x86 assembly (clang, -O0):
<RateDesiredUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RateDesiredHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RateDesiredUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <RateDesiredHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @RateDesiredUpdated() {
%1 = call i32 (...) @RateDesiredHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RateDesiredUpdated() {
%1 = tail call i32 (...) @RateDesiredHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
int dst_on_comm(int *Fcomm, int *typesize, void *inbuf, int *ninbuf,
                void *outbuf, int *noutbuf, int sw) {
  return (0);
}


x86 assembly (clang, -O0):
<dst_on_comm>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dst_on_comm(i32* nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2, i32* nocapture readnone %3, i8* nocapture readnone %4, i32* nocapture readnone %5, i32 %6) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GPUgetScreenPic(unsigned char *);
void ZN_GPUgetScreenPic(unsigned char *pMem) { GPUgetScreenPic(pMem); }


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

x86 assembly (clang, -O2):
<ZN_GPUgetScreenPic>:
jmp    1030 <GPUgetScreenPic@plt>

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

LLVM IR (-O2):
define void @ZN_GPUgetScreenPic(i8* %0) {
%2 = tail call i32 @GPUgetScreenPic(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int_hash_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ str_hash_test();
int main(int argc, char **argv) {
  int_hash_test();
  str_hash_test();
  printf("========== UNIT TEST SUCC. =========\n");
  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)
mov    $0x0,%al
call   1050 <int_hash_test@plt>
mov    $0x0,%al
call   1040 <str_hash_test@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <int_hash_test@plt>
xor    %eax,%eax
call   1040 <str_hash_test@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"========== UNIT TEST SUCC. =========\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @int_hash_test()
%7 = call i32 (...) @str_hash_test()
%8 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"========== UNIT TEST SUCC. =========\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @int_hash_test()
%4 = tail call i32 (...) @str_hash_test()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mem_free(void *);
void es_free(void *a) { mem_free(a); }


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

x86 assembly (clang, -O2):
<es_free>:
jmp    1030 <mem_free@plt>

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

LLVM IR (-O2):
define void @es_free(i8* %0) {
%2 = tail call i32 @mem_free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __s32;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int i2c_smbus_read_word_data(int, int /*<<< orphan*/);
__s32 bmp085_i2c_Read_Int(int fd, __u8 address) {
  __s32 res = i2c_smbus_read_word_data(fd, address);
  if (res < 0) {
    close(fd);
    exit(1);
  }
  res = ((res << 8) & 0xFF00) | ((res >> 8) & 0xFF);
  return res;
}


x86 assembly (clang, -O0):
<bmp085_i2c_Read_Int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <i2c_smbus_read_word_data@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1168 <bmp085_i2c_Read_Int+0x38>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp085_i2c_Read_Int>:
push   %rbx
mov    %edi,%ebx
call   1040 <i2c_smbus_read_word_data@plt>
test   %eax,%eax
js     1145 <bmp085_i2c_Read_Int+0x15>
rol    $0x8,%ax
movzwl %ax,%eax
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
define i32 @bmp085_i2c_Read_Int(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_word_data(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @close(i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = trunc i32 %3 to i16
%10 = tail call i16 @llvm.bswap.i16(i16 %9)
%11 = zext i16 %10 to i32
ret i32 %11
}
void forp_info(TSRMLS_D) {
  php_info_print_table_start();
  php_info_print_table_row(2, "Version", "1.1.0");
  php_info_print_table_end();
}


x86 assembly (clang, -O0):
<forp_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <php_info_print_table_start@plt>
mov    $0x2,%edi
lea    0xeb2(%rip),%rsi
lea    0xeb3(%rip),%rdx
mov    $0x0,%al
call   1030 <php_info_print_table_row@plt>
mov    $0x0,%al
call   1040 <php_info_print_table_end@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forp_info>:
push   %rax
xor    %eax,%eax
call   1050 <php_info_print_table_start@plt>
lea    0xec1(%rip),%rsi
lea    0xec2(%rip),%rdx
mov    $0x2,%edi
xor    %eax,%eax
call   1030 <php_info_print_table_row@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <php_info_print_table_end@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Version\00"
@.str.1 = [6 x i8] c"1.1.0\00"
define void @forp_info(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @php_info_print_table_start()
%4 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @php_info_print_table_row to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @php_info_print_table_end()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Version\00"
@.str.1 = [6 x i8] c"1.1.0\00"
define void @forp_info(i32 %0) {
%2 = tail call i32 (...) @php_info_print_table_start()
%3 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @php_info_print_table_row to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @php_info_print_table_end()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SBC_(int);
int /*<<< orphan*/ c64_memAbsoluteAddrY();
void SBC_absy(void) {
  c64_memAbsoluteAddrY();
  SBC_(1);
}


x86 assembly (clang, -O0):
<SBC_absy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <c64_memAbsoluteAddrY@plt>
mov    $0x1,%edi
call   1030 <SBC_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SBC_absy>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memAbsoluteAddrY@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <SBC_@plt>

LLVM IR (-O0):
define void @SBC_absy() {
%1 = call i32 (...) @c64_memAbsoluteAddrY()
%2 = call i32 @SBC_(i32 1)
ret void
}

LLVM IR (-O2):
define void @SBC_absy() {
%1 = tail call i32 (...) @c64_memAbsoluteAddrY()
%2 = tail call i32 @SBC_(i32 1)
ret void
}
int f(void) {
  unsigned char c = 200;
  return (c == 200);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movb   $0xc8,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xc8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i8
store i8 -56, i8* %1
%2 = load i8, i8* %1
%3 = zext i8 %2 to i32
%4 = icmp eq i32 %3, 200
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f() {
ret i32 1
}
OP(ed, d6) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_VERSION_TEXT;
int SSLeay();
int /*<<< orphan*/ err(int, char *, int /*<<< orphan*/);
int main() {
  if (SSLeay() < 0x1000000L) {
    err(1, "OpenSSL seems to be old: %s", OPENSSL_VERSION_TEXT);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <SSLeay@plt>
cltq
cmp    $0x1000000,%rax
jge    115e <main+0x3e>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
lea    0xea7(%rip),%rsi
call   1040 <err@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <SSLeay@plt>
cmp    $0xffffff,%eax
jg     1149 <main+0x29>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
call   1040 <err@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"OpenSSL seems to be old: %s\00"
@OPENSSL_VERSION_TEXT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @SSLeay()
%3 = sext i32 %2 to i64
%4 = icmp slt i64 %3, 16777216
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @OPENSSL_VERSION_TEXT
%7 = call i32 @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"OpenSSL seems to be old: %s\00"
@OPENSSL_VERSION_TEXT = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @SSLeay()
%2 = icmp slt i32 %1, 16777216
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @OPENSSL_VERSION_TEXT
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int f262(int *);
int f263(int *p) { return f262(p); }


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

x86 assembly (clang, -O2):
<f263>:
jmp    1030 <f262@plt>

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

LLVM IR (-O2):
define i32 @f263(i32* %0) {
%2 = tail call i32 @f262(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ AppendTest();
int /*<<< orphan*/ CountTest();
int /*<<< orphan*/ DeleteListTest();
int /*<<< orphan*/ GetNthTest();
int /*<<< orphan*/ InsertNthTest();
int /*<<< orphan*/ InsertSortTest();
int /*<<< orphan*/ PopTest();
int /*<<< orphan*/ SortedInsertTest();
int main() {
  CountTest();
  GetNthTest();
  DeleteListTest();
  PopTest();
  InsertNthTest();
  SortedInsertTest();
  InsertSortTest();
  AppendTest();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10a0 <CountTest@plt>
mov    $0x0,%al
call   1090 <GetNthTest@plt>
mov    $0x0,%al
call   1070 <DeleteListTest@plt>
mov    $0x0,%al
call   1050 <PopTest@plt>
mov    $0x0,%al
call   1040 <InsertNthTest@plt>
mov    $0x0,%al
call   1080 <SortedInsertTest@plt>
mov    $0x0,%al
call   1030 <InsertSortTest@plt>
mov    $0x0,%al
call   1060 <AppendTest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10a0 <CountTest@plt>
xor    %eax,%eax
call   1090 <GetNthTest@plt>
xor    %eax,%eax
call   1070 <DeleteListTest@plt>
xor    %eax,%eax
call   1050 <PopTest@plt>
xor    %eax,%eax
call   1040 <InsertNthTest@plt>
xor    %eax,%eax
call   1080 <SortedInsertTest@plt>
xor    %eax,%eax
call   1030 <InsertSortTest@plt>
xor    %eax,%eax
call   1060 <AppendTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @CountTest()
%3 = call i32 (...) @GetNthTest()
%4 = call i32 (...) @DeleteListTest()
%5 = call i32 (...) @PopTest()
%6 = call i32 (...) @InsertNthTest()
%7 = call i32 (...) @SortedInsertTest()
%8 = call i32 (...) @InsertSortTest()
%9 = call i32 (...) @AppendTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @CountTest()
%2 = tail call i32 (...) @GetNthTest()
%3 = tail call i32 (...) @DeleteListTest()
%4 = tail call i32 (...) @PopTest()
%5 = tail call i32 (...) @InsertNthTest()
%6 = tail call i32 (...) @SortedInsertTest()
%7 = tail call i32 (...) @InsertSortTest()
%8 = tail call i32 (...) @AppendTest()
ret i32 0
}
int my_array(int numbers[], int highest) {
  int j;
  for (j = 0; j < 5; j++) {
    if (numbers[j] > highest) {
      highest = numbers[j];
    }
  }
  return (highest);
}


x86 assembly (clang, -O0):
<my_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1151 <my_array+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
jle    113e <my_array+0x3e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <my_array+0x43>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <my_array+0x12>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_array>:
mov    (%rdi),%eax
cmp    %esi,%eax
cmovle %esi,%eax
mov    0x4(%rdi),%ecx
cmp    %eax,%ecx
cmovg  %ecx,%eax
mov    0x8(%rdi),%ecx
cmp    %eax,%ecx
cmovg  %ecx,%eax
mov    0xc(%rdi),%ecx
cmp    %eax,%ecx
cmovg  %ecx,%eax
mov    0x10(%rdi),%ecx
cmp    %eax,%ecx
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_array(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, %1
%5 = select i1 %4, i32 %3, i32 %1
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, %5
%9 = select i1 %8, i32 %7, i32 %5
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = icmp sgt i32 %11, %9
%13 = select i1 %12, i32 %11, i32 %9
%14 = getelementptr inbounds i32, i32* %0, i64 3
%15 = load i32, i32* %14
%16 = icmp sgt i32 %15, %13
%17 = select i1 %16, i32 %15, i32 %13
%18 = getelementptr inbounds i32, i32* %0, i64 4
%19 = load i32, i32* %18
%20 = icmp sgt i32 %19, %17
%21 = select i1 %20, i32 %19, i32 %17
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int n = 1;
  printf("%d,%d", ++n, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"%d,%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d,%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, void *);
int /*<<< orphan*/ system(char *);
void *getData(void *channel) {
  char micid[2];
  sprintf(micid, "%d", channel);
  char *commandout;
  asprintf(&commandout, "%s %s ", "sudo ./Umweltprocessing", micid);
  system(commandout);
}


x86 assembly (clang, -O0):
<getData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x12(%rbp),%rcx
lea    -0x20(%rbp),%rdi
lea    0xea4(%rip),%rsi
lea    0xea4(%rip),%rdx
call   1040 <asprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <system@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getData>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rdx
lea    0xec1(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
lea    0xeb0(%rip),%rsi
lea    0xeb0(%rip),%rdx
lea    0x8(%rsp),%rdi
mov    %rbx,%rcx
call   1040 <asprintf@plt>
mov    0x8(%rsp),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%s %s \00"
@.str.2 = [24 x i8] c"sudo ./Umweltprocessing\00"
define i8* @getData(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [2 x i8]
%5 = alloca i8*
store i8* %0, i8** %3
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%10 = call i32 @asprintf(i8** %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @system(i8* %11)
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%s %s \00"
@.str.2 = [24 x i8] c"sudo ./Umweltprocessing\00"
define noalias i8* @getData(i8* %0) {
%2 = alloca [2 x i8]
%3 = alloca i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = bitcast i8** %3 to i8*
%7 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%8 = load i8*, i8** %3
%9 = call i32 @system(i8* %8)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\nUsage: hexdump [-n size] input\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0AUsage: hexdump [-n size] input\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [33 x i8] c"\0AUsage: hexdump [-n size] input\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int strlen(char *);
void clearstring(char *pStr) {
  int len = strlen(pStr);
  int i;
  for (i = 0; i < len; i++) {
    pStr[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<clearstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1155 <clearstring+0x45>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <clearstring+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearstring>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1139 <clearstring+0x19>
mov    %eax,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @clearstring(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %1
ret void
}
void __attribute__((visibility("default")))
border_nesw_double_diagonal_special_sand_n(unsigned char *pic,
                                           unsigned char *mirr) {
  *pic = 0x29;
  *mirr = 0x02 | 0x01;
}


x86 assembly (clang, -O0):
<border_nesw_double_diagonal_special_sand_n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x29,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_nesw_double_diagonal_special_sand_n>:
movb   $0x29,(%rdi)
movb   $0x3,(%rsi)
ret

LLVM IR (-O0):
define void @border_nesw_double_diagonal_special_sand_n(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
store i8 41, i8* %5
%6 = load i8*, i8** %4
store i8 3, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_nesw_double_diagonal_special_sand_n(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 41, i8* %0
store i8 3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ triangles_in_the_term(int, int);
int main(void) {
  triangles_in_the_term(-1, 3);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
mov    $0x3,%esi
call   1030 <triangles_in_the_term@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @triangles_in_the_term(i32 -1, i32 3)
ret i32 0
}
/* Variables and functions */
double CurTimeval();
int /*<<< orphan*/ RobotCmd(int, char *, double);
void RobotTimeStamp(void) {
  RobotCmd(1, "TimeStamp %.3f\n", CurTimeval() / 1.0e6);
}


x86 assembly (clang, -O0):
<RobotTimeStamp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CurTimeval@plt>
movsd  0xecd(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
call   1040 <RobotCmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RobotTimeStamp>:
push   %rax
xor    %eax,%eax
call   1030 <CurTimeval@plt>
divsd  0xed0(%rip),%xmm0
lea    0xed1(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1040 <RobotCmd@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"TimeStamp %.3f\0A\00"
define void @RobotTimeStamp() {
%1 = call double (...) @CurTimeval()
%2 = fdiv double %1, 1.000000e+06
%3 = call i32 @RobotCmd(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"TimeStamp %.3f\0A\00"
define void @RobotTimeStamp() {
%1 = tail call double (...) @CurTimeval()
%2 = fdiv double %1, 1.000000e+06
%3 = tail call i32 @RobotCmd(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}
int count_spaces(const char *str) {
  int count = 0;
  while (*str != '\0') {
    if (*str++ == ' ')
      count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <count_spaces+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1143 <count_spaces+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <count_spaces+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_spaces>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_spaces+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x20,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_spaces+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_spaces(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 32
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
int db5500_prcmu_get_ape_opp(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @db5500_prcmu_get_ape_opp() {
ret i32 0
}
int test19(int a, int b, int c, int d, int e, int f) {
  int x = a != b;
  int y = c != 0;
  int z = d == e;
  return x == y || x == z;
}


x86 assembly (clang, -O0):
<test19>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%ecx
mov    $0x1,%al
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
je     1166 <test19+0x66>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
sete   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test19>:
cmp    %esi,%edi
setne  %al
test   %edx,%edx
sete   %dl
cmp    %r8d,%ecx
setne  %cl
xor    %al,%dl
xor    %al,%cl
or     %dl,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @test19(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp ne i32 %0, %1
%8 = icmp eq i32 %2, 0
%9 = icmp ne i32 %3, %4
%10 = xor i1 %7, %8
%11 = xor i1 %7, %9
%12 = or i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
struct VAL_cell {
  int dummy;
};
struct AST_tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AST_tree_recursive_eq(struct AST_tree *, struct VAL_cell *,
                                         struct VAL_cell *);
struct VAL_cell *new_BOOL_VAL_cell(int /*<<< orphan*/);
struct VAL_cell *AST_tree_eq(struct AST_tree *self, struct VAL_cell *x,
                             struct VAL_cell *y) {
  return new_BOOL_VAL_cell(AST_tree_recursive_eq(self, x, y));
}


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

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

LLVM IR (-O0):
%struct.AST_tree = type { i32 }
%struct.VAL_cell = type { i32 }
define %struct.VAL_cell* @AST_tree_eq(%struct.AST_tree* %0, %struct.VAL_cell* %1, %struct.VAL_cell* %2) {
%4 = alloca %struct.AST_tree*
%5 = alloca %struct.VAL_cell*
%6 = alloca %struct.VAL_cell*
store %struct.AST_tree* %0, %struct.AST_tree** %4
store %struct.VAL_cell* %1, %struct.VAL_cell** %5
store %struct.VAL_cell* %2, %struct.VAL_cell** %6
%7 = load %struct.AST_tree*, %struct.AST_tree** %4
%8 = load %struct.VAL_cell*, %struct.VAL_cell** %5
%9 = load %struct.VAL_cell*, %struct.VAL_cell** %6
%10 = call i32 @AST_tree_recursive_eq(%struct.AST_tree* %7, %struct.VAL_cell* %8, %struct.VAL_cell* %9)
%11 = call %struct.VAL_cell* @new_BOOL_VAL_cell(i32 %10)
ret %struct.VAL_cell* %11
}

LLVM IR (-O2):
%struct.AST_tree = type { i32 }
%struct.VAL_cell = type { i32 }
define %struct.VAL_cell* @AST_tree_eq(%struct.AST_tree* %0, %struct.VAL_cell* %1, %struct.VAL_cell* %2) {
%4 = tail call i32 @AST_tree_recursive_eq(%struct.AST_tree* %0, %struct.VAL_cell* %1, %struct.VAL_cell* %2)
%5 = tail call %struct.VAL_cell* @new_BOOL_VAL_cell(i32 %4)
ret %struct.VAL_cell* %5
}
double iw_filter_hermite(struct iw_rr_ctx *rrctx, double x) {
  if (x < 1.0) {
    return 2.0 * x * x * x - 3.0 * x * x + 1.0;
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<iw_filter_hermite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  0xeeb(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    117e <iw_filter_hermite+0x7e>
movsd  0xee8(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xec9(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe90(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1186 <iw_filter_hermite+0x86>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_filter_hermite>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
movsd  0xef0(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    1142 <iw_filter_hermite+0x42>
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  0xebe(%rip),%xmm0
ret

LLVM IR (-O0):
%struct.iw_rr_ctx = type opaque
define double @iw_filter_hermite(%struct.iw_rr_ctx* %0, double %1) {
%3 = alloca double
%4 = alloca %struct.iw_rr_ctx*
%5 = alloca double
store %struct.iw_rr_ctx* %0, %struct.iw_rr_ctx** %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp olt double %6, 1.000000e+00
br i1 %7, label %8, label %21
8: ; preds = %2
%9 = load double, double* %5
%10 = fmul double 2.000000e+00, %9
%11 = load double, double* %5
%12 = fmul double %10, %11
%13 = load double, double* %5
%14 = load double, double* %5
%15 = fmul double 3.000000e+00, %14
%16 = load double, double* %5
%17 = fmul double %15, %16
%18 = fneg double %17
%19 = call double @llvm.fmuladd.f64(double %12, double %13, double %18)
%20 = fadd double %19, 1.000000e+00
store double %20, double* %3
br label %22
21: ; preds = %2
store double 0.000000e+00, double* %3
br label %22
22: ; preds = %21, %8
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
%struct.iw_rr_ctx = type opaque
define double @iw_filter_hermite(%struct.iw_rr_ctx* nocapture readnone %0, double %1) {
%3 = fcmp olt double %1, 1.000000e+00
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = fmul double %1, 2.000000e+00
%6 = fmul double %5, %1
%7 = fmul double %1, -3.000000e+00
%8 = fmul double %7, %1
%9 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %8)
%10 = fadd double %9, 1.000000e+00
br label %11
11: ; preds = %2, %4
%12 = phi double [ %10, %4 ], [ 0.000000e+00, %2 ]
ret double %12
}
int test_imm_58uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x58 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_58uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x58,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_58uint64_lowword_mem>:
testb  $0x58,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_58uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 88
%6 = icmp ne i64 %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_58uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 88
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int any_LSB_zero(unsigned x) { return !!(~x & 0xFFu); }


x86 assembly (clang, -O0):
<any_LSB_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    $0xff,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_LSB_zero>:
xor    %eax,%eax
cmp    $0xff,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @any_LSB_zero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = and i32 %4, 255
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @any_LSB_zero(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ne i32 %2, 255
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xresizerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xresizerequest_type(void *_p) {
  return (int)((XEvent *)_p)->xresizerequest.type;
}


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

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

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

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