xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_banner() {
  printf("\n");
  printf(" !======================================================!\n");
  printf(" !           Welcome to program CVIB                    !\n");
  printf(" !             Program version 0.2                      !\n");
  printf(" !======================================================!\n");
}


x86 assembly (clang, -O0):
<print_banner>:
push   %rbp
mov    %rsp,%rbp
lea    0xf94(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
call   1030 <printf@plt>
lea    0xf37(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_banner>:
push   %rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf42(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
lea    0xeed(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [59 x i8] c" !======================================================!\0A\00"
@.str.2 = [59 x i8] c" ! Welcome to program CVIB !\0A\00"
@.str.3 = [59 x i8] c" ! Program version 0.2 !\0A\00"
define void @print_banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.4 = [58 x i8] c" ! Welcome to program CVIB !\00"
@str.5 = [58 x i8] c" ! Program version 0.2 !\00"
@str.6 = [58 x i8] c" !======================================================!\00"
define void @print_banner() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.6, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t smpte_fec_get_na(const uint8_t *p_fec) { return p_fec[14]; }


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

x86 assembly (clang, -O2):
<smpte_fec_get_na>:
mov    0x38(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @smpte_fec_get_na(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 14
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @smpte_fec_get_na(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 14
%3 = load i32, i32* %2
ret i32 %3
}
char *logger_string_findFirstOccurenceOfChar(const char *str,
                                             const char searchChar) {
  while ((*str != '\0') && ((char)*str != searchChar)) {
    str += 1U;
  }
  return (char *)str;
}


x86 assembly (clang, -O0):
<logger_string_findFirstOccurenceOfChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1136 <logger_string_findFirstOccurenceOfChar+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1146 <logger_string_findFirstOccurenceOfChar+0x46>
jmp    1157 <logger_string_findFirstOccurenceOfChar+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <logger_string_findFirstOccurenceOfChar+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_string_findFirstOccurenceOfChar>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <logger_string_findFirstOccurenceOfChar+0x21>
cmp    %sil,%cl
jne    1110 <logger_string_findFirstOccurenceOfChar+0x10>
ret

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

LLVM IR (-O2):
define i8* @logger_string_findFirstOccurenceOfChar(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %4
}
trace_stack(a, b) int a;
int b;
{ return 1; }


x86 assembly (clang, -O0):
<trace_stack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @trace_stack(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @trace_stack(i32 %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void poststring(char *s) { fprintf(stderr, " %s", s); }


x86 assembly (clang, -O0):
<poststring>:
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):
<poststring>:
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 = [4 x i8] c" %s\00"
define void @poststring(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c" %s\00"
define void @poststring(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void ble_rsp_test_debug(const struct ble_msg_test_debug_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_test_debug_rsp_t = type opaque
define void @ble_rsp_test_debug(%struct.ble_msg_test_debug_rsp_t* %0) {
%2 = alloca %struct.ble_msg_test_debug_rsp_t*
store %struct.ble_msg_test_debug_rsp_t* %0, %struct.ble_msg_test_debug_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_test_debug_rsp_t = type opaque
define void @ble_rsp_test_debug(%struct.ble_msg_test_debug_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *name) {
  fprintf(stderr,
          "Usage:\n"
          "  %s <filename>\n"
          "  f.ex. %s /sys/kernel/debug/scsi_host_sniffer0\n",
          name, name);
  return 1;
}


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
mov    -0x8(%rbp),%rcx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rcx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    %rcx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"Usage:\0A %s <filename>\0A f.ex. %s /sys/kernel/debug/scsi_host_sniffer0\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"Usage:\0A %s <filename>\0A f.ex. %s /sys/kernel/debug/scsi_host_sniffer0\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ui_field_navigate_right();
void switch_s2_right(const uint32_t repeat_count) {
  (void)repeat_count;
  ui_field_navigate_right();
}


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

x86 assembly (clang, -O2):
<switch_s2_right>:
xor    %eax,%eax
jmp    1030 <ui_field_navigate_right@plt>

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

LLVM IR (-O2):
define void @switch_s2_right(i32 %0) {
%2 = tail call i32 (...) @ui_field_navigate_right()
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void config_sdram_x(void) {
  *(uint32_t *)(0x4C000010) = (uint32_t)(0x2800);
  *(uint32_t *)(0x4C0000C8) = (uint32_t)(0x50074BE4);
  *(uint32_t *)(0x44E10110) = (uint32_t)(0x61C05332);
  *(uint32_t *)(0x4C000008) = (uint32_t)(0x61C05332);
  *(uint32_t *)(0x4C000010) = (uint32_t)(0x00000C30);
  *(uint32_t *)(0x4C000014) = (uint32_t)(0x00000C30);
  *(uint32_t *)(0x4C000010) = (uint32_t)(0x00000C30);
  *(uint32_t *)(0x4C000014) = (uint32_t)(0x00000C30);
  *(uint32_t *)(0x4C000008) = (uint32_t)(0x61C05332);
}


x86 assembly (clang, -O0):
<config_sdram_x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4c000010,%eax
movq   $0x2800,(%rax)
mov    $0x4c0000c8,%eax
movq   $0x50074be4,(%rax)
mov    $0x44e10110,%eax
movq   $0x61c05332,(%rax)
mov    $0x4c000008,%eax
movq   $0x61c05332,(%rax)
mov    $0x4c000010,%eax
movq   $0xc30,(%rax)
mov    $0x4c000014,%eax
movq   $0xc30,(%rax)
mov    $0x4c000010,%eax
movq   $0xc30,(%rax)
mov    $0x4c000014,%eax
movq   $0xc30,(%rax)
mov    $0x4c000008,%eax
movq   $0x61c05332,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_sdram_x>:
movq   $0x50074be4,0x4c0000c8
4c e4 4b 07 50
movq   $0x61c05332,0x44e10110
44 32 53 c0 61
movq   $0xc30,0x4c000010
movq   $0xc30,0x4c000014
movq   $0x61c05332,0x4c000008
4c 32 53 c0 61
ret

LLVM IR (-O0):
define void @config_sdram_x() {
store i64 10240, i64* inttoptr (i64 1275068432 to i64*)
store i64 1342655460, i64* inttoptr (i64 1275068616 to i64*)
store i64 1639994162, i64* inttoptr (i64 1155596560 to i64*)
store i64 1639994162, i64* inttoptr (i64 1275068424 to i64*)
store i64 3120, i64* inttoptr (i64 1275068432 to i64*)
store i64 3120, i64* inttoptr (i64 1275068436 to i64*)
store i64 3120, i64* inttoptr (i64 1275068432 to i64*)
store i64 3120, i64* inttoptr (i64 1275068436 to i64*)
store i64 1639994162, i64* inttoptr (i64 1275068424 to i64*)
ret void
}

LLVM IR (-O2):
define void @config_sdram_x() {
store i64 1342655460, i64* inttoptr (i64 1275068616 to i64*)
store i64 1639994162, i64* inttoptr (i64 1155596560 to i64*)
store i64 3120, i64* inttoptr (i64 1275068432 to i64*)
store i64 3120, i64* inttoptr (i64 1275068436 to i64*)
store i64 1639994162, i64* inttoptr (i64 1275068424 to i64*)
ret void
}
void _infix_operator_plus_u8_u8(unsigned char lhs, unsigned char rhs,
                                unsigned char *__rval_1) {
  *__rval_1 = lhs + rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_plus_u8_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_plus_u8_u8>:
add    %dil,%sil
mov    %sil,(%rdx)
ret

LLVM IR (-O0):
define void @_infix_operator_plus_u8_u8(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = add nsw i32 %8, %10
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %6
store i8 %12, i8* %13
ret void
}

LLVM IR (-O2):
define void @_infix_operator_plus_u8_u8(i8 zeroext %0, i8 zeroext %1, i8* nocapture writeonly %2) {
%4 = add i8 %1, %0
store i8 %4, i8* %2
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double convert_time_to_sec(struct timespec tv) {
  double elapsed_time =
      ((double)(tv.tv_sec)) + (((double)(tv.tv_nsec)) / 1.0e9);
  return elapsed_time;
}


x86 assembly (clang, -O0):
<convert_time_to_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_time_to_sec>:
cvtsi2sd %rsi,%xmm1
cvtsi2sd %rdi,%xmm0
divsd  0xeee(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @convert_time_to_sec(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = alloca double
%5 = bitcast %struct.timespec* %3 to { i64, i64 }*
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 0
store i64 %0, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+09
%15 = fadd double %10, %14
store double %15, double* %4
%16 = load double, double* %4
ret double %16
}

LLVM IR (-O2):
define double @convert_time_to_sec(i64 %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = sitofp i64 %0 to double
%5 = fdiv double %4, 1.000000e+09
%6 = fadd double %5, %3
ret double %6
}
int mvpstb_set_audio_sync(int on) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mvpstb_set_audio_sync(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCTerminate() {
  long int stat = 99;
  BNCIO(28);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCTerminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x1c,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCTerminate>:
push   %rax
mov    $0x1c,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCTerminate() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 28)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCTerminate() {
%1 = tail call i32 @BNCIO(i32 28)
ret i64 99
}
int toRowMajor(int i, int j, int cols) { return i * cols + j; }


x86 assembly (clang, -O0):
<toRowMajor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toRowMajor>:
imul   %edx,%edi
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @toRowMajor(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
char tolower(char);
char *Str_ToLower(char *pString) {
  char *str = pString;
  while (*str) {
    *str = tolower(*str);
    str++;
  }
  return pString;
}


x86 assembly (clang, -O0):
<Str_ToLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <Str_ToLower+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Str_ToLower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Str_ToLower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <Str_ToLower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <Str_ToLower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @Str_ToLower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
int test_imm_BBuint8_reg(unsigned char val) {
  return ((val) & (0xBB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BBuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 187
%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_BBuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -69
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int max_int(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<max_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max_int+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void fd195(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  a : {
    typedef int(*g)[n];
  P024A:
    goto P024A;
    0;
  };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    p025A:
      goto p025A;
      goto a;
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd195>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd195+0x7>

x86 assembly (clang, -O2):
<fd195>:
jmp    1100 <fd195>

LLVM IR (-O0):
define void @fd195(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %23
%27 = load i32, i32* %2
%28 = zext i32 %27 to i64
br label %29
29: ; preds = %29, %26
br label %29
30: ; preds = %30
br label %30
31: ; No predecessors!
%32 = load i32, i32* %2
%33 = zext i32 %32 to i64
br label %34
34: ; preds = %34, %31
br label %34
35: ; preds = %35
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd195(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void arm_cdp2() {}


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

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

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

LLVM IR (-O2):
define void @arm_cdp2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, char *);
main() {
  char s1[] = "abcdef";
  char s2[] = "bdf";
  squeeze(s1, s2);
  printf("%s\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0xf(%rbp)
lea    -0xb(%rbp),%rdi
lea    -0xf(%rbp),%rsi
call   1030 <squeeze@plt>
lea    -0xb(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x666564,0xb(%rsp)
movl   $0x64636261,0x8(%rsp)
64
movl   $0x666462,0x4(%rsp)
lea    0x8(%rsp),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <squeeze@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [7 x i8] c"abcdef\00"
@__const.main.s2 = [4 x i8] c"bdf\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = bitcast [7 x i8]* %2 to i8*
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i32 @squeeze(i8* %6, i8* %7)
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [7 x i8] c"abcdef\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 6710370, i32* %2
%5 = call i32 @squeeze(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void _assert_not_in_range(const unsigned long long value,
                          const unsigned long long minimum,
                          const unsigned long long maximum,
                          const char *const file, const int line) {
  __coverity_panic__();
}


x86 assembly (clang, -O0):
<_assert_not_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x0,%al
call   1030 <__coverity_panic__@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_not_in_range>:
xor    %eax,%eax
jmp    1030 <__coverity_panic__@plt>

LLVM IR (-O0):
define void @_assert_not_in_range(i64 %0, i64 %1, i64 %2, i8* %3, i32 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @_assert_not_in_range(i64 %0, i64 %1, i64 %2, i8* nocapture readnone %3, i32 %4) {
%6 = tail call i32 (...) @__coverity_panic__()
ret void
}
void XCreateColormap() {}


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

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

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

LLVM IR (-O2):
define void @XCreateColormap() {
ret void
}
/* Variables and functions */
scalar_t__ strpbrk(char const *, char *);
int CLY_IsWild(const char *f) { return strpbrk(f, "?*") != 0; }


x86 assembly (clang, -O0):
<CLY_IsWild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strpbrk@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLY_IsWild>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strpbrk@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"?*\00"
define i32 @CLY_IsWild(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strpbrk(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"?*\00"
define i32 @CLY_IsWild(i8* %0) {
%2 = tail call i64 @strpbrk(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int iswhitespace(char tp) {
  if (tp == ' ' || tp == '\n' || tp == '\t')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<iswhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1131 <iswhitespace+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1131 <iswhitespace+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    113d <iswhitespace+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <iswhitespace+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhitespace>:
cmp    $0x20,%dil
ja     1120 <iswhitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <iswhitespace+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iswhitespace(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 10
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 9
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @iswhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void gotoendofline(char **line) {
  while (!(**line == 10 || **line == 13) && **line)
    (*line)++;
}


x86 assembly (clang, -O0):
<gotoendofline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     114b <gotoendofline+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     114b <gotoendofline+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115b <gotoendofline+0x5b>
jmp    116e <gotoendofline+0x6e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <gotoendofline+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoendofline>:
mov    (%rdi),%rax
add    $0x1,%rax
mov    $0x2401,%ecx
jmp    1117 <gotoendofline+0x17>
xchg   %ax,%ax
mov    %rax,(%rdi)
add    $0x1,%rax
movzbl -0x1(%rax),%edx
cmp    $0xd,%rdx
ja     1110 <gotoendofline+0x10>
bt     %rdx,%rcx
jae    1110 <gotoendofline+0x10>
ret

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

LLVM IR (-O2):
define void @gotoendofline(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 10, label %8
i8 13, label %8
i8 0, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3, %3, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void sighandler(int signum) {
  printf("Caught signal %d, coming out...\n", signum);
  exit(1);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Caught signal %d, coming out...\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Caught signal %d, coming out...\0A\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned int exynos_calc_padding_size(unsigned int);
unsigned int exynos_get_frame_len(unsigned char *);
unsigned int exynos_get_total_len(unsigned char *frm) {
  unsigned int len;
  unsigned int pad;
  len = exynos_get_frame_len(frm);
  pad = exynos_calc_padding_size(len) ? exynos_calc_padding_size(len) : 0;
  return len + pad;
}


x86 assembly (clang, -O0):
<exynos_get_total_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <exynos_get_frame_len@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <exynos_calc_padding_size@plt>
cmp    $0x0,%eax
je     1159 <exynos_get_total_len+0x39>
mov    -0xc(%rbp),%edi
call   1040 <exynos_calc_padding_size@plt>
mov    %eax,-0x14(%rbp)
jmp    1163 <exynos_get_total_len+0x43>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <exynos_get_total_len+0x43>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exynos_get_total_len>:
push   %rbx
call   1030 <exynos_get_frame_len@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <exynos_calc_padding_size@plt>
test   %eax,%eax
je     113c <exynos_get_total_len+0x1c>
mov    %ebx,%edi
call   1040 <exynos_calc_padding_size@plt>
jmp    113e <exynos_get_total_len+0x1e>
xor    %eax,%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @exynos_get_total_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @exynos_get_frame_len(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @exynos_calc_padding_size(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @exynos_calc_padding_size(i32 %11)
br label %14
13: ; preds = %1
br label %14
14: ; preds = %13, %10
%15 = phi i32 [ %12, %10 ], [ 0, %13 ]
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = add i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @exynos_get_total_len(i8* %0) {
%2 = tail call i32 @exynos_get_frame_len(i8* %0)
%3 = tail call i32 @exynos_calc_padding_size(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @exynos_calc_padding_size(i32 %2)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ 0, %1 ]
%9 = add i32 %8, %2
ret i32 %9
}
void computeRates(double voi, double *states, double *rates,
                  double *variables) {
  rates[0] = voi / 1.0;
  rates[1] = 0.001 * voi / 1.0;
}


x86 assembly (clang, -O0):
<computeRates>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xed2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeRates>:
movsd  %xmm0,(%rsi)
mulsd  0xef4(%rip),%xmm0
movsd  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @computeRates(double %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = fdiv double %9, 1.000000e+00
%11 = load double*, double** %7
%12 = getelementptr inbounds double, double* %11, i64 0
store double %10, double* %12
%13 = load double, double* %5
%14 = fmul double 1.000000e-03, %13
%15 = fdiv double %14, 1.000000e+00
%16 = load double*, double** %7
%17 = getelementptr inbounds double, double* %16, i64 1
store double %15, double* %17
ret void
}

LLVM IR (-O2):
define void @computeRates(double %0, double* nocapture readnone %1, double* nocapture writeonly %2, double* nocapture readnone %3) {
store double %0, double* %2
%5 = fmul double %0, 1.000000e-03
%6 = getelementptr inbounds double, double* %2, i64 1
store double %5, double* %6
ret void
}
/* Variables and functions */
unsigned int f(unsigned int);
unsigned int f1(unsigned int x) { return f(x + 1); }


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

x86 assembly (clang, -O2):
<f1>:
add    $0x1,%edi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = add i32 %0, 1
%3 = tail call i32 @f(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t lt_int16_t(int16_t a, int16_t b) { return a < b; }


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

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

LLVM IR (-O0):
define i32 @lt_int16_t(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 slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lt_int16_t(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ zgb_hal_close();
void zgb_terminate(void) { zgb_hal_close(); }


x86 assembly (clang, -O0):
<zgb_terminate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <zgb_hal_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zgb_terminate>:
xor    %eax,%eax
jmp    1030 <zgb_hal_close@plt>

LLVM IR (-O0):
define void @zgb_terminate() {
%1 = call i32 (...) @zgb_hal_close()
ret void
}

LLVM IR (-O2):
define void @zgb_terminate() {
%1 = tail call i32 (...) @zgb_hal_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __do_softirq();
void do_softirq_own_stack(void) { __do_softirq(); }


x86 assembly (clang, -O0):
<do_softirq_own_stack>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__do_softirq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_softirq_own_stack>:
xor    %eax,%eax
jmp    1030 <__do_softirq@plt>

LLVM IR (-O0):
define void @do_softirq_own_stack() {
%1 = call i32 (...) @__do_softirq()
ret void
}

LLVM IR (-O2):
define void @do_softirq_own_stack() {
%1 = tail call i32 (...) @__do_softirq()
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
void convert_float_to_int16(float sinus, void *buf) {
  *((int16_t *)buf) = (int16_t)(sinus);
}


x86 assembly (clang, -O0):
<convert_float_to_int16>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cvttss2si -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_float_to_int16>:
cvttss2si %xmm0,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @convert_float_to_int16(float %0, i8* %1) {
%3 = alloca float
%4 = alloca i8*
store float %0, float* %3
store i8* %1, i8** %4
%5 = load float, float* %3
%6 = fptosi float %5 to i64
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i64*
store i64 %6, i64* %8
ret void
}

LLVM IR (-O2):
define void @convert_float_to_int16(float %0, i8* nocapture writeonly %1) {
%3 = fptosi float %0 to i64
%4 = bitcast i8* %1 to i64*
store i64 %3, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(int);
void newline(void) { output_byte(10); }


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
mov    $0xa,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define void @newline() {
%1 = call i32 @output_byte(i32 10)
ret void
}

LLVM IR (-O2):
define void @newline() {
%1 = tail call i32 @output_byte(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, char *, char *, char *);
void nicename(unsigned count, char name[], char ref[]) {
  printf("%d %s%s encountered [%s]\n\n", count, name,
         (count == 1) ? " is" : "s are", ref);
}


x86 assembly (clang, -O0):
<nicename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%edi
lea    0xeeb(%rip),%rcx
lea    0xee0(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%rcx
mov    -0x18(%rbp),%r8
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nicename>:
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %edi,%esi
cmp    $0x1,%edi
lea    0xef9(%rip),%rax
lea    0xef6(%rip),%rcx
cmove  %rax,%rcx
lea    0xecc(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%d %s%s encountered [%s]\0A\0A\00"
@.str.1 = [4 x i8] c" is\00"
@.str.2 = [6 x i8] c"s are\00"
define void @nicename(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%13 = load i8*, i8** %6
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%d %s%s encountered [%s]\0A\0A\00"
@.str.1 = [4 x i8] c" is\00"
@.str.2 = [6 x i8] c"s are\00"
define void @nicename(i32 %0, i8* %1, i8* %2) {
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %5, i8* %2)
ret void
}
int isunary(int tok) {
  return tok == '!' || tok == '~' || tok == 12 || tok == 13 || tok == 27;
}


x86 assembly (clang, -O0):
<isunary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isunary+0x4d>
mov    $0x1,%al
cmpl   $0x7e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isunary+0x4d>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isunary+0x4d>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isunary+0x4d>
cmpl   $0x1b,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isunary>:
mov    $0x1,%eax
cmp    $0x21,%edi
ja     111c <isunary+0x1c>
mov    %edi,%ecx
movabs $0x200003000,%rdx
bt     %rcx,%rdx
jb     1121 <isunary+0x21>
cmp    $0x7e,%edi
jne    1122 <isunary+0x22>
ret
xor    %eax,%eax
cmp    $0x1b,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isunary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 33
br i1 %4, label %17, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 126
br i1 %7, label %17, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 12
br i1 %10, label %17, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 13
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 27
br label %17
17: ; preds = %14, %11, %8, %5, %1
%18 = phi i1 [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @isunary(i32 %0) {
switch i32 %0, label %2 [
i32 126, label %5
i32 33, label %5
i32 13, label %5
i32 12, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 27
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
char const *catMenu(void) { return "konzerviranu tunjevinu"; }


x86 assembly (clang, -O0):
<catMenu>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<catMenu>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"konzerviranu tunjevinu\00"
define i8* @catMenu() {
ret i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [23 x i8] c"konzerviranu tunjevinu\00"
define i8* @catMenu() {
ret i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
}
void df_getnxtpack(struct dflv *df) {}


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

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

LLVM IR (-O0):
%struct.dflv = type opaque
define void @df_getnxtpack(%struct.dflv* %0) {
%2 = alloca %struct.dflv*
store %struct.dflv* %0, %struct.dflv** %2
ret void
}

LLVM IR (-O2):
%struct.dflv = type opaque
define void @df_getnxtpack(%struct.dflv* nocapture %0) {
ret void
}
unsigned int barrel_shifter32(unsigned int reg_a, unsigned int shift_ammount,
                              int direction) {
  unsigned int output;
  unsigned int A_temp, B_temp, C_temp, D_temp;
  return output;
}


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

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

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

LLVM IR (-O2):
define i32 @barrel_shifter32(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}