xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ llog(int, char *, size_t, void *);
int /*<<< orphan*/ xmalloc_fatal(char *, int, size_t);
void *xcalloc(size_t nmemb, size_t size) {
  void *p;
  if (!(p = calloc(nmemb, size)))
    xmalloc_fatal("xcalloc", 1, size * nmemb);
  llog(9, "xcalloc(%d): %p\n", nmemb * size, p);
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1175 <xcalloc+0x45>
mov    -0x10(%rbp),%rdx
imul   -0x8(%rbp),%rdx
lea    0xe95(%rip),%rdi
mov    $0x1,%esi
call   1050 <xmalloc_fatal@plt>
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x9,%edi
lea    0xe7a(%rip),%rsi
call   1040 <llog@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r15
call   1030 <calloc@plt>
mov    %rax,%r14
imul   %r15,%rbx
test   %rax,%rax
jne    1160 <xcalloc+0x30>
lea    0xead(%rip),%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1050 <xmalloc_fatal@plt>
lea    0xea1(%rip),%rsi
mov    $0x9,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <llog@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"xcalloc\00"
@.str.1 = [17 x i8] c"xcalloc(%d): %p\0A\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = mul i64 %1, %0
br i1 %4, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @xmalloc_fatal(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1, i64 %5)
br label %8
8: ; preds = %2, %6
%9 = tail call i32 @llog(i32 9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 %5, i8* %3)
ret i8* %3
}
struct E {
  float a;
  int b, c;
  float d;
} ef() {
  return (struct E){1, 2, 3, 4};
}


x86 assembly (clang, -O0):
<ef>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3f800000,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x40800000,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ef>:
movabs $0x23f800000,%rax
movabs $0x4080000000000003,%rdx
ret

LLVM IR (-O0):
%struct.E = type { float, i32, i32, float }
define { i64, i64 } @ef() {
%1 = alloca %struct.E
%2 = getelementptr inbounds %struct.E, %struct.E* %1, i32 0, i32 0
store float 1.000000e+00, float* %2
%3 = getelementptr inbounds %struct.E, %struct.E* %1, i32 0, i32 1
store i32 2, i32* %3
%4 = getelementptr inbounds %struct.E, %struct.E* %1, i32 0, i32 2
store i32 3, i32* %4
%5 = getelementptr inbounds %struct.E, %struct.E* %1, i32 0, i32 3
store float 4.000000e+00, float* %5
%6 = bitcast %struct.E* %1 to { i64, i64 }*
%7 = load { i64, i64 }, { i64, i64 }* %6
ret { i64, i64 } %7
}

LLVM IR (-O2):
define { i64, i64 } @ef() {
ret { i64, i64 } { i64 9655287808, i64 4647714815446351875 }
}
/* Variables and functions */
int /*<<< orphan*/ coio_delay(int);
int /*<<< orphan*/ printf(char *);
void _t1(void *arg) {
  printf("going to sleep 1000ms (1s)\n");
  coio_delay(1000);
  printf("woken up\n");
}


x86 assembly (clang, -O0):
<_t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3e8,%edi
call   1040 <coio_delay@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_t1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3e8,%edi
call   1040 <coio_delay@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"going to sleep 1000ms (1s)\0A\00"
@.str.1 = [10 x i8] c"woken up\0A\00"
define void @_t1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @coio_delay(i32 1000)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"going to sleep 1000ms (1s)\00"
@str.2 = [9 x i8] c"woken up\00"
define void @_t1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @coio_delay(i32 1000)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sstream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, float);
int /*<<< orphan*/ sstream_push_cstr(struct sstream *, char *);
void sstream_push_float(struct sstream *ctx, float val) {
  char buffer[128] = {0};
  sprintf(buffer, "%f", val);
  sstream_push_cstr(ctx, buffer);
}


