xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strncpy(char *dest, const char *src, size_t n) {
  char *res = dest;
  while (*src != '\0')
    *dest++ = *src++;
  *dest++ = *src++;
  return res;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114f <strncpy+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1118 <strncpy+0x18>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strncpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strncpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %0, %3 ]
%9 = phi i8* [ %10, %6 ], [ %1, %3 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %8
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3
%15 = phi i8* [ %0, %3 ], [ %11, %6 ]
store i8 0, i8* %15
ret i8* %0
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
struct link {
  int dummy;
};

/* Variables and functions */
int link_internal_sleep(struct link *, struct timeval *, int /*<<< orphan*/ *,
                        int, int);
int link_usleep(struct link *link, int usec, int reading, int writing) {
  struct timeval tm;
  tm.tv_sec = 0;
  tm.tv_usec = usec;
  return link_internal_sleep(link, &tm, NULL, reading, writing);
}


x86 assembly (clang, -O0):
<link_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <link_internal_sleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link_usleep>:
sub    $0x18,%rsp
mov    %ecx,%r8d
mov    %edx,%ecx
movq   $0x0,0x10(%rsp)
mov    %esi,0x8(%rsp)
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <link_internal_sleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.link = type { i32 }
%struct.timeval = type { i32, i64 }
define i32 @link_usleep(%struct.link* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.link*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.timeval
store %struct.link* %0, %struct.link** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
store i64 0, i64* %10
%11 = load i32, i32* %6
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
store i32 %11, i32* %12
%13 = load %struct.link*, %struct.link** %5
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @link_internal_sleep(%struct.link* %13, %struct.timeval* %9, i32* null, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.link = type { i32 }
%struct.timeval = type { i32, i64 }
define i32 @link_usleep(%struct.link* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.timeval
%6 = bitcast %struct.timeval* %5 to i8*
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
store i32 %1, i32* %8
%9 = call i32 @link_internal_sleep(%struct.link* %0, %struct.timeval* %5, i32* null, i32 %2, i32 %3)
ret i32 %9
}
void gtk_about_dialog_set_logo() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_set_logo() {
ret void
}
void free_char_RT(int nrow, char **RT) {
  int i;
  for (i = 0; i < nrow; i++) {
    free(RT[i]);
  }
  free(RT);
}


x86 assembly (clang, -O0):
<free_char_RT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <free_char_RT+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <free_char_RT+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_char_RT>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <free_char_RT+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_char_RT+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_char_RT(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_assert(char const *, char const *, int, char const *,
                              char *);
__attribute__((noreturn)) void log_assert_failed(const char *text,
                                                 const char *file, int line,
                                                 const char *func) {
  log_assert(text, file, line, func,
             "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
}


x86 assembly (clang, -O0):
<log_assert_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xec3(%rip),%r8
call   1030 <log_assert@plt>

x86 assembly (clang, -O2):
<log_assert_failed>:
push   %rax
lea    0xee8(%rip),%r8
call   1030 <log_assert@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"Assertion '%s' failed at %s:%u, function %s(). Aborting.\00"
define void @log_assert_failed(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @log_assert(i8* %9, i8* %10, i32 %11, i8* %12, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [57 x i8] c"Assertion '%s' failed at %s:%u, function %s(). Aborting.\00"
define void @log_assert_failed(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @log_assert(i8* %0, i8* %1, i32 %2, i8* %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
unreachable
}
int test_imm_42int16_mem(short *val) {
  return ((*val) & (-0x42 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_42int16_mem>:
movzwl (%rdi),%eax
test   $0xffbe,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_42int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -66
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo(void) {
  int i, j;
#pragma omp for simd copyprivate(j
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <foo+0x28>
jmp    111a <foo+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
double us(unsigned short *p) { return (double)*p; }


x86 assembly (clang, -O0):
<us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<us>:
movzwl (%rdi),%eax
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @us(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = uitofp i16 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @us(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = uitofp i16 %2 to double
ret double %3
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int curr_time_micro(void) {
  struct timeval tp[1];
  struct timezone tzp[1];
  gettimeofday(tp, tzp);
  return tp->tv_sec * 1000000 + tp->tv_usec;
}


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

x86 assembly (clang, -O2):
<curr_time_micro>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%eax
add    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i32 @curr_time_micro() {
%1 = alloca [1 x %struct.timeval]
%2 = alloca [1 x %struct.timezone]
%3 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1 x %struct.timezone], [1 x %struct.timezone]* %2, i64 0, i64 0
%5 = call i32 @gettimeofday(%struct.timeval* %3, %struct.timezone* %4)
%6 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000000
%10 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i32 @curr_time_micro() {
%1 = alloca [1 x %struct.timeval]
%2 = alloca [1 x %struct.timezone]
%3 = bitcast [1 x %struct.timeval]* %1 to i8*
%4 = bitcast [1 x %struct.timezone]* %2 to i8*
%5 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x %struct.timezone], [1 x %struct.timezone]* %2, i64 0, i64 0
%7 = call i32 @gettimeofday(%struct.timeval* %5, %struct.timezone* %6)
%8 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0, i32 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000000
%11 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0, i32 1
%12 = load i32, i32* %11
%13 = add nsw i32 %10, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void _clear_screen(void) { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @_clear_screen() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int quicly_is_supported_version(uint32_t version) {
  switch (version) {
  case 0xff00001d:
  case 0xff00001b:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<quicly_is_supported_version>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xff00001b,%eax
je     1130 <quicly_is_supported_version+0x30>
jmp    111d <quicly_is_supported_version+0x1d>
mov    -0xc(%rbp),%eax
sub    $0xff00001d,%eax
jne    113c <quicly_is_supported_version+0x3c>
jmp    1130 <quicly_is_supported_version+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1143 <quicly_is_supported_version+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicly_is_supported_version>:
add    $0xffffe5,%edi
xor    %eax,%eax
test   $0xfffffffd,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @quicly_is_supported_version(i32 %0) {
%2 = icmp eq i32 %0, -16777187
%3 = icmp eq i32 %0, -16777189
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ prime();
int main() {
  prime();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @prime()
ret i32 0
}
/* Variables and functions */
int h(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  printf("%x\n", h(argv[1], strlen(argv[1])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <h@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @h(i8* %8, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @h(i8* %4, i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
void bar(void *p, void *q, unsigned s) { memcpy(p, q, s); }


x86 assembly (clang, -O0):
<bar>:
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 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bar(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void uart_puts(const char *s) { printf("uart_puts(%s)\n", s); }


x86 assembly (clang, -O0):
<uart_puts>:
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):
<uart_puts>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"uart_puts(%s)\0A\00"
define void @uart_puts(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void nv2a_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @nv2a_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char const *, int /*<<< orphan*/);
int i2c_open(const char *bus_name) {
  int fd;
  if ((fd = open(bus_name, O_RDWR)) == -1) {
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<i2c_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1146 <i2c_open+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <i2c_open+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_open>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

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

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @i2c_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
int get_NMCnparm(unsigned char *pds) { return pds[8]; }


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

x86 assembly (clang, -O2):
<get_NMCnparm>:
movzbl 0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_NMCnparm(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
int test_imm_8Eint16_reg(short val) {
  return ((val) & (-0x8E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff72,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Eint16_reg>:
test   $0xff72,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Eint16_reg(i16 signext %0) {
%2 = and i16 %0, -142
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void minipack_pack_fixmap(void *ptr, uint8_t count, size_t *sz) {
  *sz = 1;
  *((uint8_t *)ptr) = (count & 0x0F) | 0x80;
}


x86 assembly (clang, -O0):
<minipack_pack_fixmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x1,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
or     $0x80,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_fixmap>:
movq   $0x1,(%rdx)
and    $0xf,%esi
or     $0x80,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @minipack_pack_fixmap(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 1, i64* %7
%8 = load i32, i32* %5
%9 = and i32 %8, 15
%10 = or i32 %9, 128
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @minipack_pack_fixmap(i8* nocapture writeonly %0, i32 %1, i64* nocapture writeonly %2) {
store i64 1, i64* %2
%4 = and i32 %1, 15
%5 = or i32 %4, 128
%6 = bitcast i8* %0 to i32*
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int init_module(void) {
  printk("<1>Hello world 1.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"<1>Hello world 1.\0A\00"
define i32 @init_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"<1>Hello world 1.\0A\00"
define i32 @init_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int free_board(unsigned char **board, unsigned int rows, unsigned int cols) {
  unsigned int i;
  for (i = 0; i < cols; i++) {
    free(board[i]);
  }
  free(board);
  return 0;
}


x86 assembly (clang, -O0):
<free_board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1153 <free_board+0x43>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <free_board+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_board>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %edx,%edx
je     1142 <free_board+0x32>
mov    %edx,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_board+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @free_board(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Add(int);
main() {
  int k;
  int myarray[100];
  for (k = 0; k < 100; k++)
    Add(myarray[k]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1151 <main+0x41>
movslq -0x8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%edi
call   1030 <Add@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%rsp,%rbx,4),%edi
call   1030 <Add@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %8, %3 ]
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @Add(i32 %6)
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 100
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 0
}
int test_imm_18uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x18 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_18uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1572864
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *_ultoa(long);
char *_ltoa(long val) {
  char *p;
  int flg = 0;
  if (val < 0) {
    flg++;
    val = -val;
  }
  p = _ultoa(val);
  if (flg)
    *--p = '-';
  return p;
}


x86 assembly (clang, -O0):
<_ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1141 <_ltoa+0x31>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_ultoa@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116b <_ltoa+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,-0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ltoa>:
push   %rbx
mov    %rdi,%rbx
neg    %rdi
cmovs  %rbx,%rdi
call   1030 <_ultoa@plt>
test   %rbx,%rbx
js     1127 <_ltoa+0x17>
pop    %rbx
ret
movb   $0x2d,-0x1(%rax)
add    $0xffffffffffffffff,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_ltoa(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %4
%5 = load i64, i64* %2
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
%10 = load i64, i64* %2
%11 = sub nsw i64 0, %10
store i64 %11, i64* %2
br label %12
12: ; preds = %7, %1
%13 = load i64, i64* %2
%14 = call i8* @_ultoa(i64 %13)
store i8* %14, i8** %3
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 -1
store i8* %19, i8** %3
store i8 45, i8* %19
br label %20
20: ; preds = %17, %12
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @_ltoa(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = sub nsw i64 0, %0
%4 = select i1 %2, i64 %3, i64 %0
%5 = tail call i8* @_ultoa(i64 %4)
br i1 %2, label %6, label %8
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 45, i8* %7
br label %8
8: ; preds = %6, %1
%9 = phi i8* [ %7, %6 ], [ %5, %1 ]
ret i8* %9
}
void gtk_label_get_justify() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_get_justify() {
ret void
}
/* Type definitions */
typedef int GLint;
typedef int GLenum;

/* Variables and functions */
#define GL_EYE_PLANE 130
#define GL_OBJECT_PLANE 129
#define GL_TEXTURE_GEN_MODE 128
GLint __glTexGendv_size(GLenum e) {
  switch (e) {
  case GL_TEXTURE_GEN_MODE:
    return 1;
  case GL_OBJECT_PLANE:
  case GL_EYE_PLANE:
    return 4;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<__glTexGendv_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x80,%eax
je     1133 <__glTexGendv_size+0x33>
jmp    111d <__glTexGendv_size+0x1d>
mov    -0xc(%rbp),%eax
add    $0xffffff7f,%eax
sub    $0x2,%eax
jb     113f <__glTexGendv_size+0x3f>
jmp    114b <__glTexGendv_size+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <__glTexGendv_size+0x52>
movl   $0x4,-0x4(%rbp)
jmp    1152 <__glTexGendv_size+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glTexGendv_size>:
add    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x2,%edi
ja     1117 <__glTexGendv_size+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.__glTexGendv_size = [3 x i32] [i32 1, i32 4, i32 4]
define i32 @__glTexGendv_size(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.__glTexGendv_size, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x04() {
  Assert_real((ispunct(4) == 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_ispunct.c",
              25, ("ispunct should be 0 for 0x04"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x04>:
push   %rax
mov    $0x4,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x19,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x04\00"
define void @t_ispunct_0x04() {
%1 = call i64 @ispunct(i32 4)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x04\00"
define void @t_ispunct_0x04() {
%1 = tail call i64 @ispunct(i32 4)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  int arg1 = 190;
  int dec = 0;
  __asm__("decl %%eax;" : "=a"(dec) : "a"(arg1));
  return dec;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xbe,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
dec    %eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xbe,%eax
dec    %eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 190, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "decl %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "decl %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 190)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
out() {
  putchar('\n');
  fflush(stdout);
  exit(-1);
}


x86 assembly (clang, -O0):
<out>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<out>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @out() {
%1 = call i32 @putchar(i8 signext 10)
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @out() {
%1 = tail call i32 @putchar(i8 signext 10)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
int rgb2Int(const int r, const int g, const int b) {
  int tr = (r << 16) & 0x00FF0000;
  int tg = (g << 8) & 0x0000FF00;
  int tb = b & 0x000000FF;
  return 0xFF000000 | tr | tg | tb;
}


x86 assembly (clang, -O0):
<rgb2Int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
and    $0xff0000,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     $0xff000000,%eax
or     -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb2Int>:
shl    $0x10,%edi
shl    $0x8,%esi
movzwl %si,%ecx
or     %edi,%ecx
movzbl %dl,%eax
or     %ecx,%eax
or     $0xff000000,%eax
ret

LLVM IR (-O0):
define i32 @rgb2Int(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = shl i32 %10, 16
%12 = and i32 %11, 16711680
store i32 %12, i32* %7
%13 = load i32, i32* %5
%14 = shl i32 %13, 8
%15 = and i32 %14, 65280
store i32 %15, i32* %8
%16 = load i32, i32* %6
%17 = and i32 %16, 255
store i32 %17, i32* %9
%18 = load i32, i32* %7
%19 = or i32 -16777216, %18
%20 = load i32, i32* %8
%21 = or i32 %19, %20
%22 = load i32, i32* %9
%23 = or i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @rgb2Int(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = shl i32 %1, 8
%6 = and i32 %5, 65280
%7 = and i32 %2, 255
%8 = or i32 %6, %4
%9 = or i32 %8, %7
%10 = or i32 %9, -16777216
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ array1;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int main() {
  int array1[5] = {1, 2, 3, 4, 5};
  int array2[5] = {0};
  memcpy(array2, array1, sizeof(array1));
  memset(array1, 0, sizeof(array1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x14,%edx
call   1040 <memcpy@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x14,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 20)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = call i32 @memset(i32* %8, i32 0, i32 20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 20)
%8 = call i32 @memset(i32* %6, i32 0, i32 20)
ret i32 0
}
int fsync() { return -1; }


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

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

LLVM IR (-O0):
define i32 @fsync() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @fsync() {
ret i32 -1
}
float fftease_rrand(int *seed) {
  int i = ((*seed = *seed * 1103515245 + 12345) >> 16) & 077777;
  return ((float)i / 16384. - 1.);
}


x86 assembly (clang, -O0):
<fftease_rrand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x41c64e6d,(%rax),%eax
add    $0x3039,%eax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
sar    $0x10,%eax
and    $0x7fff,%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftease_rrand>:
imul   $0x41c64e6d,(%rdi),%eax
add    $0x3039,%eax
mov    %eax,(%rdi)
shr    $0x10,%eax
and    $0x7fff,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xedb(%rip),%xmm0
addsd  0xedb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fftease_rrand(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1103515245
%7 = add nsw i32 %6, 12345
%8 = load i32*, i32** %2
store i32 %7, i32* %8
%9 = ashr i32 %7, 16
%10 = and i32 %9, 32767
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to float
%13 = fpext float %12 to double
%14 = fdiv double %13, 1.638400e+04
%15 = fsub double %14, 1.000000e+00
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
define float @fftease_rrand(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 1103515245
%4 = add nsw i32 %3, 12345
store i32 %4, i32* %0
%5 = lshr i32 %4, 16
%6 = and i32 %5, 32767
%7 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = fmul double %8, 0x3F10000000000000
%10 = fadd double %9, -1.000000e+00
%11 = fptrunc double %10 to float
ret float %11
}
void SDL_imageFilterRestoreStack(void) {}


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

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

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

LLVM IR (-O2):
define void @SDL_imageFilterRestoreStack() {
ret void
}
void ff_hevc_put_hevc_bi_pel_pixels12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels12_12_sse4() {
ret void
}
int base64_handles_dots() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @base64_handles_dots() {
ret i32 0
}