xunge/DecIR huggingface dataset:
/* Variables and functions */
double fmod(double, double);
double sync(double x1, double x2) {
  return x1 - fmod(x1, 6.28318530717958647693) +
         fmod(x2, 6.28318530717958647693 * x2 / x1);
}


x86 assembly (clang, -O0):
<sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
call   1030 <fmod@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  -0x8(%rbp),%xmm1
call   1030 <fmod@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0xed8(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0x10(%rsp),%xmm2
movsd  0xec5(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0x8(%rsp),%xmm3
divsd  %xmm3,%xmm1
subsd  %xmm0,%xmm3
movsd  %xmm3,0x8(%rsp)
movapd %xmm2,%xmm0
call   1030 <fmod@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sync(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = call double @fmod(double %6, double 0x401921FB54442D18)
%8 = fsub double %5, %7
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double 0x401921FB54442D18, %10
%12 = load double, double* %3
%13 = fdiv double %11, %12
%14 = call double @fmod(double %9, double %13)
%15 = fadd double %8, %14
ret double %15
}

LLVM IR (-O2):
define double @sync(double %0, double %1) {
%3 = tail call double @fmod(double %0, double 0x401921FB54442D18)
%4 = fsub double %0, %3
%5 = fmul double %1, 0x401921FB54442D18
%6 = fdiv double %5, %0
%7 = tail call double @fmod(double %1, double %6)
%8 = fadd double %4, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *random_bytes(int);
char random_llong() {
  void *ptr = random_bytes(sizeof(long long));
  long long out = *(long long *)ptr;
  free(ptr);
  return out;
}


x86 assembly (clang, -O0):
<random_llong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1040 <random_bytes@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_llong>:
push   %rbx
mov    $0x8,%edi
call   1040 <random_bytes@plt>
mov    (%rax),%bl
mov    %rax,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @random_llong() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i8* @random_bytes(i32 8)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
store i64 %6, i64* %2
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
%9 = load i64, i64* %2
%10 = trunc i64 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @random_llong() {
%1 = tail call i8* @random_bytes(i32 8)
%2 = bitcast i8* %1 to i64*
%3 = load i64, i64* %2
%4 = tail call i32 @free(i8* %1)
%5 = trunc i64 %3 to i8
ret i8 %5
}
void nseel_asm_shr(void) {
  __asm__("fistpl (%esi)\n"
          "fistpl 4(%esi)\n"
          "movl (%esi), %ecx\n"
          "movl 4(%esi), %eax\n"
          "sarl %cl, %eax\n"
          "movl %eax, (%esi)\n"
          "fildl (%esi)\n");
}


x86 assembly (clang, -O0):
<nseel_asm_shr>:
push   %rbp
mov    %rsp,%rbp
fistpl (%esi)
fistpl 0x4(%esi)
mov    (%esi),%ecx
mov    0x4(%esi),%eax
sar    %cl,%eax
mov    %eax,(%esi)
fildl  (%esi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_shr>:
fistpl (%esi)
fistpl 0x4(%esi)
mov    (%esi),%ecx
mov    0x4(%esi),%eax
sar    %cl,%eax
mov    %eax,(%esi)
fildl  (%esi)
ret

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

LLVM IR (-O2):
define void @nseel_asm_shr() {
tail call void asm sideeffect "fistpl (%esi)\0Afistpl 4(%esi)\0Amovl (%esi), %ecx\0Amovl 4(%esi), %eax\0Asarl %cl, %eax\0Amovl %eax, (%esi)\0Afildl (%esi)\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int myIsDevNative(char *devName) { return (strncmp(devName, "/dev/", 5) == 0); }


x86 assembly (clang, -O0):
<myIsDevNative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myIsDevNative>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/dev/\00"
define i32 @myIsDevNative(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"/dev/\00"
define i32 @myIsDevNative(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ S();
int /*<<< orphan*/ init(char *);
int main(int argc, char *argv[]) {
  init("a dog eat a cat ");
  S();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <init@plt>
mov    $0x0,%al
call   1040 <S@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <init@plt>
xor    %eax,%eax
call   1040 <S@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"a dog eat a cat \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @init(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @S()
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"a dog eat a cat \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @init(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @S()
ret i32 0
}
/* Variables and functions */
int close(int);
int cst_socket_close(int socket) { return close(socket); }


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

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

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

LLVM IR (-O2):
define i32 @cst_socket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
int /*<<< orphan*/ waitpid_err(int /*<<< orphan*/ const, int);
void reap(pid_t pid) {
  (void)pid;
  int status;
  const pid_t cpid = waitpid(-1, &status, WNOHANG);
  waitpid_err(cpid, status);
}


x86 assembly (clang, -O0):
<reap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <waitpid_err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reap>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
mov    0x4(%rsp),%esi
mov    %eax,%edi
call   1030 <waitpid_err@plt>
pop    %rax
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @reap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %3, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @waitpid_err(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @reap(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @waitpid_err(i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flush_binlog();
void cron(void) { flush_binlog(); }


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

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

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

LLVM IR (-O2):
define void @cron() {
%1 = tail call i32 (...) @flush_binlog()
ret void
}
/* Type definitions */
struct bitmask {
  int dummy;
};

/* Variables and functions */
unsigned int bitmask_next(struct bitmask const *, int /*<<< orphan*/);
unsigned int bitmask_first(const struct bitmask *bmp) {
  return bitmask_next(bmp, 0);
}


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

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

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

LLVM IR (-O2):
%struct.bitmask = type { i32 }
define i32 @bitmask_first(%struct.bitmask* %0) {
%2 = tail call i32 @bitmask_next(%struct.bitmask* %0, i32 0)
ret i32 %2
}
void LCD_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @LCD_SaveConfig() {
ret void
}
void f120(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({
      goto a;
    a:
      0;
    });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f120>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f120() {
ret void
}
/* Variables and functions */
int kb_unlock_data(void const *, char const *);
int kb_unlock_var(const void *addr, unsigned size) {
  return kb_unlock_data(addr, (const char *)addr + size);
}


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

x86 assembly (clang, -O2):
<kb_unlock_var>:
mov    %esi,%esi
add    %rdi,%rsi
jmp    1030 <kb_unlock_data@plt>

LLVM IR (-O0):
define i32 @kb_unlock_var(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 i8*, i8** %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = call i32 @kb_unlock_data(i8* %5, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @kb_unlock_var(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @kb_unlock_data(i8* %0, i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void fopPx(unsigned char *p) { printf("P%x", *p & 3); }


x86 assembly (clang, -O0):
<fopPx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x3,%eax
lea    0xed3(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopPx>:
movzbl (%rdi),%esi
and    $0x3,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"P%x\00"
define void @fopPx(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 3
%7 = trunc i32 %6 to i8
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"P%x\00"
define void @fopPx(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 3
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ hash_data(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
uint64_t hash_string(char *s) { return hash_data(s, strlen(s)); }


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <hash_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <hash_data@plt>

LLVM IR (-O0):
define i32 @hash_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @hash_data(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @hash_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @hash_data(i8* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ fuzz_get_random_data(void *, size_t);
ssize_t fuzz_read(int sockfd, void *buf, size_t len) {
  return fuzz_get_random_data(buf, len);
}


x86 assembly (clang, -O0):
<fuzz_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fuzz_get_random_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzz_read>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <fuzz_get_random_data@plt>

LLVM IR (-O0):
define i32 @fuzz_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = call i32 @fuzz_get_random_data(i8* %7, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @fuzz_read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @fuzz_get_random_data(i8* %1, i64 %2)
ret i32 %4
}
int test_imm_D0int32_reg(int val) { return ((val) & (0xD0 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_D0int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D0int32_reg>:
test   $0xd0,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D0int32_reg(i32 %0) {
%2 = and i32 %0, 208
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned char toupper(int);
unsigned char my_toupper(int c) {
  if (c == 229)
    return 197;
  else if (c == 228)
    return 196;
  else if (c == 246)
    return 214;
  else
    return toupper(c);
}


x86 assembly (clang, -O0):
<my_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xe5,-0x8(%rbp)
jne    1131 <my_toupper+0x21>
movb   $0xc5,-0x1(%rbp)
jmp    1168 <my_toupper+0x58>
cmpl   $0xe4,-0x8(%rbp)
jne    1147 <my_toupper+0x37>
movb   $0xc4,-0x1(%rbp)
jmp    1168 <my_toupper+0x58>
cmpl   $0xf6,-0x8(%rbp)
jne    115d <my_toupper+0x4d>
movb   $0xd6,-0x1(%rbp)
jmp    1168 <my_toupper+0x58>
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_toupper>:
cmp    $0xf6,%edi
je     112b <my_toupper+0x1b>
cmp    $0xe5,%edi
je     112e <my_toupper+0x1e>
cmp    $0xe4,%edi
jne    1131 <my_toupper+0x21>
mov    $0xc4,%al
ret
mov    $0xd6,%al
ret
mov    $0xc5,%al
ret
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define zeroext i8 @my_toupper(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 229
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 -59, i8* %2
br label %18
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 228
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 -60, i8* %2
br label %18
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 246
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 -42, i8* %2
br label %18
15: ; preds = %11
%16 = load i32, i32* %3
%17 = call zeroext i8 @toupper(i32 %16)
store i8 %17, i8* %2
br label %18
18: ; preds = %15, %14, %10, %6
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @my_toupper(i32 %0) {
switch i32 %0, label %4 [
i32 229, label %6
i32 228, label %2
i32 246, label %3
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
%5 = tail call zeroext i8 @toupper(i32 %0)
br label %6
6: ; preds = %1, %4, %3, %2
%7 = phi i8 [ -60, %2 ], [ -42, %3 ], [ %5, %4 ], [ -59, %1 ]
ret i8 %7
}
void foo203() {}


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

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

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

LLVM IR (-O2):
define void @foo203() {
ret void
}
int test_imm_E2int64_lowword_mem(long long *val) {
  return ((*val) & (0xE2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E2int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 226
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void PrintTabs(FILE *f, int count) {
  int i;
  for (i = 0; i < count; i++)
    fprintf(f, "    ");
}


x86 assembly (clang, -O0):
<PrintTabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <PrintTabs+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <PrintTabs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintTabs>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <PrintTabs+0x3a>
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1030 <fwrite@plt>
add    $0xffffffff,%ebx
jne    1130 <PrintTabs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @PrintTabs(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
unsigned char(inb_local)(int port) {
  unsigned char value;
  {
    ;
    return (value);
  }
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @inb_local(i32 %0) {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void cass_print_context(const char *filename, int line) {
  fprintf(stderr, "Assertion error at %s:%d\n", filename, line);
}


x86 assembly (clang, -O0):
<cass_print_context>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cass_print_context>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Assertion error at %s:%d\0A\00"
define void @cass_print_context(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Assertion error at %s:%d\0A\00"
define void @cass_print_context(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
char s_get_indexed(char, char *);
char get_indexed(char index, char *msg) { return s_get_indexed(index, msg); }


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

x86 assembly (clang, -O2):
<get_indexed>:
jmp    1030 <s_get_indexed@plt>

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

LLVM IR (-O2):
define signext i8 @get_indexed(i8 signext %0, i8* %1) {
%3 = tail call signext i8 @s_get_indexed(i8 signext %0, i8* %1)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printout(char *s) { printf("%s\n", s); }


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

x86 assembly (clang, -O2):
<printout>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printout(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double dot_prod(double v1[3], double v2[3]) {
  return (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]);
}


x86 assembly (clang, -O0):
<dot_prod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_prod>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot_prod(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dot_prod(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
signed char signedchar_ignoring_unsignedshort(signed char x, unsigned short y) {
  return x;
}


x86 assembly (clang, -O0):
<signedchar_ignoring_unsignedshort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @signedchar_ignoring_unsignedshort(i8 signext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @signedchar_ignoring_unsignedshort(i8 returned signext %0, i16 zeroext %1) {
ret i8 %0
}
int f1(int a) { return a <= 55 ? 1024441 : 1024442; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xfa1ba,%eax
mov    $0xfa1b9,%ecx
cmp    $0x37,%edx
cmovle %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xor    %ecx,%ecx
cmp    $0x38,%edi
setl   %cl
mov    $0xfa1ba,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 55
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1024441, i32 1024442
ret i32 %6
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp slt i32 %0, 56
%3 = select i1 %2, i32 1024441, i32 1024442
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PRCMHIBRegWrite(int, unsigned long);
void PRCMSlowClkCtrMatchSet(unsigned long long ullValue) {
  PRCMHIBRegWrite(0x4402F800 + 0x00000058, (unsigned long)(ullValue));
  PRCMHIBRegWrite(0x4402F800 + 0x0000005C, (unsigned long)(ullValue >> 32));
}


x86 assembly (clang, -O0):
<PRCMSlowClkCtrMatchSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x4402f858,%edi
call   1030 <PRCMHIBRegWrite@plt>
mov    -0x8(%rbp),%rsi
shr    $0x20,%rsi
mov    $0x4402f85c,%edi
call   1030 <PRCMHIBRegWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMSlowClkCtrMatchSet>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4402f858,%edi
mov    %rbx,%rsi
call   1030 <PRCMHIBRegWrite@plt>
shr    $0x20,%rbx
mov    $0x4402f85c,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <PRCMHIBRegWrite@plt>

LLVM IR (-O0):
define void @PRCMSlowClkCtrMatchSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @PRCMHIBRegWrite(i32 1141045336, i64 %3)
%5 = load i64, i64* %2
%6 = lshr i64 %5, 32
%7 = call i32 @PRCMHIBRegWrite(i32 1141045340, i64 %6)
ret void
}

LLVM IR (-O2):
define void @PRCMSlowClkCtrMatchSet(i64 %0) {
%2 = tail call i32 @PRCMHIBRegWrite(i32 1141045336, i64 %0)
%3 = lshr i64 %0, 32
%4 = tail call i32 @PRCMHIBRegWrite(i32 1141045340, i64 %3)
ret void
}
void handleHead(char *uri, int fd) { return; }


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

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

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

LLVM IR (-O2):
define void @handleHead(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int trimLeft_execute(unsigned char *, int);
int trimRight_execute(unsigned char *, int);
int trim_execute(unsigned char *input, long int input_len) {
  int len = input_len;
  len = trimRight_execute(input, len);
  len = trimLeft_execute(input, len);
  return len;
}


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

x86 assembly (clang, -O2):
<trim_execute>:
push   %rbx
mov    %rdi,%rbx
call   1040 <trimRight_execute@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <trimLeft_execute@plt>

LLVM IR (-O0):
define i32 @trim_execute(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = call i32 @trimRight_execute(i8* %8, i32 %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = call i32 @trimLeft_execute(i8* %11, i32 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @trim_execute(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @trimRight_execute(i8* %0, i32 %3)
%5 = tail call i32 @trimLeft_execute(i8* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ renamer(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++)
    renamer(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <renamer@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <renamer@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
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*** %5
%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 @renamer(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 i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @renamer(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
float coshf(float);
float r_cosh(float *x) { return (coshf(*x)); }


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

x86 assembly (clang, -O2):
<r_cosh>:
movss  (%rdi),%xmm0
jmp    1030 <coshf@plt>

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

LLVM IR (-O2):
define float @r_cosh(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @coshf(float %2)
ret float %3
}
/* Type definitions */
struct serial_icounter_struct {
  int dummy;
};

/* Variables and functions */
int main(void) {
  struct serial_icounter_struct counter = {};
  (void)counter;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.serial_icounter_struct = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.serial_icounter_struct
store i32 0, i32* %1
%3 = bitcast %struct.serial_icounter_struct* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double internal_abs(double a) { return a < 0 ? -a : a; }


x86 assembly (clang, -O0):
<internal_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <internal_abs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <internal_abs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @internal_abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int test_imm_CAuint8_reg(unsigned char val) {
  return ((val) & (-0xCA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CAuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff36,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CAuint8_reg>:
test   $0x36,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CAuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -202
%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_CAuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 54
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *strstr(const char *haystack, const char *needle) { return 0; }


x86 assembly (clang, -O0):
<strstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @strstr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int euler_problem_1();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", euler_problem_1());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @euler_problem_1()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  printf("argc = %d\n", argc);
  printf("argv = %s\n", argv[1]);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"argc = %d\0A\00"
@.str.1 = [11 x i8] c"argv = %s\0A\00"
define i32 @main(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 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"argc = %d\0A\00"
@.str.1 = [11 x i8] c"argv = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}
unsigned get_32(const unsigned char *s, int e) {
  return s[e] + 0U << 24 | s[e ^ 1] << 16 | s[e ^ 2] << 8 | s[e ^ 3];
}


x86 assembly (clang, -O0):
<get_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
add    $0x0,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
xor    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
xor    $0x2,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
xor    $0x3,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_32>:
movslq %esi,%rax
movzbl (%rdi,%rax,1),%ecx
shl    $0x18,%ecx
mov    %rax,%rdx
xor    $0x1,%rdx
movzbl (%rdi,%rdx,1),%edx
shl    $0x10,%edx
or     %ecx,%edx
mov    %rax,%rcx
xor    $0x2,%rcx
movzbl (%rdi,%rcx,1),%ecx
shl    $0x8,%ecx
or     %edx,%ecx
xor    $0x3,%rax
movzbl (%rdi,%rax,1),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_32(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add i32 %10, 0
%12 = shl i32 %11, 24
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = xor i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 16
%21 = or i32 %12, %20
%22 = load i8*, i8** %3
%23 = load i32, i32* %4
%24 = xor i32 %23, 2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %22, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 8
%30 = or i32 %21, %29
%31 = load i8*, i8** %3
%32 = load i32, i32* %4
%33 = xor i32 %32, 3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %31, i64 %34
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = or i32 %30, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @get_32(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw i32 %6, 24
%8 = xor i32 %1, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %13, %7
%15 = xor i32 %1, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl nuw nsw i32 %19, 8
%21 = or i32 %14, %20
%22 = xor i32 %1, 3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %0, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = or i32 %21, %26
ret i32 %27
}
double thermCond(double kc, double b, double t) { return (kc + b * t * t * t); }


x86 assembly (clang, -O0):
<thermCond>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<thermCond>:
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @thermCond(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fmul double %8, %9
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = load double, double* %6
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double %7)
ret double %14
}

LLVM IR (-O2):
define double @thermCond(double %0, double %1, double %2) {
%4 = fmul double %1, %2
%5 = fmul double %4, %2
%6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %0)
ret double %6
}