x86 assembly (clang, -O0):
<sstream_push_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
lea    -0x90(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
lea    0xe96(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1050 <sstream_push_cstr@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstream_push_float>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
xorps  %xmm1,%xmm1
movaps %xmm1,0x70(%rsp)
movaps %xmm1,0x60(%rsp)
movaps %xmm1,0x50(%rsp)
movaps %xmm1,0x40(%rsp)
movaps %xmm1,0x30(%rsp)
movaps %xmm1,0x20(%rsp)
movaps %xmm1,0x10(%rsp)
movaps %xmm1,(%rsp)
lea    0xea2(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <sstream_push_cstr@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sstream = type { i32 }
@.str = [3 x i8] c"%f\00"
define void @sstream_push_float(%struct.sstream* %0, float %1) {
%3 = alloca %struct.sstream*
%4 = alloca float
%5 = alloca [128 x i8]
store %struct.sstream* %0, %struct.sstream** %3
store float %1, float* %4
%6 = bitcast [128 x i8]* %5 to i8*
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%8 = load float, float* %4
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %8)
%10 = load %struct.sstream*, %struct.sstream** %3
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%12 = call i32 @sstream_push_cstr(%struct.sstream* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.sstream = type { i32 }
@.str = [3 x i8] c"%f\00"
define void @sstream_push_float(%struct.sstream* %0, float %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %1)
%6 = call i32 @sstream_push_cstr(%struct.sstream* %0, i8* %4)
ret void
}
int(isprint)(int c) { return isprint(c); }


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

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

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

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
ret i32 undef
}
/* Variables and functions */
double abs(int);
double manhattan_distance(int x1, int y1, int x2, int y2) {
  return abs(x1 - x2) + abs(y1 - y2);
}


x86 assembly (clang, -O0):
<manhattan_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x10(%rbp),%edi
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manhattan_distance>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%ebp
sub    %edx,%edi
call   1030 <abs@plt>
movsd  %xmm0,(%rsp)
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <abs@plt>
addsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @manhattan_distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = call double @abs(i32 %11)
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = call double @abs(i32 %15)
%17 = fadd double %12, %16
ret double %17
}

LLVM IR (-O2):
define double @manhattan_distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = tail call double @abs(i32 %5)
%7 = sub nsw i32 %1, %3
%8 = tail call double @abs(i32 %7)
%9 = fadd double %6, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ _test_7(int *, int, int, int);
void soru_7(int dizi[], int N) {
  int EN_COK = -1;
  int EN_COK_TANE = -1;
  _test_7(dizi, N, EN_COK, EN_COK_TANE);
}


x86 assembly (clang, -O0):
<soru_7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <_test_7@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_7>:
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
jmp    1030 <_test_7@plt>

LLVM IR (-O0):
define void @soru_7(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 -1, i32* %5
store i32 -1, i32* %6
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @_test_7(i32* %7, i32 %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @soru_7(i32* %0, i32 %1) {
%3 = tail call i32 @_test_7(i32* %0, i32 %1, i32 -1, i32 -1)
ret void
}
void delete_file(int leader_page_VDA) {}


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

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

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

LLVM IR (-O2):
define void @delete_file(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int /*<<< orphan*/, int);
const char *SMake_VersionShort() {
  static char sVersion[128];
  sprintf(sVersion, "%d.%d.%d", 1, 0, 25);
  return sVersion;
}


x86 assembly (clang, -O0):
<SMake_VersionShort>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x19,%r8d
call   1030 <sprintf@plt>
lea    0x2f05(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SMake_VersionShort>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x19,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@SMake_VersionShort.sVersion = internal global [128 x i8] zeroinitializer
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @SMake_VersionShort() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMake_VersionShort.sVersion, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 25)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMake_VersionShort.sVersion, i64 0, i64 0)
}

LLVM IR (-O2):
@SMake_VersionShort.sVersion = internal global [128 x i8] zeroinitializer
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @SMake_VersionShort() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @SMake_VersionShort.sVersion, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 25)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMake_VersionShort.sVersion, i64 0, i64 0)
}
int calculate_military_score(int military, int morale) {
  return (2048 + (morale >> 1)) * (military << 6);
}


x86 assembly (clang, -O0):
<calculate_military_score>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
add    $0x800,%eax
mov    -0x4(%rbp),%ecx
shl    $0x6,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_military_score>:
shr    %esi
lea    0x800(%rsi),%eax
imul   %edi,%eax
shl    $0x6,%eax
ret

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

