xunge/DecIR huggingface dataset:
/* Variables and functions */
char *modifyServerUrl(char *, char *);
char *getLatencyUrl(char *serverUrl) {
  return modifyServerUrl(serverUrl, "latency.txt");
}


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

x86 assembly (clang, -O2):
<getLatencyUrl>:
lea    0xee9(%rip),%rsi
jmp    1030 <modifyServerUrl@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"latency.txt\00"
define i8* @getLatencyUrl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @modifyServerUrl(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"latency.txt\00"
define i8* @getLatencyUrl(i8* %0) {
%2 = tail call i8* @modifyServerUrl(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int io_send_break(fd)
int fd;
{
  int res;
  res = tcsendbreak(fd, 0);
  return res;
}


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

x86 assembly (clang, -O2):
<io_send_break>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <tcsendbreak@plt>

LLVM IR (-O0):
define i32 @io_send_break(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @tcsendbreak to i32 (i32, i32, ...)*)(i32 %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @io_send_break(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @tcsendbreak to i32 (i32, i32, ...)*)(i32 %0, i32 0)
ret i32 %2
}
unsigned getl16(const unsigned char *buf) { return (buf[1] << 8) | buf[0]; }


x86 assembly (clang, -O0):
<getl16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getl16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @getl16(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_set_channel_map() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_set_channel_map"
         "\n");
}


x86 assembly (clang, -O0):
<pa_format_info_set_channel_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [48 x i8] c"NOT IMPLEMENTED:pa_format_info_set_channel_map\0A\00"
define i32 @pa_format_info_set_channel_map() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [47 x i8] c"NOT IMPLEMENTED:pa_format_info_set_channel_map\00"
define i32 @pa_format_info_set_channel_map() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *pname) { fprintf(stderr, "usage: %s <host> <port>\n", pname); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"usage: %s <host> <port>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"usage: %s <host> <port>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uartputc(int);
void putch(int ch, int *cnt) {
  uartputc(ch);
  *cnt++;
}


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

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

LLVM IR (-O0):
define void @putch(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = call i32 @uartputc(i32 %5)
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %4
%9 = load i32, i32* %7
ret void
}

LLVM IR (-O2):
define void @putch(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @uartputc(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int head_stream(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ perror(char *);
int head_file(char *path, int lines) {
  FILE *stream = fopen(path, "r");
  if (stream == NULL) {
    perror(path);
    return 1;
  }
  return head_stream(stream, lines);
}


x86 assembly (clang, -O0):
<head_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <head_file+0x43>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1182 <head_file+0x52>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <head_stream@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<head_file>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec1(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     1159 <head_file+0x29>
mov    %rax,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <head_stream@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @head_file(i8* nocapture %0, i32 %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @head_stream(i32* %3, i32 %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ 1, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_sha1nexte_epu32(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i __attribute__((__target__("sha")))
mm_sha1nexte_epu32_wrap(__m128i x, __m128i y) {
  return _mm_sha1nexte_epu32(x, y);
}


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

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

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

LLVM IR (-O2):
define i32 @mm_sha1nexte_epu32_wrap(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sha1nexte_epu32(i32 %0, i32 %1)
ret i32 %3
}
void INT_Excep_SCI11_RXI11(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI11_RXI11() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_array(char **);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ shift_array(char *);
int main(void) {
  char array[2][4] = {{'a', 'b', 'c', '\0'}, {'1', '2', '3', '\0'}};
  print_array(array);
  putchar('\n');
  shift_array(array[0]);
  print_array(array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0xc(%rbp),%rdi
call   1050 <shift_array@plt>
lea    -0xc(%rbp),%rdi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x33323100636261,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1050 <shift_array@plt>
mov    %rbx,%rdi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [2 x [4 x i8]] [[4 x i8] c"abc\00", [4 x i8] c"123\00"]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [4 x i8]]
store i32 0, i32* %1
%3 = bitcast [2 x [4 x i8]]* %2 to i8*
%4 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %2, i64 0, i64 0
%5 = bitcast [4 x i8]* %4 to i8**
%6 = call i32 @print_array(i8** %5)
%7 = call i32 @putchar(i8 signext 10)
%8 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%10 = call i32 @shift_array(i8* %9)
%11 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %2, i64 0, i64 0
%12 = bitcast [4 x i8]* %11 to i8**
%13 = call i32 @print_array(i8** %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 14410409853543009, i64* %1
%3 = bitcast i64* %1 to i8**
%4 = call i32 @print_array(i8** %3)
%5 = call i32 @putchar(i8 signext 10)
%6 = call i32 @shift_array(i8* %2)
%7 = call i32 @print_array(i8** %3)
ret i32 0
}
float remainingAngle(const float angleA, const float angleB) {
  return 180 - (angleA + angleB);
}


x86 assembly (clang, -O0):
<remainingAngle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
movss  0xee0(%rip),%xmm0
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainingAngle>:
addss  %xmm1,%xmm0
movss  0xef4(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @remainingAngle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
%8 = fsub float 1.800000e+02, %7
ret float %8
}

LLVM IR (-O2):
define float @remainingAngle(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fsub float 1.800000e+02, %3
ret float %4
}
/* Type definitions */
struct mat4 {
  int dummy;
};
struct mat3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat3_assign_mat4(float *, float *);
__attribute__((always_)) struct mat3 *psmat3_assign_mat4(struct mat3 *result,
                                                         struct mat4 *m) {
  mat3_assign_mat4((float *)result, (float *)m);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat3_assign_mat4>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat3_assign_mat4@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat3 = type { i32 }
%struct.mat4 = type { i32 }
define %struct.mat3* @psmat3_assign_mat4(%struct.mat3* %0, %struct.mat4* %1) {
%3 = alloca %struct.mat3*
%4 = alloca %struct.mat4*
store %struct.mat3* %0, %struct.mat3** %3
store %struct.mat4* %1, %struct.mat4** %4
%5 = load %struct.mat3*, %struct.mat3** %3
%6 = bitcast %struct.mat3* %5 to float*
%7 = load %struct.mat4*, %struct.mat4** %4
%8 = bitcast %struct.mat4* %7 to float*
%9 = call i32 @mat3_assign_mat4(float* %6, float* %8)
%10 = load %struct.mat3*, %struct.mat3** %3
ret %struct.mat3* %10
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
%struct.mat4 = type { i32 }
define %struct.mat3* @psmat3_assign_mat4(%struct.mat3* returned %0, %struct.mat4* %1) {
%3 = bitcast %struct.mat3* %0 to float*
%4 = bitcast %struct.mat4* %1 to float*
%5 = tail call i32 @mat3_assign_mat4(float* %3, float* %4)
ret %struct.mat3* %0
}
/* Type definitions */
struct field {
  int dummy;
};

/* Variables and functions */
int __update_bin_delim(struct field *, char *, char);
int update_mac(struct field *field, char *value) {
  return __update_bin_delim(field, value, ':');
}


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

x86 assembly (clang, -O2):
<update_mac>:
mov    $0x3a,%edx
jmp    1030 <__update_bin_delim@plt>

LLVM IR (-O0):
%struct.field = type { i32 }
define i32 @update_mac(%struct.field* %0, i8* %1) {
%3 = alloca %struct.field*
%4 = alloca i8*
store %struct.field* %0, %struct.field** %3
store i8* %1, i8** %4
%5 = load %struct.field*, %struct.field** %3
%6 = load i8*, i8** %4
%7 = call i32 @__update_bin_delim(%struct.field* %5, i8* %6, i8 signext 58)
ret i32 %7
}

LLVM IR (-O2):
%struct.field = type { i32 }
define i32 @update_mac(%struct.field* %0, i8* %1) {
%3 = tail call i32 @__update_bin_delim(%struct.field* %0, i8* %1, i8 signext 58)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int le_to_u32(int /*<<< orphan*/ const *);
int32_t le_to_i32(const uint8_t *buf) {
  uint32_t v = le_to_u32(buf);
  return v < 0x80000000U ? (int32_t)v : -((int32_t)(0xffffffffU - v)) - 1;
}


x86 assembly (clang, -O0):
<le_to_i32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <le_to_u32@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x80000000,-0xc(%rbp)
jae    1140 <le_to_i32+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <le_to_i32+0x42>
mov    $0xffffffff,%ecx
sub    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @le_to_i32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @le_to_u32(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ult i32 %6, -2147483648
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub i32 -1, %11
%13 = sub nsw i32 0, %12
%14 = sub nsw i32 %13, 1
br label %15
15: ; preds = %10, %8
%16 = phi i32 [ %9, %8 ], [ %14, %10 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @le_to_i32(i32* %0) {
%2 = tail call i32 @le_to_u32(i32* %0)
ret i32 %2
}
/* Variables and functions */
int combination(int, int);
int uniquePaths2(int m, int n) { return combination(m + n - 2, m - 1); }


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

x86 assembly (clang, -O2):
<uniquePaths2>:
lea    (%rdi,%rsi,1),%eax
add    $0xfffffffe,%eax
lea    -0x1(%rdi),%esi
mov    %eax,%edi
jmp    1030 <combination@plt>

LLVM IR (-O0):
define i32 @uniquePaths2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 2
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i32 @combination(i32 %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @uniquePaths2(i32 %0, i32 %1) {
%3 = add i32 %0, -2
%4 = add i32 %3, %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @combination(i32 %4, i32 %5)
ret i32 %6
}
int oct_to_val(char c) { return (c - '0') & 0x7; }


x86 assembly (clang, -O0):
<oct_to_val>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oct_to_val>:
mov    %edi,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @oct_to_val(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
%6 = and i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @oct_to_val(i8 signext %0) {
%2 = and i8 %0, 7
%3 = zext i8 %2 to i32
ret i32 %3
}
int main() {
  int a, b, c;
  c = a / b;
  c = a & b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
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
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sdiv i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = and i32 %8, %9
store i32 %10, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(10 < 11);
  assert(10 == 10);
  assert(10 > 11);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @assert(i32 1)
%2 = call i32 @assert(i32 1)
%3 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ swap(int, int);
void main() {
  int a, b;
  printf("Enter any two numbers: ");
  scanf("%d %d", &a, &b);
  printf("\nValue before swap, a: %d, b: %d", a, b);
  swap(a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <swap@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter any two numbers: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [33 x i8] c"\0AValue before swap, a: %d, b: %d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @swap(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter any two numbers: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [33 x i8] c"\0AValue before swap, a: %d, b: %d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @swap(i32 %10, i32 %11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int format_parser(int, char const *, int /*<<< orphan*/, char *, size_t);
int vsnprintf(char *output_buf, size_t max_char, const char *format,
              va_list args) {
  return format_parser(1, format, args, output_buf, max_char);
}


x86 assembly (clang, -O0):
<vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x1,%edi
call   1030 <format_parser@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf>:
mov    %rsi,%r8
mov    %rdi,%rax
mov    $0x1,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %rax,%rcx
jmp    1030 <format_parser@plt>

LLVM IR (-O0):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i32, i32* %8
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @format_parser(i32 1, i8* %9, i32 %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @format_parser(i32 1, i8* %2, i32 %3, i8* %0, i64 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
__attribute__((always_)) void tu_setcur(int is_show) {
  fputs(is_show ? "\x1b[>5l" : "\x1b[>5h", stdout);
}


x86 assembly (clang, -O0):
<tu_setcur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xee1(%rip),%rdi
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tu_setcur>:
test   %edi,%edi
lea    0xeed(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[>5l\00"
@.str.1 = [6 x i8] c"\1B[>5h\00"
@stdout = global i32 0
define void @tu_setcur(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[>5l\00"
@.str.1 = [6 x i8] c"\1B[>5h\00"
@stdout = global i32 0
define void @tu_setcur(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* %3, i32 %4)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int __libc_nanosleep(struct timespec const *, struct timespec *);
int /*<<< orphan*/ pthread_testcancel();
int nanosleep(const struct timespec *req, struct timespec *rem) {
  pthread_testcancel();
  return __libc_nanosleep(req, rem);
}


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

x86 assembly (clang, -O2):
<nanosleep>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_testcancel@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__libc_nanosleep@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = call i32 (...) @pthread_testcancel()
%6 = load %struct.timespec*, %struct.timespec** %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @__libc_nanosleep(%struct.timespec* %6, %struct.timespec* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i32 (...) @pthread_testcancel()
%4 = tail call i32 @__libc_nanosleep(%struct.timespec* %0, %struct.timespec* %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
size_t list_meter_uint16_t(const void *el) { return sizeof(uint16_t); }


x86 assembly (clang, -O0):
<list_meter_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @list_meter_uint16_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 4
}

LLVM IR (-O2):
define i64 @list_meter_uint16_t(i8* nocapture readnone %0) {
ret i64 4
}
int divideByTen(int x) {
  if (x > 0) {
    int tenValue = 10;
    return x / tenValue;
  }
  return x;
}


x86 assembly (clang, -O0):
<divideByTen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1127 <divideByTen+0x27>
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
jmp    112d <divideByTen+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divideByTen>:
mov    %edi,%eax
test   %edi,%edi
jle    111c <divideByTen+0x1c>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @divideByTen(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = sdiv i32 %0, 10
%4 = select i1 %2, i32 %3, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ move(int, scalar_t__);
int /*<<< orphan*/ printw(char *);
void printbottominstructions() {
  move(17, (0 + 31));
  printw("|Replace # with the number of the");
  move(17 + 1, (0 + 31));
  printw("|tableau you want.               ");
  move(17 + 2, (0 + 31));
  printw("*--------------------------------");
}


x86 assembly (clang, -O0):
<printbottominstructions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
mov    $0x1f,%esi
call   1040 <move@plt>
lea    0xec6(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x1f,%esi
call   1040 <move@plt>
lea    0xecd(%rip),%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x1f,%esi
call   1040 <move@plt>
lea    0xed4(%rip),%rdi
call   1030 <printw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printbottominstructions>:
push   %rax
mov    $0x1f,%esi
mov    $0x11,%edi
call   1040 <move@plt>
lea    0xec9(%rip),%rdi
call   1030 <printw@plt>
mov    $0x1f,%esi
mov    $0x12,%edi
call   1040 <move@plt>
lea    0xed0(%rip),%rdi
call   1030 <printw@plt>
mov    $0x1f,%esi
mov    $0x13,%edi
call   1040 <move@plt>
lea    0xed7(%rip),%rdi
pop    %rax
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"|Replace # with the number of the\00"
@.str.1 = [34 x i8] c"|tableau you want. \00"
@.str.2 = [34 x i8] c"*--------------------------------\00"
define void @printbottominstructions() {
%1 = call i32 @move(i32 17, i64 31)
%2 = call i32 @printw(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @move(i32 18, i64 31)
%4 = call i32 @printw(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @move(i32 19, i64 31)
%6 = call i32 @printw(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"|Replace # with the number of the\00"
@.str.1 = [34 x i8] c"|tableau you want. \00"
@.str.2 = [34 x i8] c"*--------------------------------\00"
define void @printbottominstructions() {
%1 = tail call i32 @move(i32 17, i64 31)
%2 = tail call i32 @printw(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @move(i32 18, i64 31)
%4 = tail call i32 @printw(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @move(i32 19, i64 31)
%6 = tail call i32 @printw(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void solveSmall() {
  int marked[5][5];
  int i, j;
  for (i = 0; i < 5; i++) {
    for (j = 0; j < 5; j++)
      marked[i][j] = 0;
  }
}


x86 assembly (clang, -O0):
<solveSmall>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x74(%rbp)
cmpl   $0x5,-0x74(%rbp)
jge    1161 <solveSmall+0x61>
movl   $0x0,-0x78(%rbp)
cmpl   $0x5,-0x78(%rbp)
jge    114e <solveSmall+0x4e>
movslq -0x74(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x78(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    111c <solveSmall+0x1c>
jmp    1153 <solveSmall+0x53>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    110b <solveSmall+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @solveSmall() {
ret void
}
int greater_than(unsigned int x, unsigned int y) { return (x > y); }


x86 assembly (clang, -O0):
<greater_than>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater_than>:
xor    %eax,%eax
cmp    %esi,%edi
seta   %al
ret

LLVM IR (-O0):
define i32 @greater_than(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ugt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @greater_than(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit_test(char *);
void test326() { exit_test("test326"); }


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

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

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

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

/* Variables and functions */
unsigned long CLOCKS_PER_SEC;
unsigned long msElapsed(clock_t start, clock_t end) {
  unsigned long temp = (end - start * 1000);
  return temp / CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<msElapsed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x3e8,-0x4(%rbp),%ecx
sub    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec1(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<msElapsed>:
imul   $0xfffffc18,%edi,%eax
add    %esi,%eax
movslq %eax,%rcx
mov    0x2ed6(%rip),%rdx
mov    (%rdx),%rsi
mov    %rcx,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     112a <msElapsed+0x2a>
mov    %rcx,%rax
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define i64 @msElapsed(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 1000
%9 = sub nsw i32 %6, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load i64, i64* @CLOCKS_PER_SEC
%13 = udiv i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define i64 @msElapsed(i32 %0, i32 %1) {
%3 = mul i32 %0, -1000
%4 = add i32 %3, %1
%5 = sext i32 %4 to i64
%6 = load i64, i64* @CLOCKS_PER_SEC
%7 = udiv i64 %5, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ EMLINK;
int /*<<< orphan*/ errno;
int _link(char *old, char *new) {
  old = old;
  new = new;
  errno = EMLINK;
  return -1;
}


x86 assembly (clang, -O0):
<_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%ecx
mov    0x2eac(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_link>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EMLINK = global i32 0
@errno = global i32 0
define i32 @_link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EMLINK
store i32 %3, i32* @errno
ret i32 -1
}
char *imalloc(n) const int n;
{ return malloc((unsigned int)(((n) == 0) ? 1 : (n))); }


x86 assembly (clang, -O0):
<imalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1132 <imalloc+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <imalloc+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%eax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imalloc>:
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @imalloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 1, %5 ], [ %7, %6 ]
%10 = zext i32 %9 to i64
%11 = call i8* @malloc(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @imalloc(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = zext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
ret i8* %5
}
void setup_pins() {
  (*((volatile unsigned long *)0xE0028008)) =
      ((1 << 12) | (1 << 4) | (1 << 6) | (1 << 21) | (1 << 22) | (1 << 23) |
       (1 << 13) | (1 << 19) | (1 << 20) | (1 << 8) | (1 << 10));
  (*((volatile unsigned long *)0xE0028004)) =
      ((1 << 21) | (1 << 22) | (1 << 23) | (1 << 8));
}


x86 assembly (clang, -O0):
<setup_pins>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0028008,%eax
movq   $0xf83550,(%rax)
mov    $0xe0028004,%eax
movq   $0xe00100,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_pins>:
mov    $0xe0028004,%eax
movq   $0xf83550,0x4(%rax)
movq   $0xe00100,(%rax)
ret

LLVM IR (-O0):
define void @setup_pins() {
store volatile i64 16266576, i64* inttoptr (i64 3758260232 to i64*)
store volatile i64 14680320, i64* inttoptr (i64 3758260228 to i64*)
ret void
}

LLVM IR (-O2):
define void @setup_pins() {
store volatile i64 16266576, i64* inttoptr (i64 3758260232 to i64*)
store volatile i64 14680320, i64* inttoptr (i64 3758260228 to i64*)
ret void
}
int diag_l0_vwtool_getflags(struct diag_l0_device *dl0d
                            __attribute__((unused))) {
  return (0x01 | 0x02 | 0x08 | 0x10);
}


x86 assembly (clang, -O0):
<diag_l0_vwtool_getflags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1b,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.diag_l0_device = type opaque
define i32 @diag_l0_vwtool_getflags(%struct.diag_l0_device* %0) {
%2 = alloca %struct.diag_l0_device*
store %struct.diag_l0_device* %0, %struct.diag_l0_device** %2
ret i32 27
}

LLVM IR (-O2):
%struct.diag_l0_device = type opaque
define i32 @diag_l0_vwtool_getflags(%struct.diag_l0_device* nocapture readnone %0) {
ret i32 27
}
float test5f(float x) { return __builtin_logf(x); }


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

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

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

LLVM IR (-O2):
define float @test5f(float %0) {
%2 = tail call float @logf(float %0)
ret float %2
}
void asn1_do_adb(void) {}


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

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

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

LLVM IR (-O2):
define void @asn1_do_adb() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char);
int /*<<< orphan*/ stderr;
void pgp_usage(char _key, char *_keyvalue) {
  fprintf(stderr, "Unknown value \"%s\" of key \"%c\"\n", _keyvalue, _key);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<pgp_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rsi
movsbl -0x1(%rbp),%ecx
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pgp_usage>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%ecx
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Unknown value \22%s\22 of key \22%c\22\0A\00"
@EX_USAGE = global i32 0
define void @pgp_usage(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = load i8, i8* %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %6, i8 signext %7)
%9 = load i32, i32* @EX_USAGE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Unknown value \22%s\22 of key \22%c\22\0A\00"
@EX_USAGE = global i32 0
define void @pgp_usage(i8 signext %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1, i8 signext %0)
%5 = load i32, i32* @EX_USAGE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Term_gotoxy(int, int);
void move_cursor(int row, int col) { Term_gotoxy(col, row); }


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

x86 assembly (clang, -O2):
<move_cursor>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <Term_gotoxy@plt>

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

LLVM IR (-O2):
define void @move_cursor(i32 %0, i32 %1) {
%3 = tail call i32 @Term_gotoxy(i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int const);
void matrix_clear(double *C, const int M, const int N) {
  memset(C, 0, M * N * sizeof(double));
}


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

x86 assembly (clang, -O2):
<matrix_clear>:
imul   %esi,%edx
shl    $0x3,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @matrix_clear(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 8
%13 = trunc i64 %12 to i32
%14 = call i32 @memset(double* %7, i32 0, i32 %13)
ret void
}

LLVM IR (-O2):
define void @matrix_clear(double* %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 3
%5 = mul i32 %4, %2
%6 = tail call i32 @memset(double* %0, i32 0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal_encoding(char *lang) {
  fprintf(stderr,
          "Encoding %s is not supported.\n"
          "Use UTF-8, KOI8-R, CP1251 or CP866.\n",
          lang);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal_encoding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal_encoding>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"Encoding %s is not supported.\0AUse UTF-8, KOI8-R, CP1251 or CP866.\0A\00"
define void @fatal_encoding(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"Encoding %s is not supported.\0AUse UTF-8, KOI8-R, CP1251 or CP866.\0A\00"
define void @fatal_encoding(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void scrn_printf(int16_t r, int16_t c, const char *fmt, ...) {}


x86 assembly (clang, -O0):
<scrn_printf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @scrn_printf(i32 %0, i32 %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @scrn_printf(i32 %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
void INT_Excep_IRQ11(void) {}


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

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

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

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