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

/* Variables and functions */
scalar_t__ pthread_cond_destroy(int /*<<< orphan*/ *);
scalar_t__ pthread_cond_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int test_status_destroyed(pthread_cond_t *condvar) {
  int result = 1;
  if (pthread_cond_init(condvar, NULL) == 0 &&
      pthread_cond_destroy(condvar) == 0)
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<test_status_destroyed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_cond_init@plt>
cmp    $0x0,%rax
jne    1164 <test_status_destroyed+0x44>
mov    -0x8(%rbp),%rdi
call   1040 <pthread_cond_destroy@plt>
cmp    $0x0,%rax
jne    1164 <test_status_destroyed+0x44>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_status_destroyed>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <pthread_cond_init@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113a <test_status_destroyed+0x1a>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <pthread_cond_destroy@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test_status_destroyed(i32* %0) {
%2 = tail call i64 @pthread_cond_init(i32* %0, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @pthread_cond_destroy(i32* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ set_rounding();
double sqrt(double const);
void sqrt_d(const double *source, double *target) {
  set_rounding();
  *target = sqrt(*source);
}


x86 assembly (clang, -O0):
<sqrt_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <set_rounding@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sqrt@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_d>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <set_rounding@plt>
movsd  (%rbx),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1145 <sqrt_d+0x25>
sqrtsd %xmm0,%xmm0
jmp    114a <sqrt_d+0x2a>
call   1030 <sqrt@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sqrt_d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = call i32 (...) @set_rounding()
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = call double @sqrt(double %7)
%9 = load double*, double** %4
store double %8, double* %9
ret void
}

LLVM IR (-O2):
define void @sqrt_d(double* nocapture %0, double* nocapture writeonly %1) {
%3 = tail call i32 (...) @set_rounding()
%4 = load double, double* %0
%5 = tail call double @sqrt(double %4)
store double %5, double* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myprintf(char *);
int main() {
  myprintf("aaa");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"aaa\00"
define i32 @main() {
%1 = tail call i32 @myprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
int test(void) {
  pid_t pid = 0;
  pid_t pgid = 0;
  int result;
  result = setpgid(pid, pgid);
  return result;
}


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

x86 assembly (clang, -O2):
<test>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <setpgid@plt>

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

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @setpgid(i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fortune_cookie(char *);
int main(int argc, char *argv[]) {
  char *quote = "cookies make you fat";
  fortune_cookie(quote);
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"cookies make you fat\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @fortune_cookie(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"cookies make you fat\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fortune_cookie(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uDMAChannelEnable(uint32_t ui32Base, uint32_t ui32ChannelNum) {
  ;
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000028))) = 1 << ui32ChannelNum;
}


x86 assembly (clang, -O0):
<uDMAChannelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelEnable>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
movslq %edi,%rcx
mov    %rax,0x28(%rcx)
ret

LLVM IR (-O0):
define void @uDMAChannelEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = sext i32 %6 to i64
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 40
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
store volatile i64 %7, i64* %11
ret void
}

LLVM IR (-O2):
define void @uDMAChannelEnable(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sext i32 %3 to i64
%5 = add nsw i32 %0, 40
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
store volatile i64 %4, i64* %7
ret void
}
int my_strlen(const char *s) {
  int i;
  for (i = 0; s[i] != 0; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <my_strlen+0x37>
jmp    1129 <my_strlen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
char *__strpbrk(char const *, char const *);
char *strpbrk(const char *s1, const char *s2) { return __strpbrk(s1, s2); }


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

x86 assembly (clang, -O2):
<strpbrk>:
jmp    1030 <__strpbrk@plt>

LLVM IR (-O0):
define i8* @strpbrk(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 = call i8* @__strpbrk(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = tail call i8* @__strpbrk(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xc7() {
  Assert_real((isodigit(199) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1000, ("isodigit should be 0 for 0xc7"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xc7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc7,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3e8,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xc7>:
push   %rax
mov    $0xc7,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3e8,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc7\00"
define void @t_isodigit_0xc7() {
%1 = call i64 @isodigit(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc7\00"
define void @t_isodigit_0xc7() {
%1 = tail call i64 @isodigit(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned short bswap_16(unsigned short val) {
  return ((((val) >> 8) & 0xff) | (((val)&0xff) << 8));
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = and i32 %5, 255
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 255
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_smooth_part(void) {
  record_linux_param_description(
      "tcp_bic.c", "smooth_part",
      "log(B/(B*Smin))/log(B/(B-1))+B, # of RTT from Wmax-B to Wmax");
}


x86 assembly (clang, -O0):
<module_param_desc_smooth_part>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xeed(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_smooth_part>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xef1(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"tcp_bic.c\00"
@.str.1 = [12 x i8] c"smooth_part\00"
@.str.2 = [61 x i8] c"log(B/(B*Smin))/log(B/(B-1))+B, # of RTT from Wmax-B to Wmax\00"
define void @module_param_desc_smooth_part() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"tcp_bic.c\00"
@.str.1 = [12 x i8] c"smooth_part\00"
@.str.2 = [61 x i8] c"log(B/(B*Smin))/log(B/(B-1))+B, # of RTT from Wmax-B to Wmax\00"
define void @module_param_desc_smooth_part() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foobar(int);
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void *thread_run(void *ptr) {
  char *message = (char *)ptr;
  printf("Caller %s with id %ld\n", message, pthread_self());
  foobar(32);
}


x86 assembly (clang, -O0):
<thread_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <foobar@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_run>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x20,%edi
pop    %rbx
jmp    1030 <foobar@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Caller %s with id %ld\0A\00"
define i8* @thread_run(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 (...) @pthread_self()
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @foobar(i32 32)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [23 x i8] c"Caller %s with id %ld\0A\00"
define noalias i8* @thread_run(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
%4 = tail call i32 @foobar(i32 32)
ret i8* undef
}
/* Type definitions */
typedef unsigned char wint_t;

/* Variables and functions */
int MB_CUR_MAX;
unsigned char WEOF;
wint_t btowc(int c) {
  unsigned char ch = c;
  if (MB_CUR_MAX == 1) {
    return ch;
  } else {
    if (ch < 128)
      return ch;
  }
  return WEOF;
}


x86 assembly (clang, -O0):
<btowc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
mov    0x2ee4(%rip),%rax
cmpl   $0x1,(%rax)
jne    1128 <btowc+0x28>
mov    -0x9(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1153 <btowc+0x53>
movzbl -0x9(%rbp),%eax
cmp    $0x80,%eax
jge    1142 <btowc+0x42>
mov    -0x9(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1153 <btowc+0x53>
jmp    1147 <btowc+0x47>
mov    0x2e8a(%rip),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btowc>:
mov    0x2ef1(%rip),%rax
cmpl   $0x1,(%rax)
mov    0x2ec7(%rip),%rax
movzbl (%rax),%eax
cmove  %edi,%eax
test   $0x80,%dil
cmove  %edi,%eax
ret

LLVM IR (-O0):
@MB_CUR_MAX = global i32 0
@WEOF = global i8 0
define zeroext i8 @btowc(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i8
store i8 %6, i8* %4
%7 = load i32, i32* @MB_CUR_MAX
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8, i8* %4
store i8 %10, i8* %2
br label %20
11: ; preds = %1
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = icmp slt i32 %13, 128
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i8, i8* %4
store i8 %16, i8* %2
br label %20
17: ; preds = %11
br label %18
18: ; preds = %17
%19 = load i8, i8* @WEOF
store i8 %19, i8* %2
br label %20
20: ; preds = %18, %15, %9
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
@MB_CUR_MAX = global i32 0
@WEOF = global i8 0
define zeroext i8 @btowc(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = load i32, i32* @MB_CUR_MAX
%4 = icmp eq i32 %3, 1
%5 = and i32 %0, 128
%6 = icmp eq i32 %5, 0
%7 = or i1 %6, %4
%8 = load i8, i8* @WEOF
%9 = select i1 %7, i8 %2, i8 %8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M1_f(char *s) {
  debug("M1_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M1_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M1_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"M1_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M1_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [45 x i8] c"M1_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M1_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int read_multprec_target_system(int decimals) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(491, &decimals, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_multprec_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1eb,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_multprec_target_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1eb,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_multprec_target_system(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 491, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_multprec_target_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 491, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int /*<<< orphan*/);
int /*<<< orphan*/ IntUnregister(int /*<<< orphan*/);
int /*<<< orphan*/ _QEIIntNumberGet(int /*<<< orphan*/);
void QEIIntUnregister(uint32_t ui32Base) {
  uint32_t ui32Int;
  ;
  ui32Int = _QEIIntNumberGet(ui32Base);
  ;
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<QEIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_QEIIntNumberGet@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntUnregister>:
push   %rbx
call   1030 <_QEIIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @QEIIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_QEIIntNumberGet(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @IntDisable(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @IntUnregister(i32 %8)
ret void
}

LLVM IR (-O2):
define void @QEIIntUnregister(i32 %0) {
%2 = tail call i32 @_QEIIntNumberGet(i32 %0)
%3 = tail call i32 @IntDisable(i32 %2)
%4 = tail call i32 @IntUnregister(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_background(int /*<<< orphan*/);
int /*<<< orphan*/ set_foreground(int);
void reset_test_colors(void) {
  set_foreground(7);
  set_background(0);
}


x86 assembly (clang, -O0):
<reset_test_colors>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <set_foreground@plt>
xor    %edi,%edi
call   1040 <set_background@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_test_colors>:
push   %rax
mov    $0x7,%edi
call   1030 <set_foreground@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <set_background@plt>

LLVM IR (-O0):
define void @reset_test_colors() {
%1 = call i32 @set_foreground(i32 7)
%2 = call i32 @set_background(i32 0)
ret void
}

LLVM IR (-O2):
define void @reset_test_colors() {
%1 = tail call i32 @set_foreground(i32 7)
%2 = tail call i32 @set_background(i32 0)
ret void
}
/* Variables and functions */
int fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
    char const *);
int fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(i8* %0) {
%2 = tail call i32 @fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_MPYDP(int r, int v) { C67_asm("MPYDP.M", v, r, v); }


x86 assembly (clang, -O0):
<C67_MPYDP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed2(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"MPYDP.M\00"
define void @C67_MPYDP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"MPYDP.M\00"
define void @C67_MPYDP(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int netbas_system_call(int, unsigned long *, unsigned long, char *, int, long);
int create_vm_region(unsigned long *user_space, unsigned long dest, char *name,
                     int size, long flags) {
  int ret;
  ret = netbas_system_call(105, user_space, dest, name, size, flags);
  return ret;
}


x86 assembly (clang, -O0):
<create_vm_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    $0x69,%edi
call   1030 <netbas_system_call@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_vm_region>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x69,%edi
jmp    1030 <netbas_system_call@plt>

LLVM IR (-O0):
define i32 @create_vm_region(i64* %0, i64 %1, i8* %2, i32 %3, i64 %4) {
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i64
%11 = alloca i32
store i64* %0, i64** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%12 = load i64*, i64** %6
%13 = load i64, i64* %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load i64, i64* %10
%17 = call i32 @netbas_system_call(i32 105, i64* %12, i64 %13, i8* %14, i32 %15, i64 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
ret i32 %18
}

LLVM IR (-O2):
define i32 @create_vm_region(i64* %0, i64 %1, i8* %2, i32 %3, i64 %4) {
%6 = tail call i32 @netbas_system_call(i32 105, i64* %0, i64 %1, i8* %2, i32 %3, i64 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int stdlib_free(void *al, void *obj) {
  free(obj);
  (void)al;
  return 0;
}


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

x86 assembly (clang, -O2):
<stdlib_free>:
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @stdlib_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
void f7(void) {}


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

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

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

LLVM IR (-O2):
define void @f7() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __clear_user_asm(void *, unsigned long);
int /*<<< orphan*/ might_sleep();
unsigned long clear_user(void *to, unsigned long n) {
  might_sleep();
  if ((1))
    n = ({ __clear_user_asm(to, n); });
  return n;
}


x86 assembly (clang, -O0):
<clear_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <might_sleep@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__clear_user_asm@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_user>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <might_sleep@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <__clear_user_asm@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @clear_user(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 (...) @might_sleep()
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @__clear_user_asm(i8* %7, i64 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
store i64 %11, i64* %4
%12 = load i64, i64* %4
ret i64 %12
}

LLVM IR (-O2):
define i64 @clear_user(i8* %0, i64 %1) {
%3 = tail call i32 (...) @might_sleep()
%4 = tail call i32 @__clear_user_asm(i8* %0, i64 %1)
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
char *strchr(char *, char);
char *remComment(char *s) {
  char *comment;
  comment = strchr(s, ';');
  if (comment)
    *comment = '\0';
  return s;
}


x86 assembly (clang, -O0):
<remComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3b,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <remComment+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remComment>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3b,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <remComment+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @remComment(i8* returned %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 59)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showHelp(void) {
  printf("Usage: %s [-V, --version] [-h, --help]\n\n     -V, "
         "--version\tdisplay version\n     -h, --help\t\tdisplay this help\n\n "
         "    Report bugs to <bulliver@gmail.com>\n",
         "uptime");
}


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

x86 assembly (clang, -O2):
<showHelp>:
lea    0xee9(%rip),%rdi
lea    0xf7b(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [153 x i8] c"Usage: %s [-V, --version] [-h, --help]\0A\0A -V, --version\09display version\0A -h, --help\09\09display this help\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [7 x i8] c"uptime\00"
define void @showHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [153 x i8] c"Usage: %s [-V, --version] [-h, --help]\0A\0A -V, --version\09display version\0A -h, --help\09\09display this help\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [7 x i8] c"uptime\00"
define void @showHelp() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int dbl_cmp(const void *x, const void *y) {
  double *a, *b;
  a = (double *)x;
  b = (double *)y;
  if (*a > *b)
    return 1;
  else if (*a == *b)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<dbl_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    113e <dbl_cmp+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    116d <dbl_cmp+0x6d>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1166 <dbl_cmp+0x66>
jp     1166 <dbl_cmp+0x66>
movl   $0x0,-0x4(%rbp)
jmp    116d <dbl_cmp+0x6d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_cmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
ucomisd %xmm1,%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rcx
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dbl_cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp ogt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp oeq double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 0, i32* %3
br label %26
25: ; preds = %18
store i32 -1, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @dbl_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = fcmp une double %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int *call_for_sp() {
  int d;
  int *res = &d;
  return res;
}


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

x86 assembly (clang, -O2):
<call_for_sp>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @call_for_sp() {
%1 = alloca i32
ret i32* %1
}
void write_cr0(unsigned long val) { asm volatile("movq %0,%%cr0" ::"r"(val)); }


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

x86 assembly (clang, -O2):
<write_cr0>:
mov    %rdi,%cr0
ret

LLVM IR (-O0):
define void @write_cr0(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret void
}

LLVM IR (-O2):
define void @write_cr0(i64 %0) {
tail call void asm sideeffect "movq $0,%cr0", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
void g_slist_copy() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_copy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int vfscanf(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int __isoc99_vfscanf(FILE *restrict stream, const char *restrict format,
                     va_list args) {
  return vfscanf(stream, format, args);
}


x86 assembly (clang, -O0):
<__isoc99_vfscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isoc99_vfscanf>:
jmp    1030 <vfscanf@plt>

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

LLVM IR (-O2):
define i32 @__isoc99_vfscanf(i32* noalias %0, i8* noalias %1, i32 %2) {
%4 = tail call i32 @vfscanf(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ close(int);
int i2c_close(int file_handle) {
  if (close(file_handle) < 0) {
    return -1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<i2c_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1139 <i2c_close+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1140 <i2c_close+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_close>:
push   %rax
call   1030 <close@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i2c_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @close(i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @i2c_close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
int isReg(const char *op) { return op[0] == '$'; }


x86 assembly (clang, -O0):
<isReg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x24,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isReg>:
xor    %eax,%eax
cmpb   $0x24,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isReg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 36
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isReg(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 36
%4 = zext i1 %3 to i32
ret i32 %4
}
int clamp(int v) {
  if (v > 255)
    return 255;
  else
    return v;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jle    1120 <clamp+0x20>
movl   $0xff,-0x4(%rbp)
jmp    1126 <clamp+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
cmp    $0xff,%edi
mov    $0xff,%eax
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
ret i32 %3
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ spritewidth(int);
void basSpriteWidth() {
  int n;
  n = popNumber();
  pushNumber(spritewidth(n));
}


x86 assembly (clang, -O0):
<basSpriteWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <spritewidth@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basSpriteWidth>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <spritewidth@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basSpriteWidth() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @spritewidth(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basSpriteWidth() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @spritewidth(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
void XkbFindOverlayForKey() {}


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

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

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

LLVM IR (-O2):
define void @XkbFindOverlayForKey() {
ret void
}
/* Variables and functions */
char *fdt_string(void const *, int);
scalar_t__ memcmp(char const *, char const *, int);
int strlen(char const *);
int _fdt_string_eq(const void *fdt, int stroffset, const char *s, int len) {
  const char *p = fdt_string(fdt, stroffset);
  return (strlen(p) == len) && (memcmp(p, s, len) == 0);
}


x86 assembly (clang, -O0):
<_fdt_string_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <fdt_string@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    -0x1c(%rbp),%ecx
mov    %al,-0x29(%rbp)
jne    1189 <_fdt_string_eq+0x59>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fdt_string_eq>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebp
mov    %rdx,%r14
call   1040 <fdt_string@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
jne    1169 <_fdt_string_eq+0x39>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_fdt_string_eq(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i8* @fdt_string(i8* %10, i32 %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = call i32 @strlen(i8* %13)
%15 = load i32, i32* %8
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %23
17: ; preds = %4
%18 = load i8*, i8** %9
%19 = load i8*, i8** %7
%20 = load i32, i32* %8
%21 = call i64 @memcmp(i8* %18, i8* %19, i32 %20)
%22 = icmp eq i64 %21, 0
br label %23
23: ; preds = %17, %4
%24 = phi i1 [ false, %4 ], [ %22, %17 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @_fdt_string_eq(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i8* @fdt_string(i8* %0, i32 %1)
%6 = tail call i32 @strlen(i8* %5)
%7 = icmp eq i32 %6, %3
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = tail call i64 @memcmp(i8* %5, i8* %2, i32 %3)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ 0, %4 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int (*)(int));
void printFunction(int (*fPtr)(int)) { printf("func is at %p\n", fPtr); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"func is at %p\0A\00"
define void @printFunction(i32 (i32)* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 (i32)* %0)
ret void
}
/* Variables and functions */
int clip23(int /*<<< orphan*/);
int /*<<< orphan*/ lrint(double);
int convert(double a) { return clip23(lrint(a)); }


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lrint@plt>
mov    %eax,%edi
call   1040 <clip23@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %rax
call   1030 <lrint@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <clip23@plt>

LLVM IR (-O0):
define i32 @convert(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @lrint(double %3)
%5 = call i32 @clip23(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @convert(double %0) {
%2 = tail call i32 @lrint(double %0)
%3 = tail call i32 @clip23(i32 %2)
ret i32 %3
}