LLVM IR (-O2):
define i32 @calculate_military_score(i32 %0, i32 %1) {
%3 = ashr i32 %1, 1
%4 = add nsw i32 %3, 2048
%5 = shl i32 %0, 6
%6 = mul nsw i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage(void) {
  printf("Usage: canopen.cgi?wnniiiissdd=xxxx[&rnniiiissdd=]\n"
         "  - w    - One digit - 'W'rite or 'R'ead.\n"
         "  - nn   - Two hex digits of node ID.\n"
         "  - iiii - Four hex digits of Object Dictionary Index.\n"
         "  - ss   - Two hex digits of Object Dictionary Subindex.\n"
         "  - dd   - One to three digits of data type.\n"
         "  - xxxx - Value to be written.\n"
         "\n"
         "Datatypes:\n"
         "  - b                 - Boolean.\n"
         "  - u8, u16, u32, u64 - Unsigned integers.\n"
         "  - i8, i16, i32, i64 - Signed integers.\n"
         "  - r32, r64          - Real numbers.\n"
         "  - t, td             - Time of day, time difference.\n"
         "  - vs                - Visible string (between double quotes).\n"
         "  - os, us, d         - Octet string, unicode string, domain.");
}


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

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

LLVM IR (-O0):
@.str = [667 x i8] c"Usage: canopen.cgi?wnniiiissdd=xxxx[&rnniiiissdd=]\0A - w - One digit - 'W'rite or 'R'ead.\0A - nn - Two hex digits of node ID.\0A - iiii - Four hex digits of Object Dictionary Index.\0A - ss - Two hex digits of Object Dictionary Subindex.\0A - dd - One to three digits of data type.\0A - xxxx - Value to be written.\0A\0ADatatypes:\0A - b - Boolean.\0A - u8, u16, u32, u64 - Unsigned integers.\0A - i8, i16, i32, i64 - Signed integers.\0A - r32, r64 - Real numbers.\0A - t, td - Time of day, time difference.\0A - vs - Visible string (between double quotes).\0A - os, us, d - Octet string, unicode string, domain.\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([667 x i8], [667 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [667 x i8] c"Usage: canopen.cgi?wnniiiissdd=xxxx[&rnniiiissdd=]\0A - w - One digit - 'W'rite or 'R'ead.\0A - nn - Two hex digits of node ID.\0A - iiii - Four hex digits of Object Dictionary Index.\0A - ss - Two hex digits of Object Dictionary Subindex.\0A - dd - One to three digits of data type.\0A - xxxx - Value to be written.\0A\0ADatatypes:\0A - b - Boolean.\0A - u8, u16, u32, u64 - Unsigned integers.\0A - i8, i16, i32, i64 - Signed integers.\0A - r32, r64 - Real numbers.\0A - t, td - Time of day, time difference.\0A - vs - Visible string (between double quotes).\0A - os, us, d - Octet string, unicode string, domain.\00"
define void @printUsage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([667 x i8], [667 x i8]* @.str, i64 0, i64 0))
ret void
}
int do_computation(int n) {
  long long int i = 0;
  long long int n1 = n * 1000;
  for (i = 0; i < n1; i++)
    ;
}


