xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_surfflag_subname(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void fgmvwrite_surfflag_subname_(char subname[]) {
  char type[10];
  strncpy(type, subname, 8);
  *(type + 8) = '\0';
  gmvwrite_surfflag_subname(type);
}


x86 assembly (clang, -O0):
<fgmvwrite_surfflag_subname_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0xa(%rbp)
lea    -0x12(%rbp),%rdi
call   1040 <gmvwrite_surfflag_subname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_surfflag_subname_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xe(%rsp)
mov    %rbx,%rdi
call   1040 <gmvwrite_surfflag_subname@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fgmvwrite_surfflag_subname_(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 8)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds i8, i8* %7, i64 8
store i8 0, i8* %8
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @gmvwrite_surfflag_subname(i8* %9)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_surfflag_subname_(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 8)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 8
store i8 0, i8* %5
%6 = call i32 @gmvwrite_surfflag_subname(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help_s() {
  printf("snat options:\n"
         " --to-src address       : MAC address to map source to\n"
         " --snat-target target   : ACCEPT, DROP, RETURN or CONTINUE\n");
}


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

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

LLVM IR (-O0):
@.str = [129 x i8] c"snat options:\0A --to-src address : MAC address to map source to\0A --snat-target target : ACCEPT, DROP, RETURN or CONTINUE\0A\00"
define void @print_help_s() {
%1 = call i32 @printf(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [128 x i8] c"snat options:\0A --to-src address : MAC address to map source to\0A --snat-target target : ACCEPT, DROP, RETURN or CONTINUE\00"
define void @print_help_s() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @str, i64 0, i64 0))
ret void
}
float absVal(float a) {
  if (a < 0) {
    return (a * -1);
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<absVal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112d <absVal+0x2d>
movss  0xee2(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1137 <absVal+0x37>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absVal>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @absVal(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fmul float %7, -1.000000e+00
store float %8, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @absVal(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
void daemon_init(struct server_env *s_env) {}


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

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

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

LLVM IR (-O2):
%struct.server_env = type opaque
define void @daemon_init(%struct.server_env* nocapture %0) {
ret void
}
int main() {
  const int i;
  +i;
  -i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct magic_set {
  int dummy;
};

/* Variables and functions */
char const *file_or_fd(struct magic_set *, int /*<<< orphan*/ *, int);
const char *magic_descriptor(struct magic_set *ms, int fd) {
  return file_or_fd(ms, NULL, fd);
}


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

x86 assembly (clang, -O2):
<magic_descriptor>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <file_or_fd@plt>

LLVM IR (-O0):
%struct.magic_set = type { i32 }
define i8* @magic_descriptor(%struct.magic_set* %0, i32 %1) {
%3 = alloca %struct.magic_set*
%4 = alloca i32
store %struct.magic_set* %0, %struct.magic_set** %3
store i32 %1, i32* %4
%5 = load %struct.magic_set*, %struct.magic_set** %3
%6 = load i32, i32* %4
%7 = call i8* @file_or_fd(%struct.magic_set* %5, i32* null, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.magic_set = type { i32 }
define i8* @magic_descriptor(%struct.magic_set* %0, i32 %1) {
%3 = tail call i8* @file_or_fd(%struct.magic_set* %0, i32* null, i32 %1)
ret i8* %3
}
void SPI_set_8_bit() {
  (*((volatile unsigned char *)0xE0068004)) = 0x01;
  (*((volatile unsigned short *)0xE0068000)) = 0x107;
  (*((volatile unsigned char *)0xE0068004)) = 0x02;
}


x86 assembly (clang, -O0):
<SPI_set_8_bit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0068004,%eax
movb   $0x1,(%rax)
mov    $0xe0068000,%eax
movw   $0x107,(%rax)
mov    $0xe0068004,%eax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_set_8_bit>:
mov    $0xe0068004,%eax
movb   $0x1,(%rax)
movw   $0x107,-0x4(%rax)
movb   $0x2,(%rax)
ret

LLVM IR (-O0):
define void @SPI_set_8_bit() {
store volatile i8 1, i8* inttoptr (i64 3758522372 to i8*)
store volatile i16 263, i16* inttoptr (i64 3758522368 to i16*)
store volatile i8 2, i8* inttoptr (i64 3758522372 to i8*)
ret void
}

LLVM IR (-O2):
define void @SPI_set_8_bit() {
store volatile i8 1, i8* inttoptr (i64 3758522372 to i8*)
store volatile i16 263, i16* inttoptr (i64 3758522368 to i16*)
store volatile i8 2, i8* inttoptr (i64 3758522372 to i8*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int main() {
  FILE *fp = fopen("mayores.dat", "rb+");
  char buff[32];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xee1(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"mayores.dat\00"
@.str.1 = [4 x i8] c"rb+\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca [32 x i8]
%3 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"mayores.dat\00"
@.str.1 = [4 x i8] c"rb+\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct libusb_config_descriptor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct libusb_config_descriptor *);
void libusb_free_config_descriptor(struct libusb_config_descriptor *config) {
  free(config);
}


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

x86 assembly (clang, -O2):
<libusb_free_config_descriptor>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libusb_config_descriptor = type { i32 }
define void @libusb_free_config_descriptor(%struct.libusb_config_descriptor* %0) {
%2 = alloca %struct.libusb_config_descriptor*
store %struct.libusb_config_descriptor* %0, %struct.libusb_config_descriptor** %2
%3 = load %struct.libusb_config_descriptor*, %struct.libusb_config_descriptor** %2
%4 = call i32 @free(%struct.libusb_config_descriptor* %3)
ret void
}

LLVM IR (-O2):
%struct.libusb_config_descriptor = type { i32 }
define void @libusb_free_config_descriptor(%struct.libusb_config_descriptor* nocapture %0) {
%2 = tail call i32 @free(%struct.libusb_config_descriptor* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ write(int, char *, int /*<<< orphan*/);
void set_telnet_mode(int s) {
  char *neg = "\xFF\xFD\x01"
              "\xFF\xFB\x01"
              "\xFF\xFD\x03"
              "\xFF\xFB\x03";
  if (write(s, neg, strlen(neg)))
    ;
}


x86 assembly (clang, -O0):
<set_telnet_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
je     116a <set_telnet_mode+0x4a>
jmp    116a <set_telnet_mode+0x4a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_telnet_mode>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\FF\FD\01\FF\FB\01\FF\FD\03\FF\FB\03\00"
define void @set_telnet_mode(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i64 @write(i32 %4, i8* %5, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\FF\FD\01\FF\FB\01\FF\FD\03\FF\FB\03\00"
define void @set_telnet_mode(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @write(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int hour_fn(const int time_var, const char *from, const char *to) {
  printf("%s %i %li %li\n", __FUNCTION__, time_var, (long)from, (long)to);
  return generic_fn(time_var, (long)from, (long)to, 0, 23);
}


x86 assembly (clang, -O0):
<hour_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebb(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x17,%r8d
mov    $0x0,%al
call   1030 <generic_fn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hour_fn>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
mov    $0x17,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <generic_fn@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.hour_fn = [8 x i8] c"hour_fn\00"
define i32 @hour_fn(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i64
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.hour_fn, i64 0, i64 0), i32 %7, i64 %9, i64 %11)
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
%16 = load i8*, i8** %6
%17 = ptrtoint i8* %16 to i64
%18 = call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %13, i64 %15, i64 %17, i32 0, i32 23)
ret i32 %18
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.hour_fn = [8 x i8] c"hour_fn\00"
define i32 @hour_fn(i32 %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %2 to i64
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.hour_fn, i64 0, i64 0), i32 %0, i64 %4, i64 %5)
%7 = tail call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %0, i64 %4, i64 %5, i32 0, i32 23)
ret i32 %7
}
void RTTarFileSetTime(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileSetTime() {
ret void
}
int test_imm_5Cint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x5C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Cint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 92
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_5Cint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6029312
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void orienti(int *a, int *b) {
  if (*b < *a) {
    int tmp = *a;
    *a = *b;
    *b = tmp;
  }
}


x86 assembly (clang, -O0):
<orienti>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    113c <orienti+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<orienti>:
mov    (%rsi),%eax
mov    (%rdi),%ecx
cmp    %ecx,%eax
jge    110c <orienti+0xc>
mov    %eax,(%rdi)
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define void @orienti(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** %4
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i32*, i32** %3
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = load i32*, i32** %4
store i32 %17, i32* %18
br label %19
19: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @orienti(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = icmp slt i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 %3, i32* %0
store i32 %4, i32* %1
br label %7
7: ; preds = %6, %2
ret void
}
int foo(int x, int y, int i, int j) {
  double tmp1 = ((double)x / y);
  double tmp2 = ((double)i / j);
  return tmp1 < tmp2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movd   %edx,%xmm0
movd   %edi,%xmm1
punpckldq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm0
movd   %ecx,%xmm1
movd   %esi,%xmm2
punpckldq %xmm1,%xmm2
cvtdq2pd %xmm2,%xmm1
divpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to double
%15 = fdiv double %12, %14
store double %15, double* %9
%16 = load i32, i32* %7
%17 = sitofp i32 %16 to double
%18 = load i32, i32* %8
%19 = sitofp i32 %18 to double
%20 = fdiv double %17, %19
store double %20, double* %10
%21 = load double, double* %9
%22 = load double, double* %10
%23 = fcmp olt double %21, %22
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = insertelement <2 x i32> poison, i32 %0, i64 0
%6 = insertelement <2 x i32> %5, i32 %2, i64 1
%7 = sitofp <2 x i32> %6 to <2 x double>
%8 = insertelement <2 x i32> poison, i32 %1, i64 0
%9 = insertelement <2 x i32> %8, i32 %3, i64 1
%10 = sitofp <2 x i32> %9 to <2 x double>
%11 = fdiv <2 x double> %7, %10
%12 = extractelement <2 x double> %11, i64 0
%13 = extractelement <2 x double> %11, i64 1
%14 = fcmp olt double %12, %13
%15 = zext i1 %14 to i32
ret i32 %15
}
int f_lt_cr2(float a1) { return !(((100) < (a1))); }


x86 assembly (clang, -O0):
<f_lt_cr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_lt_cr2>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_lt_cr2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_lt_cr2(float %0) {
%2 = fcmp ule float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_15uint32_mem(unsigned int *val) {
  return ((*val) & (0x15 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_15uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 21
%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_15uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 21
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
const char *my_strsignal(int signo) { return "???"; }


x86 assembly (clang, -O0):
<my_strsignal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strsignal>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"???\00"
define i8* @my_strsignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"???\00"
define i8* @my_strsignal(i32 %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
float convert_decmill_to_meters(float x_decmill) { return x_decmill / 10000; }


x86 assembly (clang, -O0):
<convert_decmill_to_meters>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_decmill_to_meters>:
divss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @convert_decmill_to_meters(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 1.000000e+04
ret float %4
}

LLVM IR (-O2):
define float @convert_decmill_to_meters(float %0) {
%2 = fdiv float %0, 1.000000e+04
ret float %2
}
void dl_G_RDPTILESYNC() {}


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

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

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

LLVM IR (-O2):
define void @dl_G_RDPTILESYNC() {
ret void
}
void gtk_item_deselect() {}


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

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

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

LLVM IR (-O2):
define void @gtk_item_deselect() {
ret void
}
/* Variables and functions */
int syscall(int, int);
int epoll_create1(int flags) { return syscall(357, flags); }


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

x86 assembly (clang, -O2):
<epoll_create1>:
mov    %edi,%esi
mov    $0x165,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @epoll_create1(i32 %0) {
%2 = tail call i32 @syscall(i32 357, i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ KAPI_save_as_header_String_array(int /*<<< orphan*/ *,
                                                    char **, int);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void KAPI_save_as_header_String_array_list(FILE *fp, char **ppch,
                                           int number_of_elements) {
  FILE *fpTmp = fp;
  KAPI_save_as_header_String_array(fp, ppch, number_of_elements);
  fwrite(",", sizeof(char), 1, fpTmp);
}


x86 assembly (clang, -O0):
<KAPI_save_as_header_String_array_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <KAPI_save_as_header_String_array@plt>
mov    -0x20(%rbp),%rcx
lea    0xeaa(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KAPI_save_as_header_String_array_list>:
push   %rbx
mov    %rdi,%rbx
call   1040 <KAPI_save_as_header_String_array@plt>
mov    $0x2c,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
define void @KAPI_save_as_header_String_array_list(i32* %0, i8** %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
store i32* %8, i32** %7
%9 = load i32*, i32** %4
%10 = load i8**, i8*** %5
%11 = load i32, i32* %6
%12 = call i32 @KAPI_save_as_header_String_array(i32* %9, i8** %10, i32 %11)
%13 = load i32*, i32** %7
%14 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32* %13)
ret void
}

LLVM IR (-O2):
define void @KAPI_save_as_header_String_array_list(i32* %0, i8** %1, i32 %2) {
%4 = tail call i32 @KAPI_save_as_header_String_array(i32* %0, i8** %1, i32 %2)
%5 = tail call i32 @fputc(i32 44, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(void) {
  fprintf(stderr, "%s\n",
          "bad command\n"
          "syntax: [command] [optional recipient] [optional msg]");
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xed9(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xedd(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [66 x i8] c"bad command\0Asyntax: [command] [optional recipient] [optional msg]\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [66 x i8] c"bad command\0Asyntax: [command] [optional recipient] [optional msg]\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ti_stddev_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_stddev_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_stddev_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_stddev_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_stddev_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LogLine(char *);
void ProcessASCIIData(char *pcBuffer, int iLength, int iBoard) {
  pcBuffer = 0;
  iLength = 0;
  iBoard = 0;
  LogLine("Cannot process ASCII data yet.");
}


x86 assembly (clang, -O0):
<ProcessASCIIData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec1(%rip),%rdi
call   1030 <LogLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"Cannot process ASCII data yet.\00"
define void @ProcessASCIIData(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i8* null, i8** %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 @LogLine(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Cannot process ASCII data yet.\00"
define void @ProcessASCIIData(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @LogLine(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int char_find_from(char *, int, char *, int, int /*<<< orphan*/);
int char_find(char *value, int value_length, char *key, int key_length) {
  return char_find_from(value, value_length, key, key_length, 0);
}


x86 assembly (clang, -O0):
<char_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <char_find_from@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_find>:
xor    %r8d,%r8d
jmp    1030 <char_find_from@plt>

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

LLVM IR (-O2):
define i32 @char_find(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @char_find_from(i8* %0, i32 %1, i8* %2, i32 %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ simanneal(int, int, int, int, double *, int *, int, int *);
int main() {
  double dist[4];
  int clusters[1];
  clusters[0] = 2;
  int ans[100];
  ans[0] = 0;
  ans[1] = 1;
  simanneal(2, 1, 100, 4, dist, ans, 1, clusters);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x34(%rbp)
movl   $0x0,-0x1d0(%rbp)
movl   $0x1,-0x1cc(%rbp)
lea    -0x30(%rbp),%r8
lea    -0x1d0(%rbp),%r9
lea    -0x34(%rbp),%rax
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x64,%edx
mov    $0x4,%ecx
movl   $0x1,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <simanneal@plt>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x1c8,%rsp
movl   $0x2,0xc(%rsp)
movabs $0x100000000,%rax
mov    %rax,0x30(%rsp)
lea    0xc(%rsp),%rax
lea    0x10(%rsp),%r8
lea    0x30(%rsp),%r9
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x64,%edx
mov    $0x4,%ecx
push   %rax
push   $0x1
call   1030 <simanneal@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x1c8,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x double]
%3 = alloca [1 x i32]
%4 = alloca [100 x i32]
store i32 0, i32* %1
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 2, i32* %5
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
store i32 0, i32* %6
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 1
store i32 1, i32* %7
%8 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%10 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%11 = call i32 @simanneal(i32 2, i32 1, i32 100, i32 4, double* %8, i32* %9, i32 1, i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x double]
%2 = alloca [1 x i32]
%3 = alloca [100 x i32]
%4 = bitcast [4 x double]* %1 to i8*
%5 = bitcast [1 x i32]* %2 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 2, i32* %6
%7 = bitcast [100 x i32]* %3 to i8*
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
store i32 0, i32* %8
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 1
store i32 1, i32* %9
%10 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%11 = call i32 @simanneal(i32 2, i32 1, i32 100, i32 4, double* %10, i32* %8, i32 1, i32* %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ const int64_t;

/* Variables and functions */
int /*<<< orphan*/ const pts_diff(int /*<<< orphan*/ const,
                                  int /*<<< orphan*/ const);
int64_t pts_diff_abs(const uint64_t a, const uint64_t b) {
  const int64_t t = pts_diff(a, b);
  return t < 0 ? -t : t;
}


x86 assembly (clang, -O0):
<pts_diff_abs>:
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   1030 <pts_diff@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1143 <pts_diff_abs+0x33>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <pts_diff_abs+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pts_diff_abs>:
push   %rax
call   1030 <pts_diff@plt>
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pts_diff_abs(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 @pts_diff(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 %14
11: ; preds = %2
%12 = load i32, i32* %5
%13 = sub nsw i32 0, %12
br label %16
14: ; preds = %2
%15 = load i32, i32* %5
br label %16
16: ; preds = %14, %11
%17 = phi i32 [ %13, %11 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @pts_diff_abs(i32 %0, i32 %1) {
%3 = tail call i32 @pts_diff(i32 %0, i32 %1)
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 true)
ret i32 %4
}
/* Variables and functions */
unsigned char vx86_NBSB_Read8(int, unsigned char);
unsigned char nb1_Read8(unsigned char offset) {
  return vx86_NBSB_Read8(1, offset);
}


x86 assembly (clang, -O0):
<nb1_Read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <vx86_NBSB_Read8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @nb1_Read8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @vx86_NBSB_Read8(i32 1, i8 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @nb1_Read8(i8 zeroext %0) {
%2 = tail call zeroext i8 @vx86_NBSB_Read8(i32 1, i8 zeroext %0)
ret i8 %2
}
float fftease_prand(int *seed) {
  int i = ((*seed = *seed * 1103515245 + 12345) >> 16) & 077777;
  return ((float)i / 32768.);
}


x86 assembly (clang, -O0):
<fftease_prand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x41c64e6d,(%rax),%eax
add    $0x3039,%eax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
sar    $0x10,%eax
and    $0x7fff,%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftease_prand>:
imul   $0x41c64e6d,(%rdi),%eax
add    $0x3039,%eax
mov    %eax,(%rdi)
shr    $0x10,%eax
and    $0x7fff,%eax
cvtsi2ss %eax,%xmm0
mulss  0xedf(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fftease_prand(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1103515245
%7 = add nsw i32 %6, 12345
%8 = load i32*, i32** %2
store i32 %7, i32* %8
%9 = ashr i32 %7, 16
%10 = and i32 %9, 32767
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to float
%13 = fpext float %12 to double
%14 = fdiv double %13, 3.276800e+04
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
define float @fftease_prand(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 1103515245
%4 = add nsw i32 %3, 12345
store i32 %4, i32* %0
%5 = lshr i32 %4, 16
%6 = and i32 %5, 32767
%7 = sitofp i32 %6 to float
%8 = fmul float %7, 0x3F00000000000000
ret float %8
}
void ft_strclr(char *s) {
  if (s) {
    while (*s) {
      *s = '\0';
      s++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1142 <ft_strclr+0x42>
jmp    1118 <ft_strclr+0x18>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <ft_strclr+0x3d>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1118 <ft_strclr+0x18>
jmp    1142 <ft_strclr+0x42>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

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

/* Variables and functions */
int main() {
  uint32_t a = 7, b = 3, c, r;
  c = a / b;
  r = a % b;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
store i32 3, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sdiv i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = srem i32 %9, %10
store i32 %11, i32* %5
ret i32 0
}

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


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

x86 assembly (clang, -O2):
<do_insertfile_void>:
push   %rbx
xor    %edi,%edi
call   1040 <do_insertfile@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <display_main_list@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @do_insertfile_void() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @do_insertfile(i32 0)
store i32 %2, i32* %1
%3 = call i32 (...) @display_main_list()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @do_insertfile_void() {
%1 = tail call i32 @do_insertfile(i32 0)
%2 = tail call i32 (...) @display_main_list()
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  char *chars;
};
typedef TYPE_1__ XmbTextItem;

/* Variables and functions */
void set_XmbTextItem_chars(void *_p, void *_v) {
  ((XmbTextItem *)_p)->chars = (char *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i8* }
define void @set_XmbTextItem_chars(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i8* %5, i8** %8
ret void
}

LLVM IR (-O2):
define void @set_XmbTextItem_chars(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ repeat(char, int);
void hskip(int n) { repeat(' ', n); }


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

x86 assembly (clang, -O2):
<hskip>:
mov    %edi,%esi
mov    $0x20,%edi
jmp    1030 <repeat@plt>

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

LLVM IR (-O2):
define void @hskip(i32 %0) {
%2 = tail call i32 @repeat(i8 signext 32, i32 %0)
ret void
}
char *strstr(const char *haystack, const char *needle) {
  return ({
    extern __typeof__(strstr) module_libc_strstr;
    &module_libc_strstr;
  })(haystack, needle);
}


x86 assembly (clang, -O0):
<strstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr>:
jmp    1030 <module_libc_strstr@plt>

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

LLVM IR (-O2):
define i8* @strstr(i8* %0, i8* %1) {
%3 = tail call i8* @module_libc_strstr(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "usage: %s dbpath [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb]\n",
          prog);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"usage: %s dbpath [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"usage: %s dbpath [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int find(int value, const int *array, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (array[i] == value)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <find+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <find+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <find+0x5b>
jmp    1146 <find+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <find+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
test   %edx,%edx
jle    111e <find+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <find+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <find+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @open_shm_log(i8* nocapture %0) {
ret void
}