xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t ADCReferenceGet(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x40038000) || (ui32Base == 0x40039000));
  return ((*((volatile uint32_t *)(ui32Base + 0x00000038))) & 0x00000003);
}


x86 assembly (clang, -O0):
<ADCReferenceGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x40038000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <ADCReferenceGet+0x2a>
cmpl   $0x40039000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%eax
and    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCReferenceGet>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40038000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x38(%rax),%eax
and    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ADCReferenceGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073971200
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073975296
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 56
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, 3
ret i32 %17
}

LLVM IR (-O2):
define i32 @ADCReferenceGet(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073971200
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 56
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, 3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ or1k_exception_handler_add(int, void (*)());
void or1k_timer_set_handler(void (*handler)(void)) {
  or1k_exception_handler_add(0x5, handler);
}


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

x86 assembly (clang, -O2):
<or1k_timer_set_handler>:
mov    %rdi,%rsi
mov    $0x5,%edi
jmp    1030 <or1k_exception_handler_add@plt>

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

LLVM IR (-O2):
define void @or1k_timer_set_handler(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @or1k_exception_handler_add(i32 5, void (...)* %2)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double CurrentDaynum() {
  int x;
  struct timeval tptr;
  double usecs, seconds;
  x = gettimeofday(&tptr, NULL);
  usecs = 0.000001 * (double)tptr.tv_usec;
  seconds = usecs + (double)tptr.tv_sec;
  return ((seconds / 86400.0) - 3651.0);
}


x86 assembly (clang, -O0):
<CurrentDaynum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0x4(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe94(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CurrentDaynum>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
mulsd  0xed1(%rip),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
divsd  0xec6(%rip),%xmm0
addsd  0xec6(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @CurrentDaynum() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = alloca double
%4 = alloca double
%5 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
store i32 %5, i32* %1
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fmul double 0x3EB0C6F7A0B5ED8D, %8
store double %9, double* %3
%10 = load double, double* %3
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fadd double %10, %13
store double %14, double* %4
%15 = load double, double* %4
%16 = fdiv double %15, 8.640000e+04
%17 = fsub double %16, 3.651000e+03
ret double %17
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @CurrentDaynum() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = fmul double %6, 0x3EB0C6F7A0B5ED8D
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fadd double %7, %10
%12 = fdiv double %11, 8.640000e+04
%13 = fadd double %12, -3.651000e+03
ret double %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *open_memstream(char **, size_t *);
FILE *memfile_open(char **buffer, size_t *size) {
  return open_memstream(buffer, size);
}


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

x86 assembly (clang, -O2):
<memfile_open>:
jmp    1030 <open_memstream@plt>

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

LLVM IR (-O2):
define i32* @memfile_open(i8** %0, i64* %1) {
%3 = tail call i32* @open_memstream(i8** %0, i64* %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int);
void go_down() {
  gpio_set((27), 0);
  gpio_set((47), 1);
}


x86 assembly (clang, -O0):
<go_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x2f,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_down>:
push   %rax
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x2f,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <gpio_set@plt>

LLVM IR (-O0):
define void @go_down() {
%1 = call i32 @gpio_set(i32 27, i32 0)
%2 = call i32 @gpio_set(i32 47, i32 1)
ret void
}

LLVM IR (-O2):
define void @go_down() {
%1 = tail call i32 @gpio_set(i32 27, i32 0)
%2 = tail call i32 @gpio_set(i32 47, i32 1)
ret void
}
int __attribute__((noipa)) foo(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
long compare_numbers(const void *key, void *node) {
  long a = (long)key;
  long b = (long)node;
  return a - b;
}


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

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

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

LLVM IR (-O2):
define i64 @compare_numbers(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub nsw i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int g();
int f(int x) {
  int i = x + 1;
  return i - g();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <g@plt>
sub    %eax,%ebx
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 (...) @g()
%4 = sub i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void diediedie(int sig) {
  puts("Goodbye cruel world...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Goodbye cruel world...\0A\00"
define void @diediedie(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"Goodbye cruel world...\0A\00"
define void @diediedie(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char _to_upper(char const);
char _is_letter(const char l) {
  if ((l >= 'A') && (l <= 'Z')) {
    return l;
  } else if ((l >= 'a') && (l <= 'z')) {
    return _to_upper(l);
  }
  return 0;
}


x86 assembly (clang, -O0):
<_is_letter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1143 <_is_letter+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1143 <_is_letter+0x33>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1177 <_is_letter+0x67>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     116e <_is_letter+0x5e>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     116e <_is_letter+0x5e>
movsbl -0x2(%rbp),%edi
call   1030 <_to_upper@plt>
mov    %al,-0x1(%rbp)
jmp    1177 <_is_letter+0x67>
jmp    1173 <_is_letter+0x63>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_letter>:
lea    -0x41(%rdi),%eax
cmp    $0x1a,%al
jb     1129 <_is_letter+0x19>
lea    -0x61(%rdi),%eax
cmp    $0x19,%al
ja     1127 <_is_letter+0x17>
movsbl %dil,%edi
jmp    1030 <_to_upper@plt>
xor    %edi,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @_is_letter(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %26
13: ; preds = %7, %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 122
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i8, i8* %3
%23 = call signext i8 @_to_upper(i8 signext %22)
store i8 %23, i8* %2
br label %26
24: ; preds = %17, %13
br label %25
25: ; preds = %24
store i8 0, i8* %2
br label %26
26: ; preds = %25, %21, %11
%27 = load i8, i8* %2
ret i8 %27
}

LLVM IR (-O2):
define signext i8 @_is_letter(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 26
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call signext i8 @_to_upper(i8 signext %0)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i8 [ %8, %7 ], [ %0, %1 ], [ 0, %4 ]
ret i8 %10
}
float ajCvtDegToRad(float degrees) {
  return degrees * (float)(3.141592653589 / 180.0);
}


x86 assembly (clang, -O0):
<ajCvtDegToRad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ajCvtDegToRad>:
mulss  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @ajCvtDegToRad(float %0) {
%2 = fmul float %0, 0x3F91DF46A0000000
ret float %2
}
int main() {
def:
  goto abc;
abc:
  goto def;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1110 <main+0x10>
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %3, %0
br label %3
3: ; preds = %2
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "Usage: visca-cli [-d <serial port device>] command\n");
  fprintf(stderr, "  default serial port device: /dev/ttyS0\n");
  fprintf(stderr, "  for available commands see sourcecode...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeeb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xf00(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef5(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf11(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: visca-cli [-d <serial port device>] command\0A\00"
@.str.1 = [42 x i8] c" default serial port device: /dev/ttyS0\0A\00"
@.str.2 = [44 x i8] c" for available commands see sourcecode...\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: visca-cli [-d <serial port device>] command\0A\00"
@.str.1 = [42 x i8] c" default serial port device: /dev/ttyS0\0A\00"
@.str.2 = [44 x i8] c" for available commands see sourcecode...\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t strlen_template(const char *str) {
  size_t i;
  for (i = 0; str[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen_template>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113b <strlen_template+0x3b>
jmp    112a <strlen_template+0x2a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen_template+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_template>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen_template+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen_template(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void task_end() { ("task_end"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"task_end\00"
define void @task_end() {
ret void
}

LLVM IR (-O2):
define void @task_end() {
ret void
}
/* Variables and functions */
int ENXIO;
__attribute__((deprecated)) int snd_tlv_parse_dB_info(unsigned int *tlv,
                                                      unsigned int tlv_size,
                                                      unsigned int **db_tlvp) {
  return -ENXIO;
}


x86 assembly (clang, -O0):
<snd_tlv_parse_dB_info>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @snd_tlv_parse_dB_info(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* @ENXIO
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @snd_tlv_parse_dB_info(i32* nocapture readnone %0, i32 %1, i32** nocapture readnone %2) {
%4 = load i32, i32* @ENXIO
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_unknown_arg(char *arg) {
  printf("*** unknown argument '%s'\n", arg);
}


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

x86 assembly (clang, -O2):
<print_unknown_arg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [27 x i8] c"*** unknown argument '%s'\0A\00"
define void @print_unknown_arg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void BSP_Timer_Init(unsigned int timerIndex, unsigned int timerCount,
                    unsigned int timerCompare) {
  volatile unsigned int *baseReg;
  unsigned int temp = 0x5100000C;
  temp = temp + 12 * timerIndex;
  baseReg = (volatile unsigned int *)temp;
  *baseReg = timerCount;
  baseReg = (volatile unsigned int *)(temp + 4);
  *baseReg = timerCompare;
}


x86 assembly (clang, -O0):
<BSP_Timer_Init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x5100000c,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
imul   $0xc,-0x4(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x4,%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_Timer_Init>:
shl    $0x2,%edi
lea    (%rdi,%rdi,2),%eax
add    $0x5100000c,%eax
mov    %esi,(%rax)
lea    (%rdi,%rdi,2),%eax
add    $0x51000010,%eax
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @BSP_Timer_Init(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1358954508, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %4
%11 = mul i32 12, %10
%12 = add i32 %9, %11
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store i32* %15, i32** %7
%16 = load i32, i32* %5
%17 = load i32*, i32** %7
store volatile i32 %16, i32* %17
%18 = load i32, i32* %8
%19 = add i32 %18, 4
%20 = zext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store i32* %21, i32** %7
%22 = load i32, i32* %6
%23 = load i32*, i32** %7
store volatile i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @BSP_Timer_Init(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, 12
%5 = add i32 %4, 1358954508
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %1, i32* %7
%8 = add i32 %4, 1358954512
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %2, i32* %10
ret void
}
/* Variables and functions */
size_t nextKeyHS(size_t key, size_t capacity) {
  return (capacity - 1) & (key + 1);
}


x86 assembly (clang, -O0):
<nextKeyHS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextKeyHS>:
lea    -0x1(%rsi),%rax
lea    0x1(%rdi),%rcx
and    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @nextKeyHS(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sub i64 %5, 1
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = and i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @nextKeyHS(i64 %0, i64 %1) {
%3 = add i64 %1, -1
%4 = add i64 %0, 1
%5 = and i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ _tzset();
void tzset(void) { _tzset(); }


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

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

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

LLVM IR (-O2):
define void @tzset() {
%1 = tail call i32 (...) @_tzset()
ret void
}
void CFGMR3QuerySInt(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QuerySInt() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int read_dobldobl_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(231, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_dobldobl_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xe7,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_dobldobl_target_system>:
mov    $0xe7,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @read_dobldobl_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 231, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_dobldobl_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 231, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void print_noplan(void) {}


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

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

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

LLVM IR (-O2):
define void @print_noplan() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xd2() {
  Assert_real((ispunct(210) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              1055, ("ispunct should be 0 for 0xd2"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xd2\00"
define void @t_ispunct_0xd2() {
%1 = call i64 @ispunct(i32 210)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1055, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xd2\00"
define void @t_ispunct_0xd2() {
%1 = tail call i64 @ispunct(i32 210)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1055, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int IsLittleEndian() {
  union {
    unsigned int i;
    unsigned char c[4];
  } bint = {0x04030201};
  return (bint.c[0] == 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<IsLittleEndian>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
@__const.IsLittleEndian.bint = %union.anon { i32 67305985 }
define i32 @IsLittleEndian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @IsLittleEndian() {
ret i32 1
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_recvmsg;
int /*<<< orphan*/ syscall3(int /*<<< orphan*/, int, uintptr_t, int);
ssize_t sys_recvmsg(int sockfd, struct msghdr *msg, int flags) {
  return syscall3(SYS_recvmsg, sockfd, (uintptr_t)msg, flags);
}


x86 assembly (clang, -O0):
<sys_recvmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_recvmsg>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall3@plt>

LLVM IR (-O0):
%struct.msghdr = type { i32 }
@SYS_recvmsg = global i32 0
define i32 @sys_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
%7 = load i32, i32* @SYS_recvmsg
%8 = load i32, i32* %4
%9 = load %struct.msghdr*, %struct.msghdr** %5
%10 = ptrtoint %struct.msghdr* %9 to i64
%11 = load i32, i32* %6
%12 = call i32 @syscall3(i32 %7, i32 %8, i64 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
@SYS_recvmsg = global i32 0
define i32 @sys_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = load i32, i32* @SYS_recvmsg
%5 = ptrtoint %struct.msghdr* %1 to i64
%6 = tail call i32 @syscall3(i32 %4, i32 %0, i64 %5, i32 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int CaesarGetKey() {
  int key = 0;
  scanf("%d", &key);
  return (key % 26);
}


x86 assembly (clang, -O0):
<CaesarGetKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CaesarGetKey>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @CaesarGetKey() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = srem i32 %3, 26
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @CaesarGetKey() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 26
ret i32 %5
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fset_buffer_check_line_outside_window();
int /*<<< orphan*/ fset_buffer_refresh(int);
void fset_config_change_format_number_cb(const void *pointer, void *data,
                                         struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  fset_buffer_refresh(1);
  fset_buffer_check_line_outside_window();
}


x86 assembly (clang, -O0):
<fset_config_change_format_number_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%edi
call   1040 <fset_buffer_refresh@plt>
mov    $0x0,%al
call   1030 <fset_buffer_check_line_outside_window@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fset_config_change_format_number_cb>:
push   %rax
mov    $0x1,%edi
call   1040 <fset_buffer_refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fset_buffer_check_line_outside_window@plt>

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @fset_config_change_format_number_cb(i8* %0, i8* %1, %struct.t_config_option* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_config_option*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.t_config_option* %2, %struct.t_config_option** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.t_config_option*, %struct.t_config_option** %6
%10 = call i32 @fset_buffer_refresh(i32 1)
%11 = call i32 (...) @fset_buffer_check_line_outside_window()
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @fset_config_change_format_number_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 @fset_buffer_refresh(i32 1)
%5 = tail call i32 (...) @fset_buffer_check_line_outside_window()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  scanf("%d", &a);
  b = a * a;
  printf("%d \n", b);
  b = b * a;
  printf("%d \n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
imul   %ebx,%ebx
lea    0xec0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
imul   0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %5
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int LZ4_sizeofStreamState(void) { return ((1UL << 14) + 32); }


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

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

LLVM IR (-O0):
define i32 @LZ4_sizeofStreamState() {
ret i32 16416
}

LLVM IR (-O2):
define i32 @LZ4_sizeofStreamState() {
ret i32 16416
}
int compare_char(void const *a, void const *b) {
  return (int)(*((char *)a)) - ((int)*((char *)b));
}


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

x86 assembly (clang, -O2):
<compare_char>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_char(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
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ thrd_t;

/* Variables and functions */
scalar_t__ thd_join(int /*<<< orphan*/, void **);
int thrd_error;
int thrd_success;
int thrd_join(thrd_t thr, int *res) {
  void *rv;
  if (thd_join(thr, &rv))
    return thrd_error;
  *res = (int)rv;
  return thrd_success;
}


x86 assembly (clang, -O0):
<thrd_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <thd_join@plt>
cmp    $0x0,%rax
je     1146 <thrd_join+0x36>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <thrd_join+0x4e>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrd_join>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <thd_join@plt>
test   %rax,%rax
je     1130 <thrd_join+0x20>
mov    0x2eaa(%rip),%rax
jmp    113d <thrd_join+0x2d>
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@thrd_error = global i32 0
@thrd_success = global i32 0
define i32 @thrd_join(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
%7 = load i32, i32* %4
%8 = call i64 @thd_join(i32 %7, i8** %6)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @thrd_error
store i32 %11, i32* %3
br label %17
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = ptrtoint i8* %13 to i32
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32, i32* @thrd_success
store i32 %16, i32* %3
br label %17
17: ; preds = %12, %10
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@thrd_error = global i32 0
@thrd_success = global i32 0
define i32 @thrd_join(i32 %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @thd_join(i32 %0, i8** %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
store i32 %10, i32* %1
br label %11
11: ; preds = %2, %7
%12 = phi i32* [ @thrd_success, %7 ], [ @thrd_error, %2 ]
%13 = load i32, i32* %12
ret i32 %13
}
int check(int opcode) { return (opcode | 0x10000); }


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

x86 assembly (clang, -O2):
<check>:
mov    %edi,%eax
or     $0x10000,%eax
ret

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

LLVM IR (-O2):
define i32 @check(i32 %0) {
%2 = or i32 %0, 65536
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mean(int /*<<< orphan*/ *, int, int *);
void test_null_array(void) {
  int res;
  assert((mean(NULL, 1, &res) == 1));
}


x86 assembly (clang, -O0):
<test_null_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
lea    -0x4(%rbp),%rdx
call   1040 <mean@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_null_array>:
push   %rax
lea    0x4(%rsp),%rdx
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <mean@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_null_array() {
%1 = alloca i32
%2 = call i32 @mean(i32* null, i32 1, i32* %1)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret void
}

LLVM IR (-O2):
define void @test_null_array() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @mean(i32* null, i32 1, i32* %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}
int is_digit(char c) { return c >= '0' & c <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x1(%rbp),%ecx
cmp    $0x39,%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
%6 = zext i1 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
%10 = zext i1 %9 to i32
%11 = and i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int GetDataBlock_(int /*<<< orphan*/ *, unsigned char *);
int /*<<< orphan*/ printf(char *, ...);
int GetDataBlock(FILE *fd, unsigned char *buf) {
  int rv;
  int i;
  rv = GetDataBlock_(fd, buf);
  if (0) {
    printf("[GetDataBlock returning %d", rv);
    if (rv > 0) {
      printf(":");
      for (i = 0; i < rv; i++)
        printf(" %02x", buf[i]);
    }
    printf("]\n");
  }
  return (rv);
}


x86 assembly (clang, -O0):
<GetDataBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <GetDataBlock_@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDataBlock>:
jmp    1030 <GetDataBlock_@plt>

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

LLVM IR (-O2):
define i32 @GetDataBlock(i32* %0, i8* %1) {
%3 = tail call i32 @GetDataBlock_(i32* %0, i8* %1)
ret i32 %3
}
int xaui_direct_power_down(struct cphy *phy, int enable) { return 0; }


x86 assembly (clang, -O0):
<xaui_direct_power_down>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cphy = type opaque
define i32 @xaui_direct_power_down(%struct.cphy* %0, i32 %1) {
%3 = alloca %struct.cphy*
%4 = alloca i32
store %struct.cphy* %0, %struct.cphy** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.cphy = type opaque
define i32 @xaui_direct_power_down(%struct.cphy* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void sys_error_quit(const char *s) {
  perror(s);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sys_error_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sys_error_quit>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @sys_error_quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @sys_error_quit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ scr_move(int, int);
void scr_scrl(void) {
  scr_move(24, 1);
  putchar('\n');
}


x86 assembly (clang, -O0):
<scr_scrl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%edi
mov    $0x1,%esi
call   1040 <scr_move@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scr_scrl>:
push   %rax
mov    $0x18,%edi
mov    $0x1,%esi
call   1040 <scr_move@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @scr_scrl() {
%1 = call i32 @scr_move(i32 24, i32 1)
%2 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @scr_scrl() {
%1 = tail call i32 @scr_move(i32 24, i32 1)
%2 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int u_short;
typedef int u_int;

/* Variables and functions */
u_int mkhash(u_int src, u_short sport, u_int dest, u_short dport) {
  u_int port = sport ^ dport;
  return src ^ dest ^ port;
}


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

x86 assembly (clang, -O2):
<mkhash>:
mov    %edx,%eax
xor    %esi,%edi
xor    %ecx,%eax
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @mkhash(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = xor i32 %1, %0
%6 = xor i32 %5, %2
%7 = xor i32 %6, %3
ret i32 %7
}