xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int main(void) {
  test("Hello, my name is John");
  test("  ");
  test("  Hello, word");
  test("  H,   00    ");
  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 <test@plt>
lea    0xefe(%rip),%rdi
call   1030 <test@plt>
lea    0xed9(%rip),%rdi
call   1030 <test@plt>
lea    0xedb(%rip),%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"Hello, my name is John\00"
@.str.1 = [3 x i8] c" \00"
@.str.2 = [14 x i8] c" Hello, word\00"
@.str.3 = [14 x i8] c" H, 00 \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hello, my name is John\00"
@.str.1 = [3 x i8] c" \00"
@.str.2 = [14 x i8] c" Hello, word\00"
@.str.3 = [14 x i8] c" H, 00 \00"
define i32 @main() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct pull_down_menu {
  int dummy;
};

/* Variables and functions */
int pull_down_menu_add_row_internal(struct pull_down_menu *, char *, char *,
                                    void (*)(void *), void *, int);
int pull_down_menu_add_row(struct pull_down_menu *m, char *column, char *row,
                           void (*func)(void *), void *cookie) {
  return pull_down_menu_add_row_internal(m, column, row, func, cookie, 1);
}


x86 assembly (clang, -O0):
<pull_down_menu_add_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <pull_down_menu_add_row_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pull_down_menu_add_row>:
mov    $0x1,%r9d
jmp    1030 <pull_down_menu_add_row_internal@plt>

LLVM IR (-O0):
%struct.pull_down_menu = type { i32 }
define i32 @pull_down_menu_add_row(%struct.pull_down_menu* %0, i8* %1, i8* %2, void (i8*)* %3, i8* %4) {
%6 = alloca %struct.pull_down_menu*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca void (i8*)*
%10 = alloca i8*
store %struct.pull_down_menu* %0, %struct.pull_down_menu** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store void (i8*)* %3, void (i8*)** %9
store i8* %4, i8** %10
%11 = load %struct.pull_down_menu*, %struct.pull_down_menu** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load void (i8*)*, void (i8*)** %9
%15 = load i8*, i8** %10
%16 = call i32 @pull_down_menu_add_row_internal(%struct.pull_down_menu* %11, i8* %12, i8* %13, void (i8*)* %14, i8* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.pull_down_menu = type { i32 }
define i32 @pull_down_menu_add_row(%struct.pull_down_menu* %0, i8* %1, i8* %2, void (i8*)* %3, i8* %4) {
%6 = tail call i32 @pull_down_menu_add_row_internal(%struct.pull_down_menu* %0, i8* %1, i8* %2, void (i8*)* %3, i8* %4, i32 1)
ret i32 %6
}
/* Type definitions */
struct stat {
  int dummy;
};
struct FTW {
  int dummy;
};

/* Variables and functions */
int remove(char const *);
int util_unlink_cb(const char *fpath, const struct stat *sb, int typeflag,
                   struct FTW *ftwbuf) {
  (void)sb;
  (void)typeflag;
  (void)ftwbuf;
  return remove(fpath);
}


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @util_unlink_cb(i8* %0, %struct.stat* %1, i32 %2, %struct.FTW* %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i32
%8 = alloca %struct.FTW*
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i32 %2, i32* %7
store %struct.FTW* %3, %struct.FTW** %8
%9 = load %struct.stat*, %struct.stat** %6
%10 = load i32, i32* %7
%11 = load %struct.FTW*, %struct.FTW** %8
%12 = load i8*, i8** %5
%13 = call i32 @remove(i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @util_unlink_cb(i8* nocapture %0, %struct.stat* nocapture readnone %1, i32 %2, %struct.FTW* nocapture readnone %3) {
%5 = tail call i32 @remove(i8* %0)
ret i32 %5
}
unsigned short int inw(unsigned short int port) {
  unsigned short int value;
  __asm__ __volatile__("inw %w1,%0" : "=a"(value) : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, int, int, int);
int mm_write_mtx_crd_size(FILE *f, int M, int N, int nz) {
  if (fprintf(f, "%d %d %d\n", M, N, nz) != 3)
    return 17;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mm_write_mtx_crd_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x3,%eax
je     1154 <mm_write_mtx_crd_size+0x44>
movl   $0x11,-0x4(%rbp)
jmp    115b <mm_write_mtx_crd_size+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_write_mtx_crd_size>:
push   %rax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
mov    $0x11,%eax
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @mm_write_mtx_crd_size(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%6 = icmp eq i32 %5, 3
%7 = select i1 %6, i32 0, i32 17
ret i32 %7
}
unsigned char f96(unsigned char x, unsigned long int y) {
  return (x << (8 * sizeof(unsigned char) - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f96>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f96>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f96(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 8, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %6, %9
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = ashr i32 %12, %14
%16 = add nsw i32 %10, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f96(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 8, %4
%6 = shl i32 %3, %5
%7 = lshr i32 %3, %4
%8 = add nsw i32 %6, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}
void delay(t) int t;
{ usleep(t * 50); }


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x32,-0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
imul   $0x32,%edi,%edi
xor    %eax,%eax
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 50
%5 = call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = mul nsw i32 %0, 50
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_session_get_service(const char *session, char **service) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_session_get_service>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_session_get_service(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_session_get_service(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
double f(double x) { return x * x - 2; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double -2.000000e+00)
ret double %5
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -2.000000e+00)
ret double %2
}
void send_buffer(buf, size) char *buf;
int size;
{
  char *send_buf;
  send_buf = (char *)malloc(size + 1);
  send_buf[0] = 'b';
  memcpy(send_buf + 1, buf, size);
  reply(send_buf, size + 1);
  free(send_buf);
}


x86 assembly (clang, -O0):
<send_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x62,(%rax)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    $0x0,%al
call   1040 <reply@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %esi,%r12d
mov    %rdi,%r14
lea    0x1(%r12),%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
movb   $0x62,(%rax)
lea    0x1(%rax),%rdi
movslq %r12d,%rdx
mov    %r14,%rsi
call   1050 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <reply@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @send_buffer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 98, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = load i8*, i8** %5
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
%20 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @reply to i32 (i8*, i32, ...)*)(i8* %17, i32 %19)
%21 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @send_buffer(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
store i8 98, i8* %5
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = sext i32 %1 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %6, i8* align 1 %0, i64 %7, i1 false)
%8 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @reply to i32 (i8*, i32, ...)*)(i8* %5, i32 %3)
tail call void @free(i8* %5)
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, size_t);
int8_t(cli_exit)(char *response, size_t respLen, int argc, char *argv[],
                 void *opts) {
  strncpy(response,
          "Closing connection..."
          "\n",
          respLen);
  return 1;
}


x86 assembly (clang, -O0):
<cli_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rsi
call   1030 <strncpy@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_exit>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <strncpy@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Closing connection...\0A\00"
define i32 @cli_exit(i8* %0, i64 %1, i32 %2, i8** %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i8** %3, i8*** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = call i32 @strncpy(i8* %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %12)
ret i32 1
}

LLVM IR (-O2):
@.str = [23 x i8] c"Closing connection...\0A\00"
define i32 @cli_exit(i8* %0, i64 %1, i32 %2, i8** nocapture readnone %3, i8* nocapture readnone %4) {
%6 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 1
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int handle_hash(void *key, int table_size) {
  int64_t *h1 = (int64_t *)key;
  int hash_value;
  hash_value = ((((1) << (15 - 6)) ^ (((*h1)) << (15 - 9))) ^
                (((0) << (15 - 6)) ^ ((0) >> 13) ^ ((0) << (15 - 12))));
  return hash_value % table_size;
}


x86 assembly (clang, -O0):
<handle_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
shl    $0x6,%eax
xor    $0x200,%eax
xor    $0x0,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_hash>:
mov    (%rdi),%eax
xor    $0x8,%eax
shl    $0x6,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @handle_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = shl i32 %10, 6
%12 = xor i32 512, %11
%13 = xor i32 %12, 0
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @handle_hash(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = shl i32 %4, 6
%6 = xor i32 %5, 512
%7 = srem i32 %6, %1
ret i32 %7
}
float third(float gallon, int size) { return gallon * size; }


x86 assembly (clang, -O0):
<third>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<third>:
cvtsi2ss %edi,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @third(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = fmul float %5, %7
ret float %8
}

LLVM IR (-O2):
define float @third(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fmul float %3, %0
ret float %4
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test02(void) { return test_sat_parser_should_fail("[)"); }


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

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

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

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

/* Variables and functions */
int atoi(char *);
int read(int, char *, int);
extern int read_int(int fd) {
  char buf[10] = {0};
  int ret = read(fd, buf, sizeof(buf) - 1);
  if (ret > 0) {
    ret = atoi(buf);
  }
  return ret;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
mov    $0x9,%edx
call   1040 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1175 <read_int+0x45>
lea    -0xe(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
sub    $0x18,%rsp
movw   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x9,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    1151 <read_int+0x31>
lea    0x8(%rsp),%rdi
call   1040 <atoi@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @read_int(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 9)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @atoi(i8* %3)
br label %8
8: ; preds = %6, %1
%9 = phi i32 [ %7, %6 ], [ %4, %1 ]
ret i32 %9
}
/* Variables and functions */
double exp(double const);
double HHNa_beta1(const double v) { return 4.0 * exp(-v / 18); }


x86 assembly (clang, -O0):
<HHNa_beta1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HHNa_beta1>:
push   %rax
divsd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @HHNa_beta1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = fdiv double %4, 1.800000e+01
%6 = call double @exp(double %5)
%7 = fmul double 4.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @HHNa_beta1(double %0) {
%2 = fdiv double %0, -1.800000e+01
%3 = tail call double @exp(double %2)
%4 = fmul double %3, 4.000000e+00
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isdigit(int);
void t_isdigit_0x38() {
  Assert_real((isdigit(56)),
              "/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_isdigit.c",
              285, ("isdigit should be 1 for 8"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x38>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <isdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x11d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x38>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x11d,%edx
jmp    1030 <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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 8\00"
define void @t_isdigit_0x38() {
%1 = call i32 @isdigit(i32 56)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([26 x i8], [26 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 8\00"
define void @t_isdigit_0x38() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct enemy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ enemy_get_sprite(struct enemy const *);
int sprite_row(int /*<<< orphan*/);
int enemy_get_row(struct enemy const *e) {
  if (e == NULL)
    return -1;
  return sprite_row(enemy_get_sprite(e));
}


x86 assembly (clang, -O0):
<enemy_get_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <enemy_get_row+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <enemy_get_row+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <enemy_get_sprite@plt>
mov    %eax,%edi
call   1040 <sprite_row@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enemy_get_row>:
test   %rdi,%rdi
je     1133 <enemy_get_row+0x13>
push   %rax
call   1030 <enemy_get_sprite@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sprite_row@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.enemy = type { i32 }
define i32 @enemy_get_row(%struct.enemy* %0) {
%2 = alloca i32
%3 = alloca %struct.enemy*
store %struct.enemy* %0, %struct.enemy** %3
%4 = load %struct.enemy*, %struct.enemy** %3
%5 = icmp eq %struct.enemy* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %11
7: ; preds = %1
%8 = load %struct.enemy*, %struct.enemy** %3
%9 = call i32 @enemy_get_sprite(%struct.enemy* %8)
%10 = call i32 @sprite_row(i32 %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.enemy = type { i32 }
define i32 @enemy_get_row(%struct.enemy* %0) {
%2 = icmp eq %struct.enemy* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @enemy_get_sprite(%struct.enemy* %0)
%5 = tail call i32 @sprite_row(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ -1, %1 ]
ret i32 %7
}
void SetDebugLevel(unsigned int level) {}


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

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

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

LLVM IR (-O2):
define void @SetDebugLevel(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wNotYet(char *);
void wBuiltinDir() { wNotYet("Dir"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"Dir\00"
define void @wBuiltinDir() {
%1 = tail call i32 @wNotYet(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Car_Set(int);
int /*<<< orphan*/ Car_SetAxles(int /*<<< orphan*/, int);
int /*<<< orphan*/ Car_SetAxlesSpace(int /*<<< orphan*/, int);
void Car_SetCarAxlesSpace(int carnum, int i, int Space) {
  Car_SetAxlesSpace(Car_SetAxles(Car_Set(carnum), i), Space);
}


x86 assembly (clang, -O0):
<Car_SetCarAxlesSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Car_Set@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1040 <Car_SetAxles@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1050 <Car_SetAxlesSpace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Car_SetCarAxlesSpace>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <Car_Set@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1040 <Car_SetAxles@plt>
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Car_SetAxlesSpace@plt>

LLVM IR (-O0):
define void @Car_SetCarAxlesSpace(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @Car_Set(i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @Car_SetAxles(i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @Car_SetAxlesSpace(i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @Car_SetCarAxlesSpace(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Car_Set(i32 %0)
%5 = tail call i32 @Car_SetAxles(i32 %4, i32 %1)
%6 = tail call i32 @Car_SetAxlesSpace(i32 %5, i32 %2)
ret void
}
void RTSocketClose(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSocketClose() {
ret void
}
int main() {
  int i, j;
  i = 0;
  j = 0;
lab:
  i = i + 1;
lab2:
  j = j + i;
  if (j < 10)
    goto lab;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    113a <main+0x3a>
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void serializeInt(unsigned i, unsigned char *buf) {
  buf[0] = (unsigned char)(i >> 24);
  buf[1] = (unsigned char)(i >> 16);
  buf[2] = (unsigned char)(i >> 8);
  buf[3] = (unsigned char)(i & 0xff);
}


x86 assembly (clang, -O0):
<serializeInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<serializeInt>:
bswap  %edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @serializeInt(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = lshr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = lshr i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i32, i32* %3
%16 = lshr i32 %15, 8
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i32, i32* %3
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 3
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
define void @serializeInt(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %0, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %0 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vid_write(char *);
int newline_handler(char **save, int *repeats_left) {
  (void)save;
  (void)repeats_left;
  vid_write("\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @newline_handler(i8** nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 @vid_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ command;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ stdout;
void textcolor_fg(int fg) {
  char command[64];
  snprintf(command, sizeof(command), "\033[%dm", fg + 30);
  fprintf(stdout, "%s", command);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<textcolor_fg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%ecx
add    $0x1e,%ecx
mov    $0x40,%esi
lea    0xeaf(%rip),%rdx
call   1030 <snprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textcolor_fg>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0x1e(%rdi),%ecx
lea    0xebf(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    0x2e88(%rip),%rbx
mov    (%rbx),%edi
lea    0xea5(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dm\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @textcolor_fg(i32 %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 30
%7 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdout
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dm\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @textcolor_fg(i32 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = add nsw i32 %0, 30
%5 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}
void wait_cmd(struct Command *ptr_cmd, struct Area *ptr_grid) { return; }


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

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

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

LLVM IR (-O2):
%struct.Command = type opaque
%struct.Area = type opaque
define void @wait_cmd(%struct.Command* nocapture %0, %struct.Area* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int /*<<< orphan*/ g(int);
int /*<<< orphan*/ h(int);
int /*<<< orphan*/ h2(int);
void main(int i) {
  g(1);
  h(2);
  h2(2);
  foo(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <g@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1040 <h2@plt>
mov    $0x1,%edi
call   1050 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1060 <g@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1040 <h2@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <foo@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @g(i32 1)
%4 = call i32 @h(i32 2)
%5 = call i32 @h2(i32 2)
%6 = call i32 @foo(i32 1)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @g(i32 1)
%3 = tail call i32 @h(i32 2)
%4 = tail call i32 @h2(i32 2)
%5 = tail call i32 @foo(i32 1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int comp128v3(int const *, int const *, int *, int *);
int comp128v2(const uint8_t *ki, const uint8_t *rand, uint8_t *sres,
              uint8_t *kc) {
  int r = comp128v3(ki, rand, sres, kc);
  kc[7] = 0;
  kc[6] &= 0xfc;
  return r;
}


x86 assembly (clang, -O0):
<comp128v2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <comp128v3@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,0x1c(%rax)
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%ecx
and    $0xfc,%ecx
mov    %ecx,0x18(%rax)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp128v2>:
push   %rbx
mov    %rcx,%rbx
call   1030 <comp128v3@plt>
movl   $0x0,0x1c(%rbx)
andl   $0xfc,0x18(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @comp128v2(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = call i32 @comp128v3(i32* %10, i32* %11, i32* %12, i32* %13)
store i32 %14, i32* %9
%15 = load i32*, i32** %8
%16 = getelementptr inbounds i32, i32* %15, i64 7
store i32 0, i32* %16
%17 = load i32*, i32** %8
%18 = getelementptr inbounds i32, i32* %17, i64 6
%19 = load i32, i32* %18
%20 = and i32 %19, 252
store i32 %20, i32* %18
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
define i32 @comp128v2(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @comp128v3(i32* %0, i32* %1, i32* %2, i32* %3)
%6 = getelementptr inbounds i32, i32* %3, i64 7
store i32 0, i32* %6
%7 = getelementptr inbounds i32, i32* %3, i64 6
%8 = load i32, i32* %7
%9 = and i32 %8, 252
store i32 %9, i32* %7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int __VERIFIER_nondet_int();
int f91(int);
int main() {
  int x = __VERIFIER_nondet_int();
  int result = f91(x);
  if (result == 91 || x > 102 && result == x - 10) {
    return 0;
  } else {
  ERROR:
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f91@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x5b,-0xc(%rbp)
je     1179 <main+0x49>
cmpl   $0x66,-0x8(%rbp)
jle    1185 <main+0x55>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0xa,%ecx
cmp    %ecx,%eax
jne    1185 <main+0x55>
movl   $0x0,-0x4(%rbp)
jmp    1191 <main+0x61>
jmp    118a <main+0x5a>
mov    $0x0,%al
call   1050 <__VERIFIER_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <f91@plt>
cmp    $0x5b,%eax
je     1159 <main+0x29>
cmp    $0x67,%ebx
jl     1152 <main+0x22>
add    $0xfffffff6,%ebx
cmp    %ebx,%eax
je     1159 <main+0x29>
xor    %eax,%eax
call   1050 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @f91(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 91
br i1 %8, label %17, label %9
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 102
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 10
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %18
17: ; preds = %12, %0
store i32 0, i32* %1
br label %21
18: ; preds = %12, %9
br label %19
19: ; preds = %18
%20 = call i32 (...) @__VERIFIER_error()
br label %21
21: ; preds = %17, %19
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @f91(i32 %1)
%3 = icmp eq i32 %2, 91
br i1 %3, label %11, label %4
4: ; preds = %0
%5 = icmp sgt i32 %1, 102
%6 = add nsw i32 %1, -10
%7 = icmp eq i32 %2, %6
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 (...) @__VERIFIER_error()
br label %11
11: ; preds = %0, %4, %9
ret i32 0
}
/* Variables and functions */
int fibR(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int N = 34;
  printf("fib = %d\n", fibR(N));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"fib = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fibR(i32 34)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int test_imm_BCuint8_reg(unsigned char val) {
  return ((val) & (-0xBC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BCuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -188
%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_BCuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 68
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int compare(const void *a, const void *b) {
  int *numberA = (int *)a;
  int *numberB = (int *)b;
  return *numberA - *numberB;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int ioctl(int, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int fd = open("/dev/version", O_RDWR);
  int id = ioctl(fd, 4444);
  printf("%d\n", id);
  close(fd);
  return id;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x115c,%esi
call   1040 <ioctl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xead(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x115c,%esi
call   1040 <ioctl@plt>
mov    %eax,%ebp
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1050 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/version\00"
@O_RDWR = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @ioctl(i32 %6, i32 4444)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/version\00"
@O_RDWR = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @ioctl(i32 %2, i32 4444)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @close(i32 %2)
ret i32 %3
}