xunge/DecIR huggingface dataset:
/* Type definitions */
typedef long long uint64_t;
struct timeval {
  long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t dvmGetRTCTimeNsec() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return ((uint64_t)now.tv_sec * 1000000000LL + now.tv_usec * 1000000LL);
}


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

x86 assembly (clang, -O2):
<dvmGetRTCTimeNsec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3b9aca00,0x10(%rsp),%rcx
9a 3b
imul   $0xf4240,0x8(%rsp),%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @dvmGetRTCTimeNsec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000
%10 = add nsw i64 %9, %6
ret i64 %10
}
int intel_mid_pmic_set_pdata(const char *name, void *data, int len, int id) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @intel_mid_pmic_set_pdata(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @intel_mid_pmic_set_pdata(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA_lc898122_sharp(int, int);
void RamAccFixMod_lc898122_sharp(unsigned char UcAccMod) {
  switch (UcAccMod) {
  case 0x00:
    RegWriteA_lc898122_sharp(0x018C, 0x00);
    break;
  case 0x01:
    RegWriteA_lc898122_sharp(0x018C, 0x31);
    break;
  }
}


x86 assembly (clang, -O0):
<RamAccFixMod_lc898122_sharp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1143 <RamAccFixMod_lc898122_sharp+0x33>
jmp    1132 <RamAccFixMod_lc898122_sharp+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1154 <RamAccFixMod_lc898122_sharp+0x44>
jmp    1163 <RamAccFixMod_lc898122_sharp+0x53>
mov    $0x18c,%edi
xor    %esi,%esi
call   1030 <RegWriteA_lc898122_sharp@plt>
jmp    1163 <RamAccFixMod_lc898122_sharp+0x53>
mov    $0x18c,%edi
mov    $0x31,%esi
call   1030 <RegWriteA_lc898122_sharp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RamAccFixMod_lc898122_sharp>:
test   %edi,%edi
je     1129 <RamAccFixMod_lc898122_sharp+0x19>
cmp    $0x1,%dil
jne    1135 <RamAccFixMod_lc898122_sharp+0x25>
mov    $0x31,%esi
mov    $0x18c,%edi
jmp    1030 <RegWriteA_lc898122_sharp@plt>
xor    %esi,%esi
mov    $0x18c,%edi
jmp    1030 <RegWriteA_lc898122_sharp@plt>
ret

LLVM IR (-O0):
define void @RamAccFixMod_lc898122_sharp(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %7
]
5: ; preds = %1
%6 = call i32 @RegWriteA_lc898122_sharp(i32 396, i32 0)
br label %9
7: ; preds = %1
%8 = call i32 @RegWriteA_lc898122_sharp(i32 396, i32 49)
br label %9
9: ; preds = %1, %7, %5
ret void
}

LLVM IR (-O2):
define void @RamAccFixMod_lc898122_sharp(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 0, label %3
i8 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 49, %2 ], [ 0, %1 ]
%5 = tail call i32 @RegWriteA_lc898122_sharp(i32 396, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
bool str_starts(const char *haystack, const char *needle) {
  return (bool)(strncmp(haystack, needle, strlen(needle)) == 0);
}


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

x86 assembly (clang, -O2):
<str_starts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @str_starts(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @str_starts(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
imprime(float altura, float velocidade, float t) {
  printf("A velocidade da bola no instante %.3f é %.3f e a altura é %.3f", t,
         velocidade, altura);
}


x86 assembly (clang, -O0):
<imprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime>:
movaps %xmm0,%xmm3
lea    0xee6(%rip),%rdi
movaps %xmm2,%xmm0
movaps %xmm3,%xmm2
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"A velocidade da bola no instante %.3f \C3\A9 %.3f e a altura \C3\A9 %.3f\00"
define i32 @imprime(float %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %7
%9 = load float, float* %6
%10 = load float, float* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), float %8, float %9, float %10)
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [65 x i8] c"A velocidade da bola no instante %.3f \C3\A9 %.3f e a altura \C3\A9 %.3f\00"
define i32 @imprime(float %0, float %1, float %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), float %2, float %1, float %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void print(int fd) {
  char buffer[128];
  int n;
  while ((n = read(fd, buffer, sizeof(buffer))) > 0) {
    write(1, buffer, n);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1040 <read@plt>
mov    %eax,-0x94(%rbp)
cmp    $0x0,%eax
jle    116d <print+0x4d>
lea    -0x90(%rbp),%rsi
mov    -0x94(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    112e <print+0xe>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %rbx
sub    $0x88,%rsp
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x80,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1162 <print+0x42>
mov    %rsp,%rbx
nop
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x80,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1140 <print+0x20>
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @print(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %2
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i32 @read(i32 %6, i8* %7, i32 128)
store i32 %8, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%12 = load i32, i32* %4
%13 = call i32 @write(i32 1, i8* %11, i32 %12)
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @print(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 128)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %4, %1 ]
%8 = call i32 @write(i32 1, i8* %3, i32 %7)
%9 = call i32 @read(i32 %0, i8* %3, i32 128)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
scalar_t__ test();
int main() {
  int result = (int)test();
  return result;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 (...) @test()
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
unsigned char tolower(unsigned char);
char *strlwr(char *s) {
  unsigned char *us = s;
  while (*us) {
    *us = tolower(*us);
    us++;
  }
  return s;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strlwr+0x46>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlwr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlwr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %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* [ %8, %4 ], [ %0, %1 ]
%7 = tail call zeroext i8 @tolower(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int ssize_t;
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
ssize_t __mq_timedreceive(mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len,
                          unsigned int *__restrict msg_prio,
                          const struct timespec *__restrict abs_timeout) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__mq_timedreceive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mq_timedreceive>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
define i32 @__mq_timedreceive(i32 %0, i8* noalias %1, i64 %2, i32* noalias %3, %struct.timespec* noalias %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca %struct.timespec*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store %struct.timespec* %4, %struct.timespec** %10
%11 = load i32, i32* @ENOSYS
%12 = call i32 @__set_errno(i32 %11)
ret i32 -1
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
define i32 @__mq_timedreceive(i32 %0, i8* noalias nocapture readnone %1, i64 %2, i32* noalias nocapture readnone %3, %struct.timespec* noalias nocapture readnone %4) {
%6 = load i32, i32* @ENOSYS
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
void verify_nibble(int nibble, int current) {
  if (nibble != 0) {
    fprintf(stderr, "count mismatch %d (nibbles=0x%x)\n", nibble, current);
    fflush(stderr);
  }
}


x86 assembly (clang, -O0):
<verify_nibble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1161 <verify_nibble+0x41>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_nibble>:
test   %edi,%edi
je     1146 <verify_nibble+0x26>
push   %rbx
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"count mismatch %d (nibbles=0x%x)\0A\00"
define void @verify_nibble(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 ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
br label %14
14: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"count mismatch %d (nibbles=0x%x)\0A\00"
define void @verify_nibble(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
br label %9
9: ; preds = %4, %2
ret void
}
void tail_chain(void) { return; }


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

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

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

LLVM IR (-O2):
define void @tail_chain() {
ret void
}
/* Variables and functions */
int floor(int);
int FxB_String_offset(int capacity, int length) {
  return floor((capacity - length) / 2);
}


x86 assembly (clang, -O0):
<FxB_String_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FxB_String_offset>:
sub    %esi,%edi
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @FxB_String_offset(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 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
%8 = sdiv i32 %7, 2
%9 = call i32 @floor(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @FxB_String_offset(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = sdiv i32 %3, 2
%5 = tail call i32 @floor(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main(void) {
  int *data = malloc(10 * sizeof(int));
  free(data);
  free(data);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 40)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @free(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @free(i32* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @free(i32* %1)
ret i32 0
}
int HelpItem121(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem121() {
ret i32 0
}
/* Variables and functions */
double fabs(double);
unsigned int test_eq_double(double a, double b, double tol) {
  if (fabs(a - b) > tol)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test_eq_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movaps 0xedc(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    113f <test_eq_double+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <test_eq_double+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_eq_double>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm2,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @test_eq_double(double %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fsub double %8, %9
%11 = call double @llvm.fabs.f64(double %10)
%12 = load double, double* %7
%13 = fcmp ogt double %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 1, i32* %4
br label %16
15: ; preds = %3
store i32 0, i32* %4
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @test_eq_double(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp ogt double %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
char *binl2hex(int /*<<< orphan*/);
int /*<<< orphan*/ coreMD5(int /*<<< orphan*/, int);
int /*<<< orphan*/ str2binl(char *);
char *calcMD5(char *seq) { return binl2hex(coreMD5(str2binl(seq), 16)); }


x86 assembly (clang, -O0):
<calcMD5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str2binl@plt>
mov    %eax,%edi
mov    $0x10,%esi
call   1050 <coreMD5@plt>
mov    %eax,%edi
call   1040 <binl2hex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcMD5>:
push   %rax
call   1030 <str2binl@plt>
mov    %eax,%edi
mov    $0x10,%esi
call   1050 <coreMD5@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <binl2hex@plt>

LLVM IR (-O0):
define i8* @calcMD5(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @str2binl(i8* %3)
%5 = call i32 @coreMD5(i32 %4, i32 16)
%6 = call i8* @binl2hex(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @calcMD5(i8* %0) {
%2 = tail call i32 @str2binl(i8* %0)
%3 = tail call i32 @coreMD5(i32 %2, i32 16)
%4 = tail call i8* @binl2hex(i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void vhello(char **str, int *n) {
  for (int i = 0; i < *n; i++)
    printf("Hello %s\n", str[i]);
}


x86 assembly (clang, -O0):
<vhello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    115c <vhello+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <vhello+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vhello>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmpl   $0x0,(%rsi)
jle    1149 <vhello+0x39>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
movslq (%r12),%rax
cmp    %rax,%rbx
jl     1130 <vhello+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @vhello(i8** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = load i32, i32* %1
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %6, label %5
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(char);
int /*<<< orphan*/ exit(int);
int func(void) {
  int i = 0;
  if (i != 3) {
    _putchar('E');
    _putchar('r');
    _putchar('r');
    _putchar('o');
    _putchar('r');
    _putchar('\n');
    exit(98);
  }
  return (0);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     117f <func+0x5f>
mov    $0x45,%edi
call   1030 <_putchar@plt>
mov    $0x72,%edi
call   1030 <_putchar@plt>
mov    $0x72,%edi
call   1030 <_putchar@plt>
mov    $0x6f,%edi
call   1030 <_putchar@plt>
mov    $0x72,%edi
call   1030 <_putchar@plt>
mov    $0xa,%edi
call   1030 <_putchar@plt>
mov    $0x62,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mov    $0x45,%edi
call   1030 <_putchar@plt>
mov    $0x72,%edi
call   1030 <_putchar@plt>
mov    $0x72,%edi
call   1030 <_putchar@plt>
mov    $0x6f,%edi
call   1030 <_putchar@plt>
mov    $0x72,%edi
call   1030 <_putchar@plt>
mov    $0xa,%edi
call   1030 <_putchar@plt>
mov    $0x62,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 3
br i1 %3, label %4, label %12
4: ; preds = %0
%5 = call i32 @_putchar(i8 signext 69)
%6 = call i32 @_putchar(i8 signext 114)
%7 = call i32 @_putchar(i8 signext 114)
%8 = call i32 @_putchar(i8 signext 111)
%9 = call i32 @_putchar(i8 signext 114)
%10 = call i32 @_putchar(i8 signext 10)
%11 = call i32 @exit(i32 98)
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @func() {
%1 = tail call i32 @_putchar(i8 signext 69)
%2 = tail call i32 @_putchar(i8 signext 114)
%3 = tail call i32 @_putchar(i8 signext 114)
%4 = tail call i32 @_putchar(i8 signext 111)
%5 = tail call i32 @_putchar(i8 signext 114)
%6 = tail call i32 @_putchar(i8 signext 10)
%7 = tail call i32 @exit(i32 98)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init_rand_generator() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<init_rand_generator>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_rand_generator() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @init_rand_generator() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int bar(int);
int main(void) { return bar(10); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0xa,%edi
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 10)
ret i32 %1
}
void SensorSetContrast_Test(unsigned char val) {}


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

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

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

LLVM IR (-O2):
define void @SensorSetContrast_Test(i8 zeroext %0) {
ret void
}
/* Type definitions */
struct options_t {
  int dummy;
};

/* Variables and functions */
int getch();
int w_getch(struct options_t *options) {
  (void)options;
  return getch();
}


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

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

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

LLVM IR (-O2):
%struct.options_t = type { i32 }
define i32 @w_getch(%struct.options_t* nocapture readnone %0) {
%2 = tail call i32 (...) @getch()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
extern __attribute__((gnu_)) void carmen_erase_structure(void *ptr,
                                                         int size_of_struture) {
  memset(ptr, 0, size_of_struture);
}


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

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

LLVM IR (-O0):
define void @carmen_erase_structure(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 = call i32 @memset(i8* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @carmen_erase_structure(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int _isatty(int32_t file) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ dtzpad_(char *, char *, int *, int *, int *, double *,
                           double *, double *, int *);
void wcc_dtzpad_(char *UPLO, char *HERM, int *M, int *N, int *IOFFD,
                 char *ALPHA, char *BETA, char *A, int *LDA) {
  dtzpad_(UPLO, HERM, M, N, IOFFD, (double *)ALPHA, (double *)BETA, (double *)A,
          LDA);
}


x86 assembly (clang, -O0):
<wcc_dtzpad_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r11
mov    0x18(%rbp),%r10
mov    0x20(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <dtzpad_@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_dtzpad_>:
jmp    1030 <dtzpad_@plt>

LLVM IR (-O0):
define void @wcc_dtzpad_(i8* %0, i8* %1, i32* %2, i32* %3, i32* %4, i8* %5, i8* %6, i8* %7, i32* %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32*
store i8* %0, i8** %10
store i8* %1, i8** %11
store i32* %2, i32** %12
store i32* %3, i32** %13
store i32* %4, i32** %14
store i8* %5, i8** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i32* %8, i32** %18
%19 = load i8*, i8** %10
%20 = load i8*, i8** %11
%21 = load i32*, i32** %12
%22 = load i32*, i32** %13
%23 = load i32*, i32** %14
%24 = load i8*, i8** %15
%25 = bitcast i8* %24 to double*
%26 = load i8*, i8** %16
%27 = bitcast i8* %26 to double*
%28 = load i8*, i8** %17
%29 = bitcast i8* %28 to double*
%30 = load i32*, i32** %18
%31 = call i32 @dtzpad_(i8* %19, i8* %20, i32* %21, i32* %22, i32* %23, double* %25, double* %27, double* %29, i32* %30)
ret void
}

LLVM IR (-O2):
define void @wcc_dtzpad_(i8* %0, i8* %1, i32* %2, i32* %3, i32* %4, i8* %5, i8* %6, i8* %7, i32* %8) {
%10 = bitcast i8* %5 to double*
%11 = bitcast i8* %6 to double*
%12 = bitcast i8* %7 to double*
%13 = tail call i32 @dtzpad_(i8* %0, i8* %1, i32* %2, i32* %3, i32* %4, double* %10, double* %11, double* %12, i32* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__1__GeneralIO__set();
void LedsP__Led1__set(void) { Msp430GpioC__1__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__set() {
%1 = tail call i32 (...) @Msp430GpioC__1__GeneralIO__set()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_dump_path();
void test_1(void) { __analyzer_dump_path(); }


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

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

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

LLVM IR (-O2):
define void @test_1() {
%1 = tail call i32 (...) @__analyzer_dump_path()
ret void
}
int check_magic(const void *addr, const unsigned long size) {
  const unsigned char *mem_p;
  mem_p = (unsigned char *)addr + size;
  if (*mem_p == (unsigned char)(0xFAU) &&
      *(mem_p + 1) == (unsigned char)(0xD3U)) {
    return 1;
  } else {
    return 21;
  }
}


x86 assembly (clang, -O0):
<check_magic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xfa,%eax
jne    1149 <check_magic+0x49>
mov    -0x20(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xd3,%eax
jne    1149 <check_magic+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <check_magic+0x50>
movl   $0x15,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_magic>:
cmpb   $0xfa,(%rdi,%rsi,1)
jne    1112 <check_magic+0x12>
mov    $0x1,%eax
cmpb   $0xd3,0x1(%rdi,%rsi,1)
je     1117 <check_magic+0x17>
mov    $0x15,%eax
ret

LLVM IR (-O0):
define i32 @check_magic(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 250
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %18, 211
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 1, i32* %3
br label %22
21: ; preds = %14, %2
store i32 21, i32* %3
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @check_magic(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, -6
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, -45
br i1 %9, label %11, label %10
10: ; preds = %6, %2
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ 21, %10 ], [ 1, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a;
  a = 0;
  char *byte = (char *)&a;
  int i;
  for (i = 0; i < sizeof(int); ++i) {
    *byte = 0xff;
    byte++;
  }
  test_assert(a == ~((int)0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
jae    1164 <main+0x54>
mov    -0x10(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <main+0x25>
cmpl   $0xffffffff,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char a;
  a = getchar();
  printf("%c\n", 'z' - (a - 'a'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
lea    0xeb2(%rip),%rdi
movsbl %al,%esi
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 <getchar@plt>
mov    $0xdb,%cl
sub    %al,%cl
movsbl %cl,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 97
%7 = sub nsw i32 122, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = sub i8 -37, %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret i32 0
}
int fun1249() { return 1249; }


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

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

LLVM IR (-O0):
define i32 @fun1249() {
ret i32 1249
}

LLVM IR (-O2):
define i32 @fun1249() {
ret i32 1249
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcat(char *, char *);
char *displayResponse(char *respond_to_msg, char *prelimMsg) {
  memset(respond_to_msg, 0, 1024);
  strcat(respond_to_msg, prelimMsg);
  return respond_to_msg;
}


x86 assembly (clang, -O0):
<displayResponse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayResponse>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @displayResponse(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @memset(i8* %5, i32 0, i32 1024)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @displayResponse(i8* returned %0, i8* %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 1024)
%4 = tail call i32 @strcat(i8* %0, i8* %1)
ret i8* %0
}
/* Variables and functions */
float sqrt(float);
float ior_from_normal_reflectance(float f0) {
  float sqrt_f0 = sqrt(f0);
  return (sqrt_f0 + 1) / (1 - sqrt_f0);
}


x86 assembly (clang, -O0):
<ior_from_normal_reflectance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  0xebf(%rip),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ior_from_normal_reflectance>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <ior_from_normal_reflectance+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <ior_from_normal_reflectance+0x14>
call   1030 <sqrt@plt>
movss  0xed4(%rip),%xmm2
movaps %xmm0,%xmm1
addss  %xmm2,%xmm1
subss  %xmm0,%xmm2
divss  %xmm2,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ior_from_normal_reflectance(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @sqrt(float %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = fadd float %6, 1.000000e+00
%8 = load float, float* %3
%9 = fsub float 1.000000e+00, %8
%10 = fdiv float %7, %9
ret float %10
}

LLVM IR (-O2):
define float @ior_from_normal_reflectance(float %0) {
%2 = tail call float @sqrt(float %0)
%3 = fadd float %2, 1.000000e+00
%4 = fsub float 1.000000e+00, %2
%5 = fdiv float %3, %4
ret float %5
}
/* Variables and functions */
double sas_3j1x_x(double);
double sphere_volume(double);
double square(double const);
double sphere_form(double q, double radius, double sld, double solvent_sld) {
  const double fq = sphere_volume(radius) * sas_3j1x_x(q * radius);
  const double contrast = (sld - solvent_sld);
  return 1.0e-4 * square(contrast * fq);
}


x86 assembly (clang, -O0):
<sphere_form>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sphere_volume@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1050 <sas_3j1x_x@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <square@plt>
movaps %xmm0,%xmm1
movsd  0xe5c(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphere_form>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm1,%xmm0
call   1040 <sphere_volume@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
call   1050 <sas_3j1x_x@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
subsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <square@plt>
mulsd  0xe74(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @sphere_form(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %6
%12 = call double @sphere_volume(double %11)
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fmul double %13, %14
%16 = call double @sas_3j1x_x(double %15)
%17 = fmul double %12, %16
store double %17, double* %9
%18 = load double, double* %7
%19 = load double, double* %8
%20 = fsub double %18, %19
store double %20, double* %10
%21 = load double, double* %10
%22 = load double, double* %9
%23 = fmul double %21, %22
%24 = call double @square(double %23)
%25 = fmul double 1.000000e-04, %24
ret double %25
}

LLVM IR (-O2):
define double @sphere_form(double %0, double %1, double %2, double %3) {
%5 = tail call double @sphere_volume(double %1)
%6 = fmul double %0, %1
%7 = tail call double @sas_3j1x_x(double %6)
%8 = fmul double %5, %7
%9 = fsub double %2, %3
%10 = fmul double %9, %8
%11 = tail call double @square(double %10)
%12 = fmul double %11, 1.000000e-04
ret double %12
}
void uartB_putc(char c) {
  while (!(*((volatile unsigned long *)0xb04001b8) & 1))
    ;
  *((volatile unsigned long *)0xb04001bc) = c;
}


x86 assembly (clang, -O0):
<uartB_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xb04001b8,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <uartB_putc+0x2c>
jmp    1131 <uartB_putc+0x31>
jmp    110a <uartB_putc+0xa>
movsbq -0x1(%rbp),%rcx
mov    $0xb04001bc,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uartB_putc>:
mov    $0xb04001b8,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x1,(%rax)
je     1110 <uartB_putc+0x10>
movsbq %dil,%rcx
mov    %rcx,0x4(%rax)
ret

LLVM IR (-O0):
define void @uartB_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 2956984760 to i64*)
%5 = and i64 %4, 1
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i8, i8* %2
%11 = sext i8 %10 to i64
store volatile i64 %11, i64* inttoptr (i64 2956984764 to i64*)
ret void
}

LLVM IR (-O2):
define void @uartB_putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2956984760 to i64*)
%4 = and i64 %3, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = sext i8 %0 to i64
store volatile i64 %7, i64* inttoptr (i64 2956984764 to i64*)
ret void
}