xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char const *, int, scalar_t__, int /*<<< orphan*/ *);
scalar_t__ strlen(char const *);
int Serialize_WriteName(FILE *Stream, const char *Name) {
  return fwrite(Name, 1, strlen(Name) + 1, Stream);
}


x86 assembly (clang, -O0):
<Serialize_WriteName>:
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    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
add    $0x1,%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Serialize_WriteName>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
define i32 @Serialize_WriteName(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = load i32*, i32** %3
%10 = call i32 @fwrite(i8* %5, i32 1, i64 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Serialize_WriteName(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @fwrite(i8* %1, i32 1, i64 %4, i32* %0)
ret i32 %5
}
int nado(char c) { return 1; }


x86 assembly (clang, -O0):
<nado>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nado(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i32 1
}

LLVM IR (-O2):
define i32 @nado(i8 signext %0) {
ret i32 1
}
void foo799() {}


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

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

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

LLVM IR (-O2):
define void @foo799() {
ret void
}
int check_data(unsigned int *data, unsigned int size) {
  int i;
  for (i = 0; i < size - 1; i++) {
    if (data[i] > data[i + 1]) {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    1163 <check_data+0x63>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jbe    1150 <check_data+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <check_data+0x6a>
jmp    1155 <check_data+0x55>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <check_data+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_data>:
add    $0xffffffff,%esi
xor    %eax,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmp    %rcx,%rsi
je     112c <check_data+0x2c>
mov    (%rdi,%rcx,4),%r8d
lea    0x1(%rcx),%rdx
cmp    0x4(%rdi,%rcx,4),%r8d
mov    %rdx,%rcx
jbe    1110 <check_data+0x10>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @check_data(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = zext i32 %3 to i64
br label %5
5: ; preds = %8, %2
%6 = phi i64 [ %11, %8 ], [ 0, %2 ]
%7 = icmp eq i64 %6, %4
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = getelementptr inbounds i32, i32* %0, i64 %6
%10 = load i32, i32* %9
%11 = add nuw nsw i64 %6, 1
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp ugt i32 %10, %13
br i1 %14, label %15, label %5
15: ; preds = %5, %8
%16 = phi i32 [ -1, %8 ], [ 0, %5 ]
ret i32 %16
}
int test_imm_4Fint64_lowword_reg(long long val) {
  return ((val) & (0x4F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Fint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 79
%5 = icmp ne i64 %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_4Fint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 79
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void firstc(void) {
  unsigned int *ctrl_base = (unsigned int *)0x44e10000;
  unsigned int *cm_per_base = (unsigned int *)0x48e00000;
  unsigned int *gpio1_base = (unsigned int *)0x4804c000;
  *(ctrl_base + 0x854) = 0x27;
  *(ctrl_base + 0x858) = 0x27;
  *(ctrl_base + 0x85c) = 0x27;
  *(ctrl_base + 0x860) = 0x27;
  *(cm_per_base + 0xac) = 0x2;
  *(gpio1_base + 0x134) &= ~(0xf << 21);
  *(gpio1_base + 0x194) |= (0xf << 21);
}


x86 assembly (clang, -O0):
<firstc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e10000,%eax
mov    %rax,-0x8(%rbp)
mov    $0x48e00000,%eax
mov    %rax,-0x10(%rbp)
mov    $0x4804c000,%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x27,0x2150(%rax)
mov    -0x8(%rbp),%rax
movl   $0x27,0x2160(%rax)
mov    -0x8(%rbp),%rax
movl   $0x27,0x2170(%rax)
mov    -0x8(%rbp),%rax
movl   $0x27,0x2180(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,0x2b0(%rax)
mov    -0x18(%rbp),%rax
mov    0x4d0(%rax),%ecx
and    $0xfe1fffff,%ecx
mov    %ecx,0x4d0(%rax)
mov    -0x18(%rbp),%rax
mov    0x650(%rax),%ecx
or     $0x1e00000,%ecx
mov    %ecx,0x650(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstc>:
movl   $0x27,0x44e12150
movl   $0x27,0x44e12160
movl   $0x27,0x44e12170
movl   $0x27,0x44e12180
movl   $0x2,0x48e002b0
andl   $0xfe1fffff,0x4804c4d0
ff ff 1f fe
orl    $0x1e00000,0x4804c650
ret

LLVM IR (-O0):
define void @firstc() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
store i32* inttoptr (i64 1155596288 to i32*), i32** %1
store i32* inttoptr (i64 1222639616 to i32*), i32** %2
store i32* inttoptr (i64 1208270848 to i32*), i32** %3
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 2132
store i32 39, i32* %5
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i64 2136
store i32 39, i32* %7
%8 = load i32*, i32** %1
%9 = getelementptr inbounds i32, i32* %8, i64 2140
store i32 39, i32* %9
%10 = load i32*, i32** %1
%11 = getelementptr inbounds i32, i32* %10, i64 2144
store i32 39, i32* %11
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 172
store i32 2, i32* %13
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 308
%16 = load i32, i32* %15
%17 = and i32 %16, -31457281
store i32 %17, i32* %15
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 404
%20 = load i32, i32* %19
%21 = or i32 %20, 31457280
store i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @firstc() {
store i32 39, i32* inttoptr (i64 1155604816 to i32*)
store i32 39, i32* inttoptr (i64 1155604832 to i32*)
store i32 39, i32* inttoptr (i64 1155604848 to i32*)
store i32 39, i32* inttoptr (i64 1155604864 to i32*)
store i32 2, i32* inttoptr (i64 1222640304 to i32*)
%1 = load i32, i32* inttoptr (i64 1208272080 to i32*)
%2 = and i32 %1, -31457281
store i32 %2, i32* inttoptr (i64 1208272080 to i32*)
%3 = load i32, i32* inttoptr (i64 1208272464 to i32*)
%4 = or i32 %3, 31457280
store i32 %4, i32* inttoptr (i64 1208272464 to i32*)
ret void
}
/* Type definitions */
typedef char *uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint64_t rdmsr(uint32_t msr_id) {
  uint64_t value;
  __asm__ volatile("rdmsr" : "=A"(value) : "c"(msr_id));
  return value;
}


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

x86 assembly (clang, -O2):
<rdmsr>:
mov    %edi,%ecx
rdmsr
ret

LLVM IR (-O0):
define i8* @rdmsr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @rdmsr(i32 %0) {
%2 = tail call i8* asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
void XFree() {}


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

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

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

LLVM IR (-O2):
define void @XFree() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int *);
int main() {
  int a[2] = {2, 3}, r;
  r = a[1] *= a[0];
  print("a 2 6");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x10(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <print@plt>
lea    -0xc(%rbp),%rdi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x600000002,%rax
mov    %rax,(%rsp)
lea    0xeca(%rip),%rdi
call   1030 <print@plt>
mov    %rsp,%rdi
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [2 x i32] [i32 2, i32 3]
@.str = [6 x i8] c"a 2 6\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [2 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, %6
store i32 %9, i32* %7
store i32 %9, i32* %3
%10 = call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%12 = call i32 @printid(i32* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"a 2 6\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 25769803778, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printid(i32* %3)
ret i32 0
}
/* Variables and functions */
char *rit_getValue(char *);
char *get(char *path) {
  if (path == NULL)
    return NULL;
  return rit_getValue(path);
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <get+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <get+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <rit_getValue@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
test   %rdi,%rdi
je     111a <get+0xa>
jmp    1030 <rit_getValue@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @get(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @rit_getValue(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
scalar_t__ nfs_probe_statd();
int start_statd(void) {
  if (nfs_probe_statd())
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<start_statd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <nfs_probe_statd@plt>
cmp    $0x0,%rax
je     1135 <start_statd+0x25>
movl   $0x1,-0x4(%rbp)
jmp    113c <start_statd+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_statd>:
push   %rax
xor    %eax,%eax
call   1030 <nfs_probe_statd@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @start_statd() {
%1 = alloca i32
%2 = call i64 (...) @nfs_probe_statd()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @start_statd() {
%1 = tail call i64 (...) @nfs_probe_statd()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void menu_free(struct page_ctx *ctx, const struct page *page) {}


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

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

LLVM IR (-O0):
%struct.page_ctx = type opaque
%struct.page = type opaque
define void @menu_free(%struct.page_ctx* %0, %struct.page* %1) {
%3 = alloca %struct.page_ctx*
%4 = alloca %struct.page*
store %struct.page_ctx* %0, %struct.page_ctx** %3
store %struct.page* %1, %struct.page** %4
ret void
}

LLVM IR (-O2):
%struct.page_ctx = type opaque
%struct.page = type opaque
define void @menu_free(%struct.page_ctx* nocapture %0, %struct.page* nocapture %1) {
ret void
}
/* Variables and functions */
int close(int);
int server_close(int fd) { return close(fd); }


x86 assembly (clang, -O0):
<server_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):
<server_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @server_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 @server_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
struct passwd {
  char *pw_dir;
};

/* Variables and functions */
char *dss_strdup(char *);
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
__attribute__((warn_unused_result)) __attribute__((malloc)) char *
get_homedir(void) {
  struct passwd *pw = getpwuid(getuid());
  return dss_strdup(pw ? pw->pw_dir : "/tmp");
}


x86 assembly (clang, -O0):
<get_homedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <get_homedir+0x35>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1175 <get_homedir+0x45>
lea    0xe94(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1175 <get_homedir+0x45>
mov    -0x10(%rbp),%rdi
call   1050 <dss_strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_homedir>:
push   %rax
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
test   %rax,%rax
je     114d <get_homedir+0x1d>
mov    (%rax),%rdi
pop    %rax
jmp    1050 <dss_strdup@plt>
lea    0xeac(%rip),%rdi
pop    %rax
jmp    1050 <dss_strdup@plt>

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [5 x i8] c"/tmp\00"
define noalias i8* @get_homedir() {
%1 = alloca %struct.passwd*
%2 = call i32 (...) @getuid()
%3 = call %struct.passwd* @getpwuid(i32 %2)
store %struct.passwd* %3, %struct.passwd** %1
%4 = load %struct.passwd*, %struct.passwd** %1
%5 = icmp ne %struct.passwd* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load %struct.passwd*, %struct.passwd** %1
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %7, i32 0, i32 0
%9 = load i8*, i8** %8
br label %11
10: ; preds = %0
br label %11
11: ; preds = %10, %6
%12 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %10 ]
%13 = call i8* @dss_strdup(i8* %12)
ret i8* %13
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [5 x i8] c"/tmp\00"
define noalias i8* @get_homedir() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %0, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %0 ]
%9 = tail call i8* @dss_strdup(i8* %8)
ret i8* %9
}
__attribute__((noipa)) int fn8(int x) { return x + 12; }


x86 assembly (clang, -O0):
<fn8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn8>:
lea    0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @fn8(i32 %0) {
%2 = add nsw i32 %0, 12
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int puts(const char *s) {
  while (*s) {
    putchar(*s++);
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
int solveMeFirst(int a, int b) {
  int c;
  c = a + b;
  return c;
}


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

x86 assembly (clang, -O2):
<solveMeFirst>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @solveMeFirst(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
double timeval_to_secs(const struct timeval *v) {
  double s;
  s = v->tv_sec;
  s += v->tv_usec / (1000.0 * 1000.0);
  return s;
}


x86 assembly (clang, -O0):
<timeval_to_secs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_secs>:
movsd  0x8(%rdi),%xmm0
divsd  0xef3(%rip),%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @timeval_to_secs(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca double
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load double, double* %5
store double %6, double* %3
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = load double, double* %3
%12 = fadd double %11, %10
store double %12, double* %3
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @timeval_to_secs(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load double, double* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%5 = load double, double* %4
%6 = fdiv double %5, 1.000000e+06
%7 = fadd double %3, %6
ret double %7
}
void psci_init(void) {}


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

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

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

LLVM IR (-O2):
define void @psci_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeGPIOOutput(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000001);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeGPIOOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    $0x8,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeGPIOOutput>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x1,%edx
call   1040 <GPIODirModeSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeGPIOOutput(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = call i32 @GPIODirModeSet(i64 %5, i8 zeroext %6, i32 1)
%8 = load i64, i64* %3
%9 = load i8, i8* %4
%10 = call i32 @GPIOPadConfigSet(i64 %8, i8 zeroext %9, i32 1, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeGPIOOutput(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 1)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rtx_dbug_outs(char *);
int /*<<< orphan*/ unblock_process_by_pid(int, int);
void core_test1() {
  rtx_dbug_outs("Running core test 1\r\n");
  unblock_process_by_pid(71, 1);
}


x86 assembly (clang, -O0):
<core_test1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <rtx_dbug_outs@plt>
mov    $0x47,%edi
mov    $0x1,%esi
call   1040 <unblock_process_by_pid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_test1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <rtx_dbug_outs@plt>
mov    $0x47,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <unblock_process_by_pid@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Running core test 1\0D\0A\00"
define void @core_test1() {
%1 = call i32 @rtx_dbug_outs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unblock_process_by_pid(i32 71, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Running core test 1\0D\0A\00"
define void @core_test1() {
%1 = tail call i32 @rtx_dbug_outs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unblock_process_by_pid(i32 71, i32 1)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void AESLengthSet(uint32_t ui32Base, uint64_t ui64Length) {
  ASSERT(ui32Base == 0x44036000);
  (*((volatile uint32_t *)(ui32Base + 0x00000054))) = (uint32_t)(ui64Length);
  (*((volatile uint32_t *)(ui32Base + 0x00000058))) =
      (uint32_t)(ui64Length >> 32);
}


x86 assembly (clang, -O0):
<AESLengthSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x44036000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x54,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x58,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESLengthSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x44036000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0x54(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @AESLengthSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1141071872
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 84
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %9, i32* %13
%14 = load i32, i32* %4
%15 = ashr i32 %14, 32
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 88
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 %15, i32* %19
ret void
}

LLVM IR (-O2):
define void @AESLengthSet(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1141071872
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 84
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %1, i32* %8
%9 = add nsw i32 %0, 88
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 poison, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void limpa() { system("/usr/bin/clear"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"/usr/bin/clear\00"
define void @limpa() {
%1 = call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/usr/bin/clear\00"
define void @limpa() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%i", &a);
  printf("numero de entrada %i\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%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
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [22 x i8] c"numero de entrada %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int picked7() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @picked7() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gpio_write_bit(int, char);
void sdata(char value) { gpio_write_bit(4, value); }


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

x86 assembly (clang, -O2):
<sdata>:
mov    %edi,%esi
mov    $0x4,%edi
jmp    1030 <gpio_write_bit@plt>

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

LLVM IR (-O2):
define void @sdata(i8 signext %0) {
%2 = tail call i32 @gpio_write_bit(i32 4, i8 signext %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
struct TYPE_3__ {
  scalar_t__ tv_usec;
};
struct itimerval {
  TYPE_2__ it_value;
  TYPE_1__ it_interval;
};

/* Variables and functions */
int /*<<< orphan*/ ITIMER_REAL;
int /*<<< orphan*/ setitimer(int /*<<< orphan*/, struct itimerval *,
                             int /*<<< orphan*/ *);
int main(void) {
  struct itimerval itv;
  itv.it_interval.tv_usec = 0;
  itv.it_value.tv_sec = 0;
  itv.it_value.tv_usec = 0;
  setitimer(ITIMER_REAL, &itv, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setitimer@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <setitimer@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i64 }
%struct.TYPE_3__ = type { i64 }
@ITIMER_REAL = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.itimerval
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %2, i32 0, i32 1
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %2, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i32 0, i32 1
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %2, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
store i64 0, i64* %8
%9 = load i32, i32* @ITIMER_REAL
%10 = call i32 @setitimer(i32 %9, %struct.itimerval* %2, i32* null)
ret i32 0
}

LLVM IR (-O2):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i64 }
%struct.TYPE_3__ = type { i64 }
@ITIMER_REAL = global i32 0
define i32 @main() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = bitcast %struct.itimerval* %1 to i8*
%4 = load i32, i32* @ITIMER_REAL
%5 = call i32 @setitimer(i32 %4, %struct.itimerval* %1, i32* null)
ret i32 0
}
/* Variables and functions */
double acos(double);
double SDL_acos(double val) { return acos(val); }


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

x86 assembly (clang, -O2):
<SDL_acos>:
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define double @SDL_acos(double %0) {
%2 = tail call double @acos(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ mcb_ok(int);
scalar_t__ mcb_owner(int);
int mcb_is_free(int mcb) {
  if (mcb < 0 || mcb >= 0x10000)
    return 0;
  return mcb_ok(mcb) && mcb_owner(mcb) == 0;
}


x86 assembly (clang, -O0):
<mcb_is_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1142 <mcb_is_free+0x22>
cmpl   $0x10000,-0x8(%rbp)
jl     114e <mcb_is_free+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1185 <mcb_is_free+0x65>
mov    -0x8(%rbp),%edi
call   1040 <mcb_ok@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     117a <mcb_is_free+0x5a>
mov    -0x8(%rbp),%edi
call   1030 <mcb_owner@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcb_is_free>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cmp    $0xffff,%edi
ja     1148 <mcb_is_free+0x28>
mov    %edi,%ebp
call   1040 <mcb_ok@plt>
test   %rax,%rax
je     1148 <mcb_is_free+0x28>
mov    %ebp,%edi
call   1030 <mcb_owner@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mcb_is_free(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 %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 65536
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %21
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i64 @mcb_ok(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %3
%16 = call i64 @mcb_owner(i32 %15)
%17 = icmp eq i64 %16, 0
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
store i32 %20, i32* %2
br label %21
21: ; preds = %18, %9
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @mcb_is_free(i32 %0) {
%2 = icmp ugt i32 %0, 65535
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @mcb_ok(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @mcb_owner(i32 %0)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %6, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}
__attribute__((no, noclone)) unsigned char fn7(unsigned char x, unsigned char y,
                                               int *ovf) {
  unsigned char res;
  x = (x & 15) + ((unsigned char)~0 - 15);
  y = (y & 3) + 16;
  *ovf = __builtin_add_overflow(x, y, &res);
  return res;
}


x86 assembly (clang, -O0):
<fn7>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
add    $0xf0,%eax
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%eax
and    $0x3,%eax
add    $0x10,%eax
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%cl
add    -0x2(%rbp),%cl
setb   %al
mov    %cl,-0x11(%rbp)
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn7>:
and    $0x3,%sil
and    $0xf,%dil
lea    (%rdi,%rsi,1),%eax
movl   $0x1,(%rdx)
ret

LLVM IR (-O0):
define zeroext i8 @fn7(i8 zeroext %0, i8 zeroext %1, i32* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32*
%7 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i32* %2, i32** %6
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = add nsw i32 %10, 240
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = and i32 %14, 3
%16 = add nsw i32 %15, 16
%17 = trunc i32 %16 to i8
store i8 %17, i8* %5
%18 = load i8, i8* %4
%19 = load i8, i8* %5
%20 = call { i8, i1 } @llvm.uadd.with.overflow.i8(i8 %18, i8 %19)
%21 = extractvalue { i8, i1 } %20, 1
%22 = extractvalue { i8, i1 } %20, 0
store i8 %22, i8* %7
%23 = zext i1 %21 to i32
%24 = load i32*, i32** %6
store i32 %23, i32* %24
%25 = load i8, i8* %7
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @fn7(i8 zeroext %0, i8 zeroext %1, i32* nocapture writeonly %2) {
%4 = and i8 %1, 3
%5 = and i8 %0, 15
%6 = add nuw nsw i8 %5, %4
store i32 1, i32* %2
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main(void) {
  int n;
  for (n = 0; n <= 9; n++) {
    putchar('0' + n);
  }
  putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     114c <main+0x3c>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    $0x33,%edi
call   1030 <putchar@plt>
mov    $0x34,%edi
call   1030 <putchar@plt>
mov    $0x35,%edi
call   1030 <putchar@plt>
mov    $0x36,%edi
call   1030 <putchar@plt>
mov    $0x37,%edi
call   1030 <putchar@plt>
mov    $0x38,%edi
call   1030 <putchar@plt>
mov    $0x39,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 9
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
%10 = call i32 @putchar(i8 signext %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
%15 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 48)
%2 = tail call i32 @putchar(i8 signext 49)
%3 = tail call i32 @putchar(i8 signext 50)
%4 = tail call i32 @putchar(i8 signext 51)
%5 = tail call i32 @putchar(i8 signext 52)
%6 = tail call i32 @putchar(i8 signext 53)
%7 = tail call i32 @putchar(i8 signext 54)
%8 = tail call i32 @putchar(i8 signext 55)
%9 = tail call i32 @putchar(i8 signext 56)
%10 = tail call i32 @putchar(i8 signext 57)
%11 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ run();
int main(int argc, char **argv) {
  run();
  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 <run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run@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 (...) @run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = NULL;
  p = malloc(size);
  if (!p) {
    die("Could not allocate %lu bytes. Exiting\n", size);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Could not allocate %lu bytes. Exiting\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @die(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [39 x i8] c"Could not allocate %lu bytes. Exiting\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int fun1135() { return 1135; }


x86 assembly (clang, -O0):
<fun1135>:
push   %rbp
mov    %rsp,%rbp
mov    $0x46f,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1135() {
ret i32 1135
}

LLVM IR (-O2):
define i32 @fun1135() {
ret i32 1135
}
void RTLogDestinations(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogDestinations() {
ret void
}
/* Variables and functions */
double Bij(int, int);
double exp(double);
double mu_ij(int, int);
double t2_f_attractive(int i, int j, double rij) {
  return -Bij(i, j) * exp(-mu_ij(i, j) * rij);
}


x86 assembly (clang, -O0):
<t2_f_attractive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <Bij@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <mu_ij@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2_f_attractive>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <Bij@plt>
xorpd  0xeb3(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <mu_ij@plt>
xorpd  0xe9c(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1050 <exp@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @t2_f_attractive(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call double @Bij(i32 %7, i32 %8)
%10 = fneg double %9
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call double @mu_ij(i32 %11, i32 %12)
%14 = fneg double %13
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = call double @exp(double %16)
%18 = fmul double %10, %17
ret double %18
}

LLVM IR (-O2):
define double @t2_f_attractive(i32 %0, i32 %1, double %2) {
%4 = tail call double @Bij(i32 %0, i32 %1)
%5 = fneg double %4
%6 = tail call double @mu_ij(i32 %0, i32 %1)
%7 = fneg double %6
%8 = fmul double %7, %2
%9 = tail call double @exp(double %8)
%10 = fmul double %9, %5
ret double %10
}
int test_imm_09uint16_mem(unsigned short *val) {
  return ((*val) & (0x09 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_09uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 9
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}