xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, double, double,
                           double, double, double);
int /*<<< orphan*/ stderr;
void progress_dir_v3(char *form, int in0, double in1, double in2, double in3,
                     double in4, double in5, int in6, double in7, int in8) {
  fprintf(stderr, form, in0, in1, in2, in3, in4, in5);
}


x86 assembly (clang, -O0):
<progress_dir_v3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
mov    %edx,-0x3c(%rbp)
movsd  %xmm5,-0x48(%rbp)
mov    %ecx,-0x4c(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
call   1030 <fprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progress_dir_v3>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @progress_dir_v3(i8* %0, i32 %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double %8, i32 %9) {
%11 = alloca i8*
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i32
%19 = alloca double
%20 = alloca i32
store i8* %0, i8** %11
store i32 %1, i32* %12
store double %2, double* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store double %6, double* %17
store i32 %7, i32* %18
store double %8, double* %19
store i32 %9, i32* %20
%21 = load i32, i32* @stderr
%22 = load i8*, i8** %11
%23 = load i32, i32* %12
%24 = load double, double* %13
%25 = load double, double* %14
%26 = load double, double* %15
%27 = load double, double* %16
%28 = load double, double* %17
%29 = call i32 @fprintf(i32 %21, i8* %22, i32 %23, double %24, double %25, double %26, double %27, double %28)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @progress_dir_v3(i8* %0, i32 %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double %8, i32 %9) {
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* %0, i32 %1, double %2, double %3, double %4, double %5, double %6)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ROL(uint32_t x) { return ((x << 1) | (x >> (32 - 1))); }


x86 assembly (clang, -O0):
<ROL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL>:
lea    (%rdi,%rdi,1),%eax
sar    $0x1f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ROL(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 31
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ROL(i32 %0) {
%2 = shl i32 %0, 1
%3 = ashr i32 %0, 31
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int main(void) {
  int a[10] = {0};
  f(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rsp,%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @f(i32* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GB_CPUClockCounterReset();
int /*<<< orphan*/ GB_CameraClockCounterReset();
int /*<<< orphan*/ GB_DMAClockCounterReset();
int /*<<< orphan*/ GB_PPUClockCounterReset();
int /*<<< orphan*/ GB_SerialClockCounterReset();
int /*<<< orphan*/ GB_SoundClockCounterReset();
int /*<<< orphan*/ GB_TimersClockCounterReset();
void GB_ClockCountersReset(void) {
  GB_CPUClockCounterReset();
  GB_TimersClockCounterReset();
  GB_PPUClockCounterReset();
  GB_SerialClockCounterReset();
  GB_SoundClockCounterReset();
  GB_DMAClockCounterReset();
  GB_CameraClockCounterReset();
}


x86 assembly (clang, -O0):
<GB_ClockCountersReset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GB_CPUClockCounterReset@plt>
mov    $0x0,%al
call   1060 <GB_TimersClockCounterReset@plt>
mov    $0x0,%al
call   1090 <GB_PPUClockCounterReset@plt>
mov    $0x0,%al
call   1050 <GB_SerialClockCounterReset@plt>
mov    $0x0,%al
call   1080 <GB_SoundClockCounterReset@plt>
mov    $0x0,%al
call   1070 <GB_DMAClockCounterReset@plt>
mov    $0x0,%al
call   1040 <GB_CameraClockCounterReset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_ClockCountersReset>:
push   %rax
xor    %eax,%eax
call   1030 <GB_CPUClockCounterReset@plt>
xor    %eax,%eax
call   1060 <GB_TimersClockCounterReset@plt>
xor    %eax,%eax
call   1090 <GB_PPUClockCounterReset@plt>
xor    %eax,%eax
call   1050 <GB_SerialClockCounterReset@plt>
xor    %eax,%eax
call   1080 <GB_SoundClockCounterReset@plt>
xor    %eax,%eax
call   1070 <GB_DMAClockCounterReset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <GB_CameraClockCounterReset@plt>

LLVM IR (-O0):
define void @GB_ClockCountersReset() {
%1 = call i32 (...) @GB_CPUClockCounterReset()
%2 = call i32 (...) @GB_TimersClockCounterReset()
%3 = call i32 (...) @GB_PPUClockCounterReset()
%4 = call i32 (...) @GB_SerialClockCounterReset()
%5 = call i32 (...) @GB_SoundClockCounterReset()
%6 = call i32 (...) @GB_DMAClockCounterReset()
%7 = call i32 (...) @GB_CameraClockCounterReset()
ret void
}

LLVM IR (-O2):
define void @GB_ClockCountersReset() {
%1 = tail call i32 (...) @GB_CPUClockCounterReset()
%2 = tail call i32 (...) @GB_TimersClockCounterReset()
%3 = tail call i32 (...) @GB_PPUClockCounterReset()
%4 = tail call i32 (...) @GB_SerialClockCounterReset()
%5 = tail call i32 (...) @GB_SoundClockCounterReset()
%6 = tail call i32 (...) @GB_DMAClockCounterReset()
%7 = tail call i32 (...) @GB_CameraClockCounterReset()
ret void
}
void get_vec_from_rpz(const double *x, const double *vrpz, double *v) {
  v[0] = vrpz[0];
  v[1] = vrpz[1];
  v[2] = vrpz[2];
}


x86 assembly (clang, -O0):
<get_vec_from_rpz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_vec_from_rpz>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdx)
ret

LLVM IR (-O0):
define void @get_vec_from_rpz(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 1
store double %14, double* %16
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 2
store double %19, double* %21
ret void
}

LLVM IR (-O2):
define void @get_vec_from_rpz(double* nocapture readnone %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
store double %4, double* %2
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %2, i64 1
store double %6, double* %7
%8 = getelementptr inbounds double, double* %1, i64 2
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %2, i64 2
store double %9, double* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256d;

/* Variables and functions */
int /*<<< orphan*/ _mm256_add_pd(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm256_hadd_pd(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm256_permute2f128_pd(int /*<<< orphan*/,
                                          int /*<<< orphan*/, int);
__m256d hadd3(__m256d v) {
  __m256d a;
  v = _mm256_hadd_pd(v, v);
  a = _mm256_permute2f128_pd(v, v, 1);
  v = _mm256_add_pd(a, v);
  return v;
}


x86 assembly (clang, -O0):
<hadd3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <_mm256_hadd_pd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1030 <_mm256_permute2f128_pd@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <_mm256_add_pd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hadd3>:
push   %rbx
mov    %edi,%esi
call   1050 <_mm256_hadd_pd@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <_mm256_permute2f128_pd@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <_mm256_add_pd@plt>

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

LLVM IR (-O2):
define i32 @hadd3(i32 %0) {
%2 = tail call i32 @_mm256_hadd_pd(i32 %0, i32 %0)
%3 = tail call i32 @_mm256_permute2f128_pd(i32 %2, i32 %2, i32 1)
%4 = tail call i32 @_mm256_add_pd(i32 %3, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ serialCommand(char *, char *);
int /*<<< orphan*/ usleep(int);
void hr20GetStatusLine(char *line) {
  while (1) {
    serialCommand("D\r", line);
    if (line[0] == 'D')
      break;
    usleep(1000);
  }
}


x86 assembly (clang, -O0):
<hr20GetStatusLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <serialCommand@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x44,%eax
jne    1151 <hr20GetStatusLine+0x31>
jmp    1160 <hr20GetStatusLine+0x40>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
jmp    112c <hr20GetStatusLine+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hr20GetStatusLine>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <serialCommand@plt>
cmpb   $0x44,(%rbx)
je     116a <hr20GetStatusLine+0x4a>
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x3e8,%edi
call   1040 <usleep@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <serialCommand@plt>
cmpb   $0x44,(%rbx)
jne    1150 <hr20GetStatusLine+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"D\0D\00"
define void @hr20GetStatusLine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %12
%4 = load i8*, i8** %2
%5 = call i32 @serialCommand(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 68
br i1 %10, label %11, label %12
11: ; preds = %3
br label %14
12: ; preds = %3
%13 = call i32 @usleep(i32 1000)
br label %3
14: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"D\0D\00"
define void @hr20GetStatusLine(i8* %0) {
%2 = tail call i32 @serialCommand(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 68
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = tail call i32 @usleep(i32 1000)
%7 = tail call i32 @serialCommand(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 68
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *);
char *displayError(char *respond_to_msg) {
  memset(respond_to_msg, 0, 1024);
  sprintf(respond_to_msg,
          "Invalid command: Please see \"help\" for list of valid commands.\n");
  return respond_to_msg;
}


x86 assembly (clang, -O0):
<displayError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayError>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
movups 0xed9(%rip),%xmm0
movups %xmm0,(%rbx)
movups 0xedf(%rip),%xmm0
movups %xmm0,0x10(%rbx)
movups 0xee4(%rip),%xmm0
movups %xmm0,0x20(%rbx)
movups 0xee9(%rip),%xmm0
movups %xmm0,0x30(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [64 x i8] c"Invalid command: Please see \22help\22 for list of valid commands.\0A\00"
define i8* @displayError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memset(i8* %3, i32 0, i32 1024)
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [64 x i8] c"Invalid command: Please see \22help\22 for list of valid commands.\0A\00"
define i8* @displayError(i8* returned %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 1024)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(64) %0, i8* align 1 dereferenceable(64) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i64 64, i1 false)
ret i8* %0
}
void msp430_check_bp(unsigned int l) {
  static unsigned int last;
  last = l;
}


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

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

LLVM IR (-O0):
@msp430_check_bp.last = internal global i32 0
define void @msp430_check_bp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* @msp430_check_bp.last
ret void
}

LLVM IR (-O2):
define void @msp430_check_bp(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ circuitdesignmarkovalgorithm();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world\n");
  circuitdesignmarkovalgorithm();
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <circuitdesignmarkovalgorithm@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @circuitdesignmarkovalgorithm()
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @circuitdesignmarkovalgorithm()
ret i32 0
}
__attribute__((no)) int *foo(int *x, int y) { return x + y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i32* @foo(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
ret i32* %8
}

LLVM IR (-O2):
define i32* @foo(i32* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ print_at(char const *, int, int, int);
void print(const char *message) { print_at(message, -1, -1, 0x0f); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%edx
mov    $0xf,%ecx
mov    %edx,%esi
call   1030 <print_at@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
mov    $0xf,%ecx
jmp    1030 <print_at@plt>

LLVM IR (-O0):
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @print_at(i8* %3, i32 -1, i32 -1, i32 15)
ret void
}

LLVM IR (-O2):
define void @print(i8* %0) {
%2 = tail call i32 @print_at(i8* %0, i32 -1, i32 -1, i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_init();
void ws2812_init(void) { i2c_init(); }


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

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

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

LLVM IR (-O2):
define void @ws2812_init() {
%1 = tail call i32 (...) @i2c_init()
ret void
}
/* Variables and functions */
int getchar();
void read_line(char buffer[]) {
  int character;
  int i = 0;
  do {
    character = getchar();
    buffer[i] = (char)character;
    ++i;
  } while (character != '\n');
  buffer[i - 1] = '\0';
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1123 <read_line+0x13>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,0x1(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0xa,%eax
jne    1120 <read_line+0x10>
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @read_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
br label %5
5: ; preds = %15, %1
%6 = call i32 (...) @getchar()
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %15
15: ; preds = %5
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 10
br i1 %17, label %5, label %18
18: ; preds = %15
%19 = load i8*, i8** %2
%20 = load i32, i32* %4
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 0, i8* %23
ret void
}

LLVM IR (-O2):
define void @read_line(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = tail call i32 (...) @getchar()
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %5, i8* %6
%7 = add nuw i64 %3, 1
%8 = icmp eq i32 %4, 10
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = and i64 %3, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %11
ret void
}
int cmpltu(int x, int y, int z) { return (unsigned)(x) < (unsigned)(y); }


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

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

LLVM IR (-O0):
define i32 @cmpltu(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* %5
%9 = icmp ult i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @cmpltu(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ some_calc(int);
int /*<<< orphan*/ undefined_local();
int main(void) {
  for (int i = 0; i < 5; i++) {
    some_calc(i * i);
    undefined_local();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1161 <main+0x41>
mov    -0x8(%rbp),%edi
imul   -0x8(%rbp),%edi
call   1030 <some_calc@plt>
mov    $0x0,%al
call   1040 <undefined_local@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @some_calc(i32 0)
%2 = tail call i32 (...) @undefined_local()
%3 = tail call i32 @some_calc(i32 1)
%4 = tail call i32 (...) @undefined_local()
%5 = tail call i32 @some_calc(i32 4)
%6 = tail call i32 (...) @undefined_local()
%7 = tail call i32 @some_calc(i32 9)
%8 = tail call i32 (...) @undefined_local()
%9 = tail call i32 @some_calc(i32 16)
%10 = tail call i32 (...) @undefined_local()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ net_shutdown();
void exitfunc(void) { net_shutdown(); }


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

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

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

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

/* Variables and functions */
void UARTClockSourceSet(uint32_t ui32Base, uint32_t ui32Source) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000FC8))) = ui32Source;
}


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

x86 assembly (clang, -O2):
<UARTClockSourceSet>:
mov    %rsi,0xfc8(%rdi)
ret

LLVM IR (-O0):
define void @UARTClockSourceSet(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 = load i64, i64* %3
%7 = add nsw i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTClockSourceSet(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 4040
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
float parallilogrammo(float pleura1, float pleura2) {
  return (2 * pleura1 + 2 * pleura2);
}


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

x86 assembly (clang, -O2):
<parallilogrammo>:
addss  %xmm1,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @parallilogrammo(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float 2.000000e+00, %6
%8 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %5, float %7)
ret float %8
}

LLVM IR (-O2):
define float @parallilogrammo(float %0, float %1) {
%3 = fmul float %1, 2.000000e+00
%4 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float %3)
ret float %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int ss_flags;
};
typedef TYPE_1__ stack_t;

/* Variables and functions */
int SS_DISABLE;
int SS_ONSTACK;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ sigaltstack(int /*<<< orphan*/ *, TYPE_1__ *);
void assert_on_stack(void) {
  stack_t cursigstk;
  assert((0) == (sigaltstack(NULL, &cursigstk)));
  assert((SS_ONSTACK) == (cursigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)));
}


x86 assembly (clang, -O0):
<assert_on_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1040 <sigaltstack@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
mov    0x2e8d(%rip),%rdx
mov    (%rdx),%edx
mov    0x2e7c(%rip),%rsi
or     (%rsi),%edx
and    %edx,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_on_stack>:
push   %rax
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <sigaltstack@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    0x2ea0(%rip),%rcx
mov    (%rcx),%ecx
or     %eax,%ecx
and    (%rsp),%ecx
xor    %edi,%edi
cmp    %ecx,%eax
sete   %dil
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@SS_ONSTACK = global i32 0
@SS_DISABLE = global i32 0
define void @assert_on_stack() {
%1 = alloca %struct.TYPE_3__
%2 = call i32 @sigaltstack(i32* null, %struct.TYPE_3__* %1)
%3 = icmp eq i32 0, %2
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = load i32, i32* @SS_ONSTACK
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @SS_DISABLE
%10 = load i32, i32* @SS_ONSTACK
%11 = or i32 %9, %10
%12 = and i32 %8, %11
%13 = icmp eq i32 %6, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@SS_ONSTACK = global i32 0
@SS_DISABLE = global i32 0
define void @assert_on_stack() {
%1 = alloca %struct.TYPE_3__
%2 = bitcast %struct.TYPE_3__* %1 to i8*
%3 = call i32 @sigaltstack(i32* null, %struct.TYPE_3__* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* @SS_ONSTACK
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = load i32, i32* @SS_DISABLE
%11 = or i32 %10, %7
%12 = and i32 %11, %9
%13 = icmp eq i32 %7, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_clear(int /*<<< orphan*/);
void m_clear(mpfr_t value) { mpfr_clear(value); }


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

x86 assembly (clang, -O2):
<m_clear>:
jmp    1030 <mpfr_clear@plt>

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

LLVM IR (-O2):
define void @m_clear(i32 %0) {
%2 = tail call i32 @mpfr_clear(i32 %0)
ret void
}
void flash_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @flash_lock() {
ret void
}
int test_imm_8Dint8_mem(signed char *val) {
  return ((*val) & (0x8D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Dint8_mem>:
testb  $0x8d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Dint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 141
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_8Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -115
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main(void) {
  int a[4] = {1, 2, 3, 4};
  int i, n;
  for (i = 0, n = 0; i < 4; i++)
    n += a[i];
  return n;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    1155 <main+0x55>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112f <main+0x2f>
mov    -0x28(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
int loop_always_linear(int p, int k) {
  int i = 0;
  if (p > 0) {
    goto Loop;
  }
  while (i < k) {
  Loop:
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<loop_always_linear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1120 <loop_always_linear+0x20>
jmp    1136 <loop_always_linear+0x36>
jmp    1125 <loop_always_linear+0x25>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1144 <loop_always_linear+0x44>
jmp    1136 <loop_always_linear+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <loop_always_linear+0x25>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_always_linear>:
xor    %eax,%eax
test   %edi,%edi
jg     110a <loop_always_linear+0xa>
cmp    %esi,%eax
jge    110f <loop_always_linear+0xf>
add    $0x1,%eax
jmp    1106 <loop_always_linear+0x6>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @loop_always_linear(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2, %7
%5 = phi i32 [ %9, %7 ], [ 0, %2 ]
%6 = icmp slt i32 %5, %1
br i1 %6, label %7, label %10
7: ; preds = %4, %2
%8 = phi i32 [ 0, %2 ], [ %5, %4 ]
%9 = add nsw i32 %8, 1
br label %4
10: ; preds = %4
ret i32 1
}
/* Variables and functions */
scalar_t__ isdigit(char);
int poe_isdigit(char c) { return (c == '+') || (c == '-') || isdigit(c); }


x86 assembly (clang, -O0):
<poe_isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     1155 <poe_isdigit+0x45>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1155 <poe_isdigit+0x45>
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poe_isdigit>:
mov    $0x1,%eax
cmp    $0x2b,%dil
je     1121 <poe_isdigit+0x11>
cmp    $0x2d,%dil
jne    1122 <poe_isdigit+0x12>
ret
push   %rax
movsbl %dil,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @poe_isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 43
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = call i64 @isdigit(i8 signext %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @poe_isdigit(i8 signext %0) {
switch i8 %0, label %2 [
i8 45, label %6
i8 43, label %6
]
2: ; preds = %1
%3 = tail call i64 @isdigit(i8 signext %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %2
%7 = phi i32 [ 1, %1 ], [ %5, %2 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ COND_LT();
int /*<<< orphan*/ EA_A7_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_slt_8_pi7(void) {
  m68ki_write_8(EA_A7_PI_8(), COND_LT() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_slt_8_pi7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_A7_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_LT@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_slt_8_pi7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_A7_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_LT@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_slt_8_pi7() {
%1 = call i32 (...) @EA_A7_PI_8()
%2 = call i64 (...) @COND_LT()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_slt_8_pi7() {
%1 = tail call i32 (...) @EA_A7_PI_8()
%2 = tail call i64 (...) @COND_LT()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
short shft_h(short *, short *);
short intr_wrap_553(short p1, short p2) { return shft_h(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_553>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <shft_h@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_553>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <shft_h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_553(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @shft_h(i16* %3, i16* %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @intr_wrap_553(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @shft_h(i16* %3, i16* %4)
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ uartPutc(char);
void uart_send(char *str) {
  for (int i = 0; str[i] != '\0'; ++i) {
    uartPutc(str[i]);
  }
  return;
}


x86 assembly (clang, -O0):
<uart_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <uart_send+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uartPutc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <uart_send+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_send+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uartPutc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_send+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_send(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @uartPutc(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
bool shl_htable_compare_str(const void *a, const void *b) {
  return !strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<shl_htable_compare_str>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @shl_htable_compare_str(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @shl_htable_compare_str(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int listen_error(int i) {
  printf("Error listening socket %d\n", i);
  return 0;
}


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

x86 assembly (clang, -O2):
<listen_error>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Error listening socket %d\0A\00"
define i32 @listen_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Error listening socket %d\0A\00"
define i32 @listen_error(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *safe_strncpy(char *dest, const char *src, size_t n) {
  if (src == NULL) {
    dest[0] = '\0';
  } else {
    dest[n - 1] = '\0';
    strncpy(dest, src, n - 1);
  }
  return dest;
}


x86 assembly (clang, -O0):
<safe_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113b <safe_strncpy+0x2b>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1160 <safe_strncpy+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strncpy>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     112c <safe_strncpy+0x1c>
movb   $0x0,-0x1(%rbx,%rdx,1)
add    $0xffffffffffffffff,%rdx
mov    %rbx,%rdi
call   1030 <strncpy@plt>
jmp    112f <safe_strncpy+0x1f>
movb   $0x0,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @safe_strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 0, i8* %11
br label %22
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = load i64, i64* %6
%15 = sub i64 %14, 1
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = load i64, i64* %6
%20 = sub i64 %19, 1
%21 = call i32 @strncpy(i8* %17, i8* %18, i64 %20)
br label %22
22: ; preds = %12, %9
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @safe_strncpy(i8* returned %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %5, label %6
5: ; preds = %3
store i8 0, i8* %0
br label %10
6: ; preds = %3
%7 = add i64 %2, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
%9 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %7)
br label %10
10: ; preds = %6, %5
ret i8* %0
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ time(long *);
long *gettime_1_svc(void *argp, struct svc_req *rqstp) {
  static long result;
  time(&result);
  return &result;
}


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

x86 assembly (clang, -O2):
<gettime_1_svc>:
push   %rbx
lea    0x2f18(%rip),%rbx
mov    %rbx,%rdi
call   1030 <time@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.svc_req = type { i32 }
@gettime_1_svc.result = internal global i64 0
define i64* @gettime_1_svc(i8* %0, %struct.svc_req* %1) {
%3 = alloca i8*
%4 = alloca %struct.svc_req*
store i8* %0, i8** %3
store %struct.svc_req* %1, %struct.svc_req** %4
%5 = call i32 @time(i64* @gettime_1_svc.result)
ret i64* @gettime_1_svc.result
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
@gettime_1_svc.result = internal global i64 0
define i64* @gettime_1_svc(i8* nocapture readnone %0, %struct.svc_req* nocapture readnone %1) {
%3 = tail call i32 @time(i64* @gettime_1_svc.result)
ret i64* @gettime_1_svc.result
}