xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Version: "
         "1.5"
         "\n"
         "Usage: rpirtscts on|off\n"
         "Enable or disable hardware flow control pins on ttyAMA0.\n"
         "\nFor 26 pin GPIO header boards:\n"
         "P5 header pins remap as follows:\n"
         "    P5-05 (GPIO30) -> CTS (input)\n"
         "    P5-06 (GPIO31) -> RTS (output)\n"
         "\nFor 40 pin GPIO header boards:\n"
         "    P1-36 (GPIO16) -> CTS (input)\n"
         "    P1-11 (GPIO17) -> RTS (output)\n"
         "\nYou may also need to enable flow control in the driver:\n"
         "    stty -F /dev/ttyAMA0 crtscts\n");
}


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

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

LLVM IR (-O0):
@.str = [420 x i8] c"Version: 1.5\0AUsage: rpirtscts on|off\0AEnable or disable hardware flow control pins on ttyAMA0.\0A\0AFor 26 pin GPIO header boards:\0AP5 header pins remap as follows:\0A P5-05 (GPIO30) -> CTS (input)\0A P5-06 (GPIO31) -> RTS (output)\0A\0AFor 40 pin GPIO header boards:\0A P1-36 (GPIO16) -> CTS (input)\0A P1-11 (GPIO17) -> RTS (output)\0A\0AYou may also need to enable flow control in the driver:\0A stty -F /dev/ttyAMA0 crtscts\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([420 x i8], [420 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [419 x i8] c"Version: 1.5\0AUsage: rpirtscts on|off\0AEnable or disable hardware flow control pins on ttyAMA0.\0A\0AFor 26 pin GPIO header boards:\0AP5 header pins remap as follows:\0A P5-05 (GPIO30) -> CTS (input)\0A P5-06 (GPIO31) -> RTS (output)\0A\0AFor 40 pin GPIO header boards:\0A P1-36 (GPIO16) -> CTS (input)\0A P1-11 (GPIO17) -> RTS (output)\0A\0AYou may also need to enable flow control in the driver:\0A stty -F /dev/ttyAMA0 crtscts\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([419 x i8], [419 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct TYPE_3__ {
  long tv_sec;
  long tv_usec;
};
struct TYPE_4__ {
  long tv_sec;
  long tv_usec;
};
struct itimerval {
  TYPE_1__ it_value;
  TYPE_2__ it_interval;
};

/* Variables and functions */
int __syscall(int, int, long *);
int __syscall_ret(int);
int syscall(int, int, struct itimerval *);
int getitimer(int which, struct itimerval *old) {
  if (sizeof(time_t) > sizeof(long)) {
    long old32[4];
    int r = __syscall(105, which, old32);
    if (!r) {
      old->it_interval.tv_sec = old32[0];
      old->it_interval.tv_usec = old32[1];
      old->it_value.tv_sec = old32[2];
      old->it_value.tv_usec = old32[3];
    }
    return __syscall_ret(r);
  }
  return syscall(105, which, old);
}


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

x86 assembly (clang, -O2):
<getitimer>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x69,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.itimerval = type { %struct.TYPE_3__, %struct.TYPE_4__ }
%struct.TYPE_3__ = type { i64, i64 }
%struct.TYPE_4__ = type { i64, i64 }
define i32 @getitimer(i32 %0, %struct.itimerval* %1) {
%3 = alloca i32
%4 = alloca %struct.itimerval*
store i32 %0, i32* %3
store %struct.itimerval* %1, %struct.itimerval** %4
%5 = load i32, i32* %3
%6 = load %struct.itimerval*, %struct.itimerval** %4
%7 = call i32 @syscall(i32 105, i32 %5, %struct.itimerval* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.itimerval = type { %struct.TYPE_3__, %struct.TYPE_4__ }
%struct.TYPE_3__ = type { i64, i64 }
%struct.TYPE_4__ = type { i64, i64 }
define i32 @getitimer(i32 %0, %struct.itimerval* %1) {
%3 = tail call i32 @syscall(i32 105, i32 %0, %struct.itimerval* %1)
ret i32 %3
}
/* Variables and functions */
double fabs(double const);
double _absolute(const int numInputs, const double *inputs,
                 const double *connectionWeights) {
  return fabs(inputs[0]);
}


x86 assembly (clang, -O0):
<_absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xee2(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_absolute>:
movsd  (%rsi),%xmm0
andps  0xef5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_absolute(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
store i32 %0, i32* %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 = call double @llvm.fabs.f64(double %9)
ret double %10
}

LLVM IR (-O2):
define double @_absolute(i32 %0, double* nocapture %1, double* nocapture readnone %2) {
%4 = load double, double* %1
%5 = tail call double @llvm.fabs.f64(double %4)
ret double %5
}
void mutex_unlock(int *m) { __sync_lock_release(m); }


x86 assembly (clang, -O0):
<mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_unlock>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @mutex_unlock(i32* nocapture writeonly %0) {
store atomic i32 0, i32* %0 release
ret void
}
int test_imm_7Euint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x7E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Euint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 126
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_gas_comeback_usage(void) {
  printf("\nUsage : wifidirect_gas_comeback_request/response [CONFIG_FILE]\n");
  printf("CONFIG_FILE contains WIFIDIRECT GAS comeback request/response "
         "payload.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wifidirect_gas_comeback_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"\0AUsage : wifidirect_gas_comeback_request/response [CONFIG_FILE]\0A\00"
@.str.1 = [72 x i8] c"CONFIG_FILE contains WIFIDIRECT GAS comeback request/response payload.\0A\00"
define void @print_wifidirect_gas_comeback_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c"\0AUsage : wifidirect_gas_comeback_request/response [CONFIG_FILE]\00"
@str.2 = [71 x i8] c"CONFIG_FILE contains WIFIDIRECT GAS comeback request/response payload.\00"
define void @print_wifidirect_gas_comeback_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_HV7131RP(unsigned short uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_HV7131RP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_HV7131RP>:
movzbl %dil,%edi
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_HV7131RP(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = trunc i16 %5 to i8
%7 = load i16, i16* %4
%8 = trunc i16 %7 to i8
%9 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %6, i8 zeroext %8)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_HV7131RP(i16 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %0 to i8
%4 = trunc i16 %1 to i8
%5 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %3, i8 zeroext %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char const *);
void err(const char *msg) {
  printf(msg);
  printf("------- End InversionsCount -------\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"------- End InversionsCount -------\0A\00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [36 x i8] c"------- End InversionsCount -------\00"
define void @err(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void Lut_5(double *out, double *in) {
  out[0] = in[0];
  out[1] = in[1];
  out[2] = in[2];
  out[3] = in[3];
  out[4] = in[4];
}


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

x86 assembly (clang, -O2):
<Lut_5>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x18(%rdi)
movsd  0x20(%rsi),%xmm0
movsd  %xmm0,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @Lut_5(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 1
store double %5, double* %6
%7 = getelementptr inbounds double, double* %1, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %0, i64 2
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 3
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %0, i64 3
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 4
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %0, i64 4
store double %14, double* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage() {
  fprintf(stderr,
          "Usage teacrypt {--encrypt | --decrypt} [key] < infile > outfile\n");
  abort();
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Usage teacrypt {--encrypt | --decrypt} [key] < infile > outfile\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Usage teacrypt {--encrypt | --decrypt} [key] < infile > outfile\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void mega_struct_foo(struct yoyo *a) { (void)a; }


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

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

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

LLVM IR (-O2):
%struct.yoyo = type opaque
define void @mega_struct_foo(%struct.yoyo* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 2;
  switch (i) {
  case 1:
    printf("I am in case 1\n");
  case 2:
    printf("I am in case 2\n");
  case 3:
    printf("I am in case 3\n");
  default:
    printf("I am in default\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     115c <main+0x4c>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1168 <main+0x58>
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1174 <main+0x64>
jmp    1180 <main+0x70>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"I am in case 1\0A\00"
@.str.1 = [16 x i8] c"I am in case 2\0A\00"
@.str.2 = [16 x i8] c"I am in case 3\0A\00"
@.str.3 = [17 x i8] c"I am in default\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %0, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"I am in case 2\00"
@str.4 = [15 x i8] c"I am in case 3\00"
@str.5 = [16 x i8] c"I am in default\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
void diskmount(int id, char *disk) {}


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

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

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

LLVM IR (-O2):
define void @diskmount(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcreset(int);
bcinit() {
  int chan;
  for (chan = 0; chan < 8; ++chan)
    bcreset(chan);
}


x86 assembly (clang, -O0):
<bcinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    113f <bcinit+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <bcreset@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <bcinit+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcinit>:
push   %rax
xor    %edi,%edi
call   1030 <bcreset@plt>
mov    $0x1,%edi
call   1030 <bcreset@plt>
mov    $0x2,%edi
call   1030 <bcreset@plt>
mov    $0x3,%edi
call   1030 <bcreset@plt>
mov    $0x4,%edi
call   1030 <bcreset@plt>
mov    $0x5,%edi
call   1030 <bcreset@plt>
mov    $0x6,%edi
call   1030 <bcreset@plt>
mov    $0x7,%edi
pop    %rax
jmp    1030 <bcreset@plt>

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

LLVM IR (-O2):
define i32 @bcinit() {
%1 = tail call i32 @bcreset(i32 0)
%2 = tail call i32 @bcreset(i32 1)
%3 = tail call i32 @bcreset(i32 2)
%4 = tail call i32 @bcreset(i32 3)
%5 = tail call i32 @bcreset(i32 4)
%6 = tail call i32 @bcreset(i32 5)
%7 = tail call i32 @bcreset(i32 6)
%8 = tail call i32 @bcreset(i32 7)
ret i32 undef
}
/* Variables and functions */
long long stub1();
long long testClosureVrJ(long long (*closure)(void)) {
  return closure != NULL ? (*closure)() : (long long)0;
}


x86 assembly (clang, -O0):
<testClosureVrJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <testClosureVrJ+0x23>
call   *-0x8(%rbp)
mov    %rax,-0x10(%rbp)
jmp    112e <testClosureVrJ+0x2e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    112e <testClosureVrJ+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrJ>:
test   %rdi,%rdi
je     1107 <testClosureVrJ+0x7>
jmp    *%rdi
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @testClosureVrJ(i64 ()* %0) {
%2 = alloca i64 ()*
store i64 ()* %0, i64 ()** %2
%3 = load i64 ()*, i64 ()** %2
%4 = icmp ne i64 ()* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64 ()*, i64 ()** %2
%7 = call i64 %6()
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i64 [ %7, %5 ], [ 0, %8 ]
ret i64 %10
}

LLVM IR (-O2):
define i64 @testClosureVrJ(i64 ()* %0) {
%2 = icmp eq i64 ()* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 %0()
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ copy_and_print(char *, char *);
int main(int argc, char **argv) {
  char *string = NULL;
  copy_and_print(string, "hello world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <copy_and_print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <copy_and_print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @copy_and_print(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @copy_and_print(i8* null, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void yield(void) {}


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

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

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

LLVM IR (-O2):
define void @yield() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ un;
struct u_tag {
  char cval;
  int ival;
  float fval;
  char *sval;
};
typedef int /*<<< orphan*/ st;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, ...);
int main(void) {
  struct s_tag {
    char cval;
    int ival;
    float fval;
    char *sval;
    double dval;
  } st;
  union u_tag {
    char cval;
    int ival;
    float fval;
    char *sval;
  } un;
  printf("st=%d, un=%d\n", sizeof(st), sizeof(un));
  printf("%d,%d,%d,%d\n", sizeof(st.cval), sizeof(st.ival), sizeof(st.fval),
         sizeof(st.sval));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x20,%esi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x20,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    $0x1,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.s_tag = type { i8, i32, float, i8*, double }
%union.u_tag = type { i8* }
@.str = [14 x i8] c"st=%d, un=%d\0A\00"
@.str.1 = [13 x i8] c"%d,%d,%d,%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.s_tag
%3 = alloca %union.u_tag
store i32 0, i32* %1
%4 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 32, i32 8)
%5 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 4, i64 4, i64 8)
ret i32 0
}

LLVM IR (-O2):
%struct.s_tag = type { i8, i32, float, i8*, double }
@.str = [14 x i8] c"st=%d, un=%d\0A\00"
@.str.1 = [13 x i8] c"%d,%d,%d,%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 32, i32 8)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 4, i64 4, i64 8)
ret i32 0
}
/* Variables and functions */
int FUZ_GetMilliStart();
int FUZ_GetMilliSpan(int nTimeStart) {
  int nSpan = FUZ_GetMilliStart() - nTimeStart;
  if (nSpan < 0)
    nSpan += 0x100000 * 1000;
  return nSpan;
}


x86 assembly (clang, -O0):
<FUZ_GetMilliSpan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <FUZ_GetMilliStart@plt>
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    113d <FUZ_GetMilliSpan+0x2d>
mov    -0x8(%rbp),%eax
add    $0x3e800000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FUZ_GetMilliSpan>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <FUZ_GetMilliStart@plt>
sub    %ebx,%eax
lea    0x3e800000(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @FUZ_GetMilliSpan(i32 %0) {
%2 = tail call i32 (...) @FUZ_GetMilliStart()
%3 = sub nsw i32 %2, %0
%4 = icmp slt i32 %3, 0
%5 = add nsw i32 %3, 1048576000
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
/* Variables and functions */
int unsetenv(char const *);
int idris2_unsetenv(const char *name) { return unsetenv(name); }


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

x86 assembly (clang, -O2):
<idris2_unsetenv>:
jmp    1030 <unsetenv@plt>

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

LLVM IR (-O2):
define i32 @idris2_unsetenv(i8* nocapture %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret i32 %2
}
/* Variables and functions */
int canopen_sdo_download_exp(int, int, int, int /*<<< orphan*/, int,
                             int /*<<< orphan*/);
int set_max_speed_faulhaber(int sock, int node, int speed) {
  return canopen_sdo_download_exp(sock, node, 0x607F, 0, speed, 0);
}


x86 assembly (clang, -O0):
<set_max_speed_faulhaber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%r8d
mov    $0x607f,%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
call   1030 <canopen_sdo_download_exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_max_speed_faulhaber>:
mov    %edx,%r8d
mov    $0x607f,%edx
xor    %ecx,%ecx
xor    %r9d,%r9d
jmp    1030 <canopen_sdo_download_exp@plt>

LLVM IR (-O0):
define i32 @set_max_speed_faulhaber(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 = load i32, i32* %6
%10 = call i32 @canopen_sdo_download_exp(i32 %7, i32 %8, i32 24703, i32 0, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_max_speed_faulhaber(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @canopen_sdo_download_exp(i32 %0, i32 %1, i32 24703, i32 0, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int atoi(char *);
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
int parse(char *str) {
  char *word;
  word = strtok(str, " #");
  if (strcmp(word, "^") == 0) {
    word = strtok(NULL, " #");
    return (atoi(word));
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    118f <parse+0x5f>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe8b(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1196 <parse+0x66>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %rax
lea    0xec8(%rip),%rsi
call   1040 <strtok@plt>
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1158 <parse+0x28>
mov    $0xffffffff,%eax
pop    %rcx
ret
lea    0xea1(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %rax,%rdi
pop    %rax
jmp    1050 <atoi@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c" #\00"
@.str.1 = [2 x i8] c"^\00"
define i32 @parse(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ -1, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ mvwaddstr(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ raw();
int /*<<< orphan*/ wclrtoeol(int /*<<< orphan*/ *);
int /*<<< orphan*/ wgetch(int /*<<< orphan*/ *);
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void Continue(WINDOW *win) {
  wmove(win, 10, 1);
  wclrtoeol(win);
  mvwaddstr(win, 10, 1, " Press any key to continue");
  wrefresh(win);
  raw();
  wgetch(win);
}


x86 assembly (clang, -O0):
<Continue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wclrtoeol@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
lea    0xe63(%rip),%rcx
call   1080 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x0,%al
call   1050 <raw@plt>
mov    -0x8(%rbp),%rdi
call   1060 <wgetch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Continue>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    %rbx,%rdi
call   1030 <wclrtoeol@plt>
lea    0xe7e(%rip),%rcx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1,%edx
call   1080 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
xor    %eax,%eax
call   1050 <raw@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <wgetch@plt>

LLVM IR (-O0):
@.str = [27 x i8] c" Press any key to continue\00"
define void @Continue(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @wmove(i32* %3, i32 10, i32 1)
%5 = load i32*, i32** %2
%6 = call i32 @wclrtoeol(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @mvwaddstr(i32* %7, i32 10, i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %2
%10 = call i32 @wrefresh(i32* %9)
%11 = call i32 (...) @raw()
%12 = load i32*, i32** %2
%13 = call i32 @wgetch(i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c" Press any key to continue\00"
define void @Continue(i32* %0) {
%2 = tail call i32 @wmove(i32* %0, i32 10, i32 1)
%3 = tail call i32 @wclrtoeol(i32* %0)
%4 = tail call i32 @mvwaddstr(i32* %0, i32 10, i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @wrefresh(i32* %0)
%6 = tail call i32 (...) @raw()
%7 = tail call i32 @wgetch(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: mmap_sanity -d dir [-m dir2] [-e <test cases>]\n");
  printf("       -d dir        lustre mount point\n");
  printf("       -m dir2       another mount point\n");
  printf("       -e testcases  skipped test cases, -e 1 -e 2 to exclude"
         " test cases 1 and 2.\n");
  exit(127);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [55 x i8] c"Usage: mmap_sanity -d dir [-m dir2] [-e <test cases>]\0A\00"
@.str.1 = [41 x i8] c" -d dir lustre mount point\0A\00"
@.str.2 = [42 x i8] c" -m dir2 another mount point\0A\00"
@.str.3 = [83 x i8] c" -e testcases skipped test cases, -e 1 -e 2 to exclude test cases 1 and 2.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
@str = [54 x i8] c"Usage: mmap_sanity -d dir [-m dir2] [-e <test cases>]\00"
@str.4 = [40 x i8] c" -d dir lustre mount point\00"
@str.5 = [41 x i8] c" -m dir2 another mount point\00"
@str.6 = [82 x i8] c" -e testcases skipped test cases, -e 1 -e 2 to exclude test cases 1 and 2.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 127)
unreachable
}
double sa_vi(double redchan, double nirchan) {
  double result;
  if ((nirchan + redchan) == 0.0) {
    result = -1.0;
  } else {
    result = ((1 + 0.5) * (nirchan - redchan)) / (nirchan + redchan + 0.5);
  }
  return result;
}


x86 assembly (clang, -O0):
<sa_vi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113d <sa_vi+0x3d>
jp     113d <sa_vi+0x3d>
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1172 <sa_vi+0x72>
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xeb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xe9b(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sa_vi>:
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jne    111d <sa_vi+0x1d>
jp     111d <sa_vi+0x1d>
movsd  0xee4(%rip),%xmm0
ret
subsd  %xmm0,%xmm1
mulsd  0xedf(%rip),%xmm1
addsd  0xedf(%rip),%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sa_vi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fadd double %6, %7
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %2
store double -1.000000e+00, double* %5
br label %21
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fsub double %12, %13
%15 = fmul double 1.500000e+00, %14
%16 = load double, double* %4
%17 = load double, double* %3
%18 = fadd double %16, %17
%19 = fadd double %18, 5.000000e-01
%20 = fdiv double %15, %19
store double %20, double* %5
br label %21
21: ; preds = %11, %10
%22 = load double, double* %5
ret double %22
}

LLVM IR (-O2):
define double @sa_vi(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = fsub double %1, %0
%7 = fmul double %6, 1.500000e+00
%8 = fadd double %3, 5.000000e-01
%9 = fdiv double %7, %8
br label %10
10: ; preds = %2, %5
%11 = phi double [ %9, %5 ], [ -1.000000e+00, %2 ]
ret double %11
}
int myshortcmp(const void *s1, const void *s2) {
  short val1 = *((short *)s1);
  short val2 = *((short *)s2);
  if (val1 < val2) {
    return -1;
  } else if (val1 > val2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<myshortcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
movswl -0x1a(%rbp),%eax
movswl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    113e <myshortcmp+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <myshortcmp+0x61>
movswl -0x1a(%rbp),%eax
movswl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jle    115a <myshortcmp+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <myshortcmp+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myshortcmp>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%ax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @myshortcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i16*
%10 = load i16, i16* %9
store i16 %10, i16* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i16*
%13 = load i16, i16* %12
store i16 %13, i16* %7
%14 = load i16, i16* %6
%15 = sext i16 %14 to i32
%16 = load i16, i16* %7
%17 = sext i16 %16 to i32
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %28
20: ; preds = %2
%21 = load i16, i16* %6
%22 = sext i16 %21 to i32
%23 = load i16, i16* %7
%24 = sext i16 %23 to i32
%25 = icmp sgt i32 %22, %24
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 1, i32* %3
br label %28
27: ; preds = %20
store i32 0, i32* %3
br label %28
28: ; preds = %27, %26, %19
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @myshortcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp slt i16 %4, %6
%8 = icmp sgt i16 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void swapInt(int *a, int *b) {
  int tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<swapInt>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swapInt(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
int ath11k_debugfs_htt_stats_req(struct ath11k *ar) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ath11k = type opaque
define i32 @ath11k_debugfs_htt_stats_req(%struct.ath11k* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *_FAT_mem_allocate(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<_FAT_mem_allocate>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @_FAT_mem_allocate(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void Sys_Print(const char *msg) { fputs(msg, stdout); }


x86 assembly (clang, -O0):
<Sys_Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_Print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @Sys_Print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @Sys_Print(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
void WidgetMutexInit(unsigned char *pcMutex) {
  ;
  *pcMutex = 0;
}


x86 assembly (clang, -O0):
<WidgetMutexInit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WidgetMutexInit>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @WidgetMutexInit(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int getint(void) {
  int answer;
  printf("Please enter a positive integer [<=0 to terminate] : ");
  scanf("%d", &answer);
  return answer;
}


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

x86 assembly (clang, -O2):
<getint>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Please enter a positive integer [<=0 to terminate] : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getint() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [54 x i8] c"Please enter a positive integer [<=0 to terminate] : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getint() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int real_main(int, char **, char **);
int reimp_main(int argc, char **argv, char **envp) {
  int n;
  n = real_main(argc, argv, envp);
  exit(n);
  return 122;
}


x86 assembly (clang, -O0):
<reimp_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <real_main@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<reimp_main>:
push   %rax
call   1030 <real_main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @reimp_main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = load i8**, i8*** %6
%11 = call i32 @real_main(i32 %8, i8** %9, i8** %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
define i32 @reimp_main(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @real_main(i32 %0, i8** %1, i8** %2)
%5 = tail call i32 @exit(i32 %4)
unreachable
}