xunge/DecIR huggingface dataset:
float CoordFromCell(int cellwidth, int cell, float f) {
  int cellPos = (cell * cellwidth);
  float r = (cellPos - (16384)) + f;
  return r;
}


x86 assembly (clang, -O0):
<CoordFromCell>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x4000,%eax
cvtsi2ss %eax,%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CoordFromCell>:
imul   %esi,%edi
add    $0xffffc000,%edi
cvtsi2ss %edi,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @CoordFromCell(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = sub nsw i32 %12, 16384
%14 = sitofp i32 %13 to float
%15 = load float, float* %6
%16 = fadd float %14, %15
store float %16, float* %8
%17 = load float, float* %8
ret float %17
}

LLVM IR (-O2):
define float @CoordFromCell(i32 %0, i32 %1, float %2) {
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %4, -16384
%6 = sitofp i32 %5 to float
%7 = fadd float %6, %2
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ syscall_exit(int);
void out_of_memory() {
  printf("Out of memory.\n");
  syscall_exit(1);
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Out of memory.\00"
define void @out_of_memory() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @syscall_exit(i32 1)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ STDOUT_FILENO;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int pipexec_redir(void *, int /*<<< orphan*/, int, int);
int pipexec_redir_stdout(void *path) {
  return pipexec_redir(path, STDOUT_FILENO, O_CREAT | O_TRUNC | O_WRONLY,
                       S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
}


x86 assembly (clang, -O0):
<pipexec_redir_stdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
mov    0x2eb7(%rip),%rax
or     (%rax),%edx
mov    0x2e5e(%rip),%rax
or     (%rax),%edx
mov    0x2e65(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7c(%rip),%rax
or     (%rax),%ecx
mov    0x2e63(%rip),%rax
or     (%rax),%ecx
mov    0x2e52(%rip),%rax
or     (%rax),%ecx
call   1030 <pipexec_redir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipexec_redir_stdout>:
mov    0x2ee1(%rip),%rax
mov    0x2ed2(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e77(%rip),%rax
or     (%rax),%edx
mov    0x2e7e(%rip),%rax
mov    0x2e97(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2e9c(%rip),%rax
mov    0x2e75(%rip),%rsi
or     (%rsi),%ecx
mov    (%rax),%esi
mov    0x2e62(%rip),%rax
or     (%rax),%ecx
jmp    1030 <pipexec_redir@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@O_WRONLY = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i32 @pipexec_redir_stdout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @STDOUT_FILENO
%5 = load i32, i32* @O_CREAT
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = load i32, i32* @O_WRONLY
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IRUSR
%11 = load i32, i32* @S_IWUSR
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IRGRP
%14 = or i32 %12, %13
%15 = load i32, i32* @S_IROTH
%16 = or i32 %14, %15
%17 = call i32 @pipexec_redir(i8* %3, i32 %4, i32 %9, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@O_WRONLY = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i32 @pipexec_redir_stdout(i8* %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_TRUNC
%5 = or i32 %4, %3
%6 = load i32, i32* @O_WRONLY
%7 = or i32 %5, %6
%8 = load i32, i32* @S_IRUSR
%9 = load i32, i32* @S_IWUSR
%10 = or i32 %9, %8
%11 = load i32, i32* @S_IRGRP
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IROTH
%14 = or i32 %12, %13
%15 = tail call i32 @pipexec_redir(i8* %0, i32 %2, i32 %7, i32 %14)
ret i32 %15
}
int a(int n) { return n * n; }


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

x86 assembly (clang, -O2):
<a>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_add_acls_for_user();
int main(int argc, char **argv) {
  test_add_acls_for_user();
  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   1030 <test_add_acls_for_user@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_add_acls_for_user()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_add_acls_for_user()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256;

/* Variables and functions */
int /*<<< orphan*/ _mm256_setr_ps(int /*<<< orphan*/, float, int /*<<< orphan*/,
                                  float, int /*<<< orphan*/, float,
                                  int /*<<< orphan*/, float);
int /*<<< orphan*/ _mm256_xor_ps(int /*<<< orphan*/, int /*<<< orphan*/ const);
__m256 _mm256_conjugate_ps(__m256 x) {
  const __m256 conjugator = _mm256_setr_ps(0, -0.f, 0, -0.f, 0, -0.f, 0, -0.f);
  return _mm256_xor_ps(x, conjugator);
}


x86 assembly (clang, -O0):
<_mm256_conjugate_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %ecx,%ecx
movss  0xecb(%rip),%xmm3
mov    %ecx,%edi
movaps %xmm3,%xmm0
mov    %ecx,%esi
movaps %xmm3,%xmm1
mov    %ecx,%edx
movaps %xmm3,%xmm2
call   1040 <_mm256_setr_ps@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm256_xor_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm256_conjugate_ps>:
push   %rbx
mov    %edi,%ebx
movss  0xed5(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
movaps %xmm0,%xmm1
xor    %edx,%edx
movaps %xmm0,%xmm2
xor    %ecx,%ecx
movaps %xmm0,%xmm3
call   1040 <_mm256_setr_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_mm256_xor_ps@plt>

LLVM IR (-O0):
define i32 @_mm256_conjugate_ps(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @_mm256_setr_ps(i32 0, float -0.000000e+00, i32 0, float -0.000000e+00, i32 0, float -0.000000e+00, i32 0, float -0.000000e+00)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @_mm256_xor_ps(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_mm256_conjugate_ps(i32 %0) {
%2 = tail call i32 @_mm256_setr_ps(i32 0, float -0.000000e+00, i32 0, float -0.000000e+00, i32 0, float -0.000000e+00, i32 0, float -0.000000e+00)
%3 = tail call i32 @_mm256_xor_ps(i32 %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t todword(const uint8_t *p) {
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


x86 assembly (clang, -O0):
<todword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<todword>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @todword(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %6, %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = shl i32 %12, 24
%14 = or i32 %10, %13
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void mumble_channelremove_callback(uint32_t channel_id, void *user_data) {
  printf("Channel %d removed\n", channel_id);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Channel %d removed\0A\00"
define void @mumble_channelremove_callback(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Channel %d removed\0A\00"
define void @mumble_channelremove_callback(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct webidl_node {
  int dummy;
};
struct binding {
  int dummy;
};

/* Variables and functions */
int output_operator_body(struct binding *, int /*<<< orphan*/);
int /*<<< orphan*/ webidl_node_gettext(struct webidl_node *);
int webidl_implements_cb(struct webidl_node *node, void *ctx) {
  struct binding *binding = ctx;
  return output_operator_body(binding, webidl_node_gettext(node));
}


x86 assembly (clang, -O0):
<webidl_implements_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <webidl_node_gettext@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <output_operator_body@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<webidl_implements_cb>:
push   %rbx
mov    %rsi,%rbx
call   1030 <webidl_node_gettext@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <output_operator_body@plt>

LLVM IR (-O0):
%struct.webidl_node = type { i32 }
%struct.binding = type { i32 }
define i32 @webidl_implements_cb(%struct.webidl_node* %0, i8* %1) {
%3 = alloca %struct.webidl_node*
%4 = alloca i8*
%5 = alloca %struct.binding*
store %struct.webidl_node* %0, %struct.webidl_node** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.binding*
store %struct.binding* %7, %struct.binding** %5
%8 = load %struct.binding*, %struct.binding** %5
%9 = load %struct.webidl_node*, %struct.webidl_node** %3
%10 = call i32 @webidl_node_gettext(%struct.webidl_node* %9)
%11 = call i32 @output_operator_body(%struct.binding* %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.webidl_node = type { i32 }
%struct.binding = type { i32 }
define i32 @webidl_implements_cb(%struct.webidl_node* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.binding*
%4 = tail call i32 @webidl_node_gettext(%struct.webidl_node* %0)
%5 = tail call i32 @output_operator_body(%struct.binding* %3, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(void *, int /*<<< orphan*/, int /*<<< orphan*/);
int64_t asf_fileio_seek_cb(void *stream, int64_t offset) {
  return fseek(stream, offset, SEEK_SET);
}


x86 assembly (clang, -O0):
<asf_fileio_seek_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asf_fileio_seek_cb>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @asf_fileio_seek_cb(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @fseek(i8* %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @asf_fileio_seek_cb(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i8* %0, i32 %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void libx2_f1(void) { printf("CALL libx2_f1\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"CALL libx2_f1\00"
define void @libx2_f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int kata_add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Hello World: 100+200=%d\n", kata_add(100, 200));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
mov    $0xc8,%esi
call   1030 <kata_add@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
mov    $0xc8,%esi
call   1030 <kata_add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Hello World: 100+200=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @kata_add(i32 100, i32 200)
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Hello World: 100+200=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @kata_add(i32 100, i32 200)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ COND_GE();
int /*<<< orphan*/ EA_A7_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sge_8_pd7(void) {
  m68ki_write_8(EA_A7_PD_8(), COND_GE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sge_8_pd7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_A7_PD_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_GE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sge_8_pd7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_A7_PD_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_GE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sge_8_pd7() {
%1 = call i32 (...) @EA_A7_PD_8()
%2 = call i64 (...) @COND_GE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sge_8_pd7() {
%1 = tail call i32 (...) @EA_A7_PD_8()
%2 = tail call i64 (...) @COND_GE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void writelines(char *lineptr[], int nlines) {
  int i;
  for (int i = 0; i < nlines; i++) {
    printf("%s\n", lineptr[i]);
  }
}


x86 assembly (clang, -O0):
<writelines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <writelines+0x48>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <writelines+0x16>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int is_term(int c) { return c == '/' || c == '\\' || c == '\0'; }


x86 assembly (clang, -O0):
<is_term>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <is_term+0x2f>
mov    $0x1,%al
cmpl   $0x5c,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <is_term+0x2f>
cmpl   $0x0,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_term>:
mov    $0x1,%eax
cmp    $0x2f,%edi
je     110f <is_term+0xf>
cmp    $0x5c,%edi
jne    1110 <is_term+0x10>
ret
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_term(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 47
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 92
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ true, %5 ], [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_term(i32 %0) {
switch i32 %0, label %2 [
i32 92, label %5
i32 47, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ERA_D_FMT;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_era_d_fmt() { return nl_langinfo(ERA_D_FMT); }


x86 assembly (clang, -O0):
<langinfo_era_d_fmt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_era_d_fmt>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ERA_D_FMT = global i32 0
define i8* @langinfo_era_d_fmt() {
%1 = load i32, i32* @ERA_D_FMT
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ERA_D_FMT = global i32 0
define i8* @langinfo_era_d_fmt() {
%1 = load i32, i32* @ERA_D_FMT
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int ig_indirect_table_get(unsigned int, int, unsigned int, int, unsigned int *);
int ig_prc_lut_table_get(unsigned int dev_id, unsigned int index,
                         unsigned int *pentry) {
  if ((index < 0) || (index > 47)) {
    return -1;
  }
  return ig_indirect_table_get(dev_id, 1, index, 10, pentry);
}


x86 assembly (clang, -O0):
<ig_prc_lut_table_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jb     1136 <ig_prc_lut_table_get+0x26>
cmpl   $0x2f,-0xc(%rbp)
jbe    1142 <ig_prc_lut_table_get+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <ig_prc_lut_table_get+0x4e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x1,%esi
mov    $0xa,%ecx
call   1030 <ig_indirect_table_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ig_prc_lut_table_get>:
cmp    $0x2f,%esi
jbe    111b <ig_prc_lut_table_get+0xb>
mov    $0xffffffff,%eax
ret
mov    %rdx,%r8
mov    %esi,%edx
mov    $0x1,%esi
mov    $0xa,%ecx
jmp    1030 <ig_indirect_table_get@plt>

LLVM IR (-O0):
define i32 @ig_prc_lut_table_get(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 47
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @ig_indirect_table_get(i32 %15, i32 1, i32 %16, i32 10, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @ig_prc_lut_table_get(i32 %0, i32 %1, i32* %2) {
%4 = icmp ugt i32 %1, 47
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @ig_indirect_table_get(i32 %0, i32 1, i32 %1, i32 10, i32* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
int test1(int x) { return x / -10 == 2; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
add    $0x1d,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = add i32 %0, 29
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ say_hello();
int main(int argc, char *argv[]) {
  say_hello();
  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   1030 <say_hello@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @say_hello()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @say_hello()
ret i32 0
}
int misc_llseek(void) {
  { return (0); }
}


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

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

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

LLVM IR (-O2):
define i32 @misc_llseek() {
ret i32 0
}
/* Variables and functions */
unsigned long random();
void random_wordstring(unsigned long *a, long n) {
  long i;
  for (i = 0; i < n; i++)
    a[i] = random();
}


x86 assembly (clang, -O0):
<random_wordstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    115d <random_wordstring+0x4d>
mov    $0x0,%al
call   1030 <random@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <random_wordstring+0x18>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @random_wordstring(i64* nocapture writeonly %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = tail call i64 (...) @random()
%7 = getelementptr inbounds i64, i64* %0, i64 %5
store i64 %6, i64* %7
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
int clamp255(int x) {
  if (x < 0)
    return (0);
  if (x > 255)
    return (255);
  return (x);
}


x86 assembly (clang, -O0):
<clamp255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <clamp255+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <clamp255+0x3c>
cmpl   $0xff,-0x8(%rbp)
jle    1136 <clamp255+0x36>
movl   $0xff,-0x4(%rbp)
jmp    113c <clamp255+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp255>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @clamp255(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 255
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 255, i32* %2
br label %13
11: ; preds = %7
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %10, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @clamp255(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
cputs(s) register char *s;
{
  while (*s)
    putch(*s++);
}


x86 assembly (clang, -O0):
<cputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <cputs+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putch@plt>
jmp    111c <cputs+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <cputs+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <cputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putch to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int AF_INET;
int af_inet() { return AF_INET; }


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

x86 assembly (clang, -O2):
<af_inet>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@AF_INET = global i32 0
define i32 @af_inet() {
%1 = load i32, i32* @AF_INET
ret i32 %1
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @af_inet() {
%1 = load i32, i32* @AF_INET
ret i32 %1
}
void instruction_release(void) {}


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

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

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

LLVM IR (-O2):
define void @instruction_release() {
ret void
}
/* Variables and functions */
size_t *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void warning_test1(void) {
  size_t *p;
  printf("testing warning\n");
  p = malloc(~0);
}


x86 assembly (clang, -O0):
<warning_test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning_test1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
pop    %rax
jmp    1040 <malloc@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"testing warning\0A\00"
define void @warning_test1() {
%1 = alloca i64*
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i64* @malloc(i32 -1)
store i64* %3, i64** %1
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"testing warning\00"
define void @warning_test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i64* @malloc(i32 -1)
ret void
}
float avg(float x[]) {
  int i;
  float sum = 0;
  for (i = 0; i < 10; i++) {
    sum += x[i];
  }
  return sum / 10;
}


x86 assembly (clang, -O0):
<avg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1146 <avg+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <avg+0x17>
movss  -0x10(%rbp),%xmm0
movss  0xead(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg>:
xorps  %xmm0,%xmm0
addss  (%rdi),%xmm0
addss  0x4(%rdi),%xmm0
addss  0x8(%rdi),%xmm0
addss  0xc(%rdi),%xmm0
addss  0x10(%rdi),%xmm0
addss  0x14(%rdi),%xmm0
addss  0x18(%rdi),%xmm0
addss  0x1c(%rdi),%xmm0
addss  0x20(%rdi),%xmm0
addss  0x24(%rdi),%xmm0
divss  0xec4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @avg(float* %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca float
store float* %0, float** %2
store float 0.000000e+00, float* %4
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load float*, float** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %9, i64 %11
%13 = load float, float* %12
%14 = load float, float* %4
%15 = fadd float %14, %13
store float %15, float* %4
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = load float, float* %4
%21 = fdiv float %20, 1.000000e+01
ret float %21
}

LLVM IR (-O2):
define float @avg(float* nocapture %0) {
%2 = load float, float* %0
%3 = fadd float %2, 0.000000e+00
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fadd float %3, %5
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fadd float %6, %8
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = fadd float %9, %11
%13 = getelementptr inbounds float, float* %0, i64 4
%14 = load float, float* %13
%15 = fadd float %12, %14
%16 = getelementptr inbounds float, float* %0, i64 5
%17 = load float, float* %16
%18 = fadd float %15, %17
%19 = getelementptr inbounds float, float* %0, i64 6
%20 = load float, float* %19
%21 = fadd float %18, %20
%22 = getelementptr inbounds float, float* %0, i64 7
%23 = load float, float* %22
%24 = fadd float %21, %23
%25 = getelementptr inbounds float, float* %0, i64 8
%26 = load float, float* %25
%27 = fadd float %24, %26
%28 = getelementptr inbounds float, float* %0, i64 9
%29 = load float, float* %28
%30 = fadd float %27, %29
%31 = fdiv float %30, 1.000000e+01
ret float %31
}
void exynos_drm_fbdev_resume(struct drm_device *drm) {}


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define void @exynos_drm_fbdev_resume(%struct.drm_device* nocapture %0) {
ret void
}
/* Variables and functions */
long double log10(long double);
long double fun_log10(long double a) { return log10(a); }


x86 assembly (clang, -O0):
<fun_log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log10@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_log10>:
jmp    1030 <log10@plt>

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

LLVM IR (-O2):
define x86_fp80 @fun_log10(x86_fp80 %0) {
%2 = tail call x86_fp80 @log10(x86_fp80 %0)
ret x86_fp80 %2
}
int unauth_key(int keytype) {
  switch (keytype) {
  case 5:
  case 7:
    return 3;
  case 6:
  case 8:
    return 4;
  default:
    return keytype;
  }
}


x86 assembly (clang, -O0):
<unauth_key>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffb,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1148 <unauth_key+0x48>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    114e <unauth_key+0x4e>
movl   $0x4,-0x4(%rbp)
jmp    114e <unauth_key+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unauth_key>:
mov    %edi,%eax
lea    -0x5(%rax),%ecx
cmp    $0x3,%ecx
ja     1117 <unauth_key+0x17>
movslq %ecx,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @unauth_key(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 5, label %5
i32 7, label %5
i32 6, label %6
i32 8, label %6
]
5: ; preds = %1, %1
store i32 3, i32* %2
br label %9
6: ; preds = %1, %1
store i32 4, i32* %2
br label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %9
9: ; preds = %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@switch.table.unauth_key = [4 x i32] [i32 3, i32 4, i32 3, i32 4]
define i32 @unauth_key(i32 %0) {
%2 = add i32 %0, -5
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.unauth_key, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ %0, %1 ]
ret i32 %9
}
__attribute__((always_)) void rcu_read_lock_sched(void) {
  do {
  } while (0);
  (void)0;
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<rcu_read_lock_sched>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <rcu_read_lock_sched+0x9>
jmp    110e <rcu_read_lock_sched+0xe>
jmp    1113 <rcu_read_lock_sched+0x13>
jmp    1118 <rcu_read_lock_sched+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rcu_read_lock_sched() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
br label %3
3: ; preds = %2
br label %4
4: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @rcu_read_lock_sched() {
ret void
}
int f() {
  static int __thread y;
  return y++;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
lea    0x2eb5(%rip),%rdi
call   1030 <__tls_get_addr@plt>
mov    %rax,%rcx
mov    0x0(%rcx),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,0x0(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
lea    0x2eb8(%rip),%rdi
call   1030 <__tls_get_addr@plt>
mov    0x0(%rax),%ecx
lea    0x1(%rcx),%edx
mov    %edx,0x0(%rax)
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@f.y = internal thread_local global i32 0
define i32 @f() {
%1 = load i32, i32* @f.y
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f.y
ret i32 %1
}

LLVM IR (-O2):
@f.y = internal thread_local unnamed_addr global i32 0
define i32 @f() {
%1 = load i32, i32* @f.y
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f.y
ret i32 %1
}
int *odds(void) {
  int x;
  static int o[5];
  for (x = 0; x < 5; x++)
    o[x] = 2 * x + 1;
  return o;
}


x86 assembly (clang, -O0):
<odds>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    113a <odds+0x3a>
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
add    $0x1,%edx
movslq -0x4(%rbp),%rcx
lea    0x2f07(%rip),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <odds+0xb>
lea    0x2eef(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odds>:
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x2f22(%rip)
lea    0x2f1b(%rip),%rax
movl   $0x9,0x2f21(%rip)
ret

LLVM IR (-O0):
@odds.o = internal global [5 x i32] zeroinitializer
define i32* @odds() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 5
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = load i32, i32* %1
%7 = mul nsw i32 2, %6
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* @odds.o, i64 0, i64 %10
store i32 %8, i32* %11
br label %12
12: ; preds = %5
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret i32* getelementptr inbounds ([5 x i32], [5 x i32]* @odds.o, i64 0, i64 0)
}

LLVM IR (-O2):
@odds.o = internal global [5 x i32] zeroinitializer
define i32* @odds() {
store <4 x i32> <i32 1, i32 3, i32 5, i32 7>, <4 x i32>* bitcast ([5 x i32]* @odds.o to <4 x i32>*)
store i32 9, i32* getelementptr inbounds ([5 x i32], [5 x i32]* @odds.o, i64 0, i64 4)
ret i32* getelementptr inbounds ([5 x i32], [5 x i32]* @odds.o, i64 0, i64 0)
}
void hugs_primControl(what) int what;
{}


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

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

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

LLVM IR (-O2):
define void @hugs_primControl(i32 %0) {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int get_current_time() {
  struct timeval curtime;
  gettimeofday(&curtime, NULL);
  return (curtime.tv_sec * 1000000) + curtime.tv_usec;
}


x86 assembly (clang, -O0):
<get_current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @get_current_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @get_current_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
int clear() { return (0); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ hash_map_sym_push_value(struct key_value *, void *);
struct key_value *inter_mapping_intern(struct hash_table *, char *);
void inter_mapping_push_value(struct hash_table *map, char *sym_key,
                              void *value) {
  struct key_value *binding = inter_mapping_intern(map, sym_key);
  hash_map_sym_push_value(binding, value);
}


x86 assembly (clang, -O0):
<inter_mapping_push_value>:
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
call   1030 <inter_mapping_intern@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <hash_map_sym_push_value@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_mapping_push_value>:
push   %rbx
mov    %rdx,%rbx
call   1030 <inter_mapping_intern@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <hash_map_sym_push_value@plt>

LLVM IR (-O0):
%struct.hash_table = type { i32 }
%struct.key_value = type { i32 }
define void @inter_mapping_push_value(%struct.hash_table* %0, i8* %1, i8* %2) {
%4 = alloca %struct.hash_table*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.key_value*
store %struct.hash_table* %0, %struct.hash_table** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load %struct.hash_table*, %struct.hash_table** %4
%9 = load i8*, i8** %5
%10 = call %struct.key_value* @inter_mapping_intern(%struct.hash_table* %8, i8* %9)
store %struct.key_value* %10, %struct.key_value** %7
%11 = load %struct.key_value*, %struct.key_value** %7
%12 = load i8*, i8** %6
%13 = call i32 @hash_map_sym_push_value(%struct.key_value* %11, i8* %12)
ret void
}

LLVM IR (-O2):
%struct.hash_table = type { i32 }
%struct.key_value = type { i32 }
define void @inter_mapping_push_value(%struct.hash_table* %0, i8* %1, i8* %2) {
%4 = tail call %struct.key_value* @inter_mapping_intern(%struct.hash_table* %0, i8* %1)
%5 = tail call i32 @hash_map_sym_push_value(%struct.key_value* %4, i8* %2)
ret void
}