x86 assembly (clang, -O0):
<do_computation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x8(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1148 <do_computation+0x48>
jmp    1137 <do_computation+0x37>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <do_computation+0x24>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @do_computation(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void defaultAbort() { exit(-1); }


x86 assembly (clang, -O0):
<defaultAbort>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<defaultAbort>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @defaultAbort() {
%1 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @defaultAbort() {
%1 = tail call i32 @exit(i32 -1)
unreachable
}
int devcards_VP(int player) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @devcards_VP(i32 %0) {
ret i32 0
}
void test4_TestExports_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test4_TestExports_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int mus_char_to_uninterpreted_int(const unsigned char *inp) {
  int o;
  unsigned char *outp = (unsigned char *)&o;
  memcpy((void *)outp, (void *)inp, 4);
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_uninterpreted_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_char_to_uninterpreted_int>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mus_char_to_uninterpreted_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i32* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %2
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 4)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @mus_char_to_uninterpreted_int(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void print_free_list() {}


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

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

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

LLVM IR (-O2):
define void @print_free_list() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_fbe();
int /*<<< orphan*/ init_pbe();
int /*<<< orphan*/ init_pee();
void init_mcb() {
  init_fbe();
  init_pbe();
  init_pee();
}


x86 assembly (clang, -O0):
<init_mcb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_fbe@plt>
mov    $0x0,%al
call   1050 <init_pbe@plt>
mov    $0x0,%al
call   1040 <init_pee@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_mcb>:
push   %rax
xor    %eax,%eax
call   1030 <init_fbe@plt>
xor    %eax,%eax
call   1050 <init_pbe@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <init_pee@plt>

LLVM IR (-O0):
define void @init_mcb() {
%1 = call i32 (...) @init_fbe()
%2 = call i32 (...) @init_pbe()
%3 = call i32 (...) @init_pee()
ret void
}

LLVM IR (-O2):
define void @init_mcb() {
%1 = tail call i32 (...) @init_fbe()
%2 = tail call i32 (...) @init_pbe()
%3 = tail call i32 (...) @init_pee()
ret void
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup(int);
int /*<<< orphan*/ dup2(int, int);
int open(char *, int, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int fd;
  fd = open(argv[1], O_CREAT | O_RDWR, 0640);
  dup2(fd, 1);
  close(fd);
  printf("HOLA MUNDO\n");
  dup(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),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
mov    0x2e62(%rip),%rax
or     (%rax),%esi
mov    $0x1a0,%edx
call   1070 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <dup@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
mov    0x2e9c(%rip),%rax
mov    0x2e7d(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1a0,%edx
call   1070 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <dup2@plt>
mov    %ebx,%edi
call   1060 <close@plt>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <dup@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@.str = [12 x i8] c"HOLA MUNDO\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = load i32, i32* @O_CREAT
%11 = load i32, i32* @O_RDWR
%12 = or i32 %10, %11
%13 = call i32 @open(i8* %9, i32 %12, i32 416)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @dup2(i32 %14, i32 1)
%16 = load i32, i32* %6
%17 = call i32 @close(i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @dup(i32 1)
ret i32 0
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@str = [11 x i8] c"HOLA MUNDO\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i32, i32* @O_CREAT
%6 = load i32, i32* @O_RDWR
%7 = or i32 %6, %5
%8 = tail call i32 @open(i8* %4, i32 %7, i32 416)
%9 = tail call i32 @dup2(i32 %8, i32 1)
%10 = tail call i32 @close(i32 %8)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @dup(i32 1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int encode_unsigned24(uint8_t *apdu, uint32_t value) {
  apdu[0] = (uint8_t)((value & 0xff0000) >> 16);
  apdu[1] = (uint8_t)((value & 0x00ff00) >> 8);
  apdu[2] = (uint8_t)(value & 0x0000ff);
  return 3;
}


x86 assembly (clang, -O0):
<encode_unsigned24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_unsigned24>:
mov    %esi,%eax
movzbl %ah,%ecx
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%eax
mov    %rax,(%rdi)
mov    %rcx,0x8(%rdi)
mov    %rdx,0x10(%rdi)
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @encode_unsigned24(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 16711680
%7 = ashr i32 %6, 16
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 0
store i64 %8, i64* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 65280
%13 = ashr i32 %12, 8
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %3
%16 = getelementptr inbounds i64, i64* %15, i64 1
store i64 %14, i64* %16
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = sext i32 %18 to i64
%20 = load i64*, i64** %3
%21 = getelementptr inbounds i64, i64* %20, i64 2
store i64 %19, i64* %21
ret i32 3
}

LLVM IR (-O2):
define i32 @encode_unsigned24(i64* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 255
%5 = zext i32 %4 to i64
store i64 %5, i64* %0
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %8, i64* %9
%10 = and i32 %1, 255
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %11, i64* %12
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void checkpoint() { write(STDERR_FILENO, "CHECK\n", 6); }


x86 assembly (clang, -O0):
<checkpoint>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkpoint>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x6,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
@.str = [7 x i8] c"CHECK\0A\00"
define void @checkpoint() {
%1 = load i32, i32* @STDERR_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
@.str = [7 x i8] c"CHECK\0A\00"
define void @checkpoint() {
%1 = load i32, i32* @STDERR_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void stop_startup(char *errmsg) {
  printf("\n\n **** STARTUP ABORTED ****\n");
  printf("Could not start the system, reason: %s\n", errmsg);
  printf("System will now hang\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<stop_startup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114a <stop_startup+0x3a>

x86 assembly (clang, -O2):
<stop_startup>:
push   %rbx
mov    %rdi,%rbx
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1150 <stop_startup+0x30>

LLVM IR (-O0):
@.str = [30 x i8] c"\0A\0A **** STARTUP ABORTED ****\0A\00"
@.str.1 = [40 x i8] c"Could not start the system, reason: %s\0A\00"
@.str.2 = [22 x i8] c"System will now hang\0A\00"
define void @stop_startup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %7, %1
br label %7
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"Could not start the system, reason: %s\0A\00"
@str = [29 x i8] c"\0A\0A **** STARTUP ABORTED ****\00"
@str.3 = [21 x i8] c"System will now hang\00"
define void @stop_startup(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
br label %5
5: ; preds = %5, %1
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ bf_main(char *, int);
char *malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int main(int argc, char *argv[]) {
  char *b = malloc(4096 * 8);
  memset(b, 0, 4096);
  bf_main(b, 4096);
  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    $0x8000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1000,%esi
call   1040 <bf_main@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8000,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1040 <bf_main@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @malloc(i32 32768)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @memset(i8* %8, i32 0, i32 4096)
%10 = load i8*, i8** %6
%11 = call i32 @bf_main(i8* %10, i32 4096)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(32768) i8* @malloc(i32 32768)
%4 = tail call i32 @memset(i8* %3, i32 0, i32 4096)
%5 = tail call i32 @bf_main(i8* %3, i32 4096)
ret i32 0
}
unsigned int id(unsigned int x) { return x; }


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

x86 assembly (clang, -O2):
<id>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @id(i32 returned %0) {
ret i32 %0
}
int test_imm_60int8_reg(signed char val) {
  return ((val) & (0x60 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_60int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 96
%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_60int8_reg(i8 signext %0) {
%2 = and i8 %0, 96
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_EFint16_mem(short *val) {
  return ((*val) & (-0xEF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EFint16_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, -239
%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_EFint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -239
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_bool(scalar_t__);
scalar_t__ plcvm_lpm_u16();
int plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_b1_cs16(void) {
  plcvm_push(plcvm_get_bool(plcvm_pop() * 32 + plcvm_lpm_u16()));
}


x86 assembly (clang, -O0):
<cb_ldm_b1_cs16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <plcvm_pop@plt>
shl    $0x5,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <plcvm_lpm_u16@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1060 <plcvm_get_bool@plt>
mov    %eax,%edi
call   1050 <plcvm_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_b1_cs16>:
push   %rbx
xor    %eax,%eax
call   1030 <plcvm_pop@plt>
shl    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1040 <plcvm_lpm_u16@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1060 <plcvm_get_bool@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_b1_cs16() {
%1 = call i32 (...) @plcvm_pop()
%2 = mul nsw i32 %1, 32
%3 = sext i32 %2 to i64
%4 = call i64 (...) @plcvm_lpm_u16()
%5 = add nsw i64 %3, %4
%6 = call i32 @plcvm_get_bool(i64 %5)
%7 = call i32 @plcvm_push(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_b1_cs16() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = shl nsw i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i64 (...) @plcvm_lpm_u16()
%5 = add nsw i64 %4, %3
%6 = tail call i32 @plcvm_get_bool(i64 %5)
%7 = tail call i32 @plcvm_push(i32 %6)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t even_parity(uint32_t x) {
  x ^= x >> 16;
  x ^= x >> 8;
  x ^= x >> 4;
  x &= 0xf;
  return (0x6996 >> x) & 1;
}


x86 assembly (clang, -O0):
<even_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x6996,%eax
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<even_parity>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
mov    %eax,%edx
sar    $0x8,%edx
xor    %eax,%edx
mov    %edx,%ecx
shr    $0x4,%ecx
xor    %edx,%ecx
and    $0xf,%cl
mov    $0x6996,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @even_parity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = and i32 %15, 15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 27030, %17
%19 = and i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
define i32 @even_parity(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = ashr i32 %3, 8
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = and i32 %7, 15
%9 = lshr i32 27030, %8
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void print_GPL() {
  printf("\n");
  puts("lsa:  Copyright (C) 2016  Tino Gfroerer");
  puts("This program comes with ABSOLUTELY NO WARRANTY;"
       " for details use `./lsa -w'.");
  puts("This is free software, and you are welcome to "
       "redistribute it under certain conditions;"
       " type `./lsa -c' for details.");
  printf("\n");
}


x86 assembly (clang, -O0):
<print_GPL>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_GPL>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xeea(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [40 x i8] c"lsa: Copyright (C) 2016 Tino Gfroerer\00"
@.str.2 = [76 x i8] c"This program comes with ABSOLUTELY NO WARRANTY; for details use `./lsa -w'.\00"
@.str.3 = [117 x i8] c"This is free software, and you are welcome to redistribute it under certain conditions; type `./lsa -c' for details.\00"
define void @print_GPL() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"lsa: Copyright (C) 2016 Tino Gfroerer\00"
@.str.2 = [76 x i8] c"This program comes with ABSOLUTELY NO WARRANTY; for details use `./lsa -w'.\00"
@.str.3 = [117 x i8] c"This is free software, and you are welcome to redistribute it under certain conditions; type `./lsa -c' for details.\00"
define void @print_GPL() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
unsigned hash_add(void *key) {
  register unsigned char *name = (unsigned char *)key;
  unsigned h;
  for (h = 0; *name; h += *name++)
    ;
  return h;
}


x86 assembly (clang, -O0):
<hash_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <hash_add+0x46>
jmp    1129 <hash_add+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <hash_add+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_add>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <hash_add+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_add+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_add(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i32
%10 = add i32 %6, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %14
}
/* Variables and functions */
double sqrt(float);
float MetricViscosity(const float theta) {
  float t = theta * 288.15;
  return 1.458E-6 * sqrt(t * t * t) / (t + 110.4);
}


x86 assembly (clang, -O0):
<MetricViscosity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe91(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MetricViscosity>:
push   %rax
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movaps %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
call   1030 <sqrt@plt>
mulsd  0xec9(%rip),%xmm0
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @MetricViscosity(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double %5, 2.881500e+02
%7 = fptrunc double %6 to float
store float %7, float* %3
%8 = load float, float* %3
%9 = load float, float* %3
%10 = fmul float %8, %9
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = call double @sqrt(float %12)
%14 = fmul double 1.458000e-06, %13
%15 = load float, float* %3
%16 = fpext float %15 to double
%17 = fadd double %16, 1.104000e+02
%18 = fdiv double %14, %17
%19 = fptrunc double %18 to float
ret float %19
}

LLVM IR (-O2):
define float @MetricViscosity(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 2.881500e+02
%4 = fptrunc double %3 to float
%5 = fmul float %4, %4
%6 = fmul float %5, %4
%7 = tail call double @sqrt(float %6)
%8 = fmul double %7, 1.458000e-06
%9 = fpext float %4 to double
%10 = fadd double %9, 1.104000e+02
%11 = fdiv double %8, %10
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int /*<<< orphan*/ f(int volatile *, int volatile *);
int main() {
  volatile int x;
  volatile int y;
  f(&x, &y);
  __CRAB_assert(x >= 1);
  __CRAB_assert(x <= 2);
  __CRAB_assert(y == 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <f@plt>
mov    -0x8(%rbp),%eax
cmp    $0x1,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
mov    -0x8(%rbp),%eax
cmp    $0x2,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
mov    -0xc(%rbp),%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1030 <f@plt>
xor    %edi,%edi
cmpl   $0x0,(%rsp)
setg   %dil
call   1040 <__CRAB_assert@plt>
mov    (%rsp),%eax
xor    %edi,%edi
cmp    $0x3,%eax
setl   %dil
call   1040 <__CRAB_assert@plt>
mov    0x4(%rsp),%eax
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <__CRAB_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @f(i32* %2, i32* %3)
%5 = load volatile i32, i32* %2
%6 = icmp sge i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @__CRAB_assert(i32 %7)
%9 = load volatile i32, i32* %2
%10 = icmp sle i32 %9, 2
%11 = zext i1 %10 to i32
%12 = call i32 @__CRAB_assert(i32 %11)
%13 = load volatile i32, i32* %3
%14 = icmp eq i32 %13, 2
%15 = zext i1 %14 to i32
%16 = call i32 @__CRAB_assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @f(i32* %1, i32* %2)
%6 = load volatile i32, i32* %1
%7 = icmp sgt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @__CRAB_assert(i32 %8)
%10 = load volatile i32, i32* %1
%11 = icmp slt i32 %10, 3
%12 = zext i1 %11 to i32
%13 = call i32 @__CRAB_assert(i32 %12)
%14 = load volatile i32, i32* %2
%15 = icmp eq i32 %14, 2
%16 = zext i1 %15 to i32
%17 = call i32 @__CRAB_assert(i32 %16)
ret i32 0
}