xunge/DecIR huggingface dataset:
double Fdmira(x, p)
double x, p;
{
  static double z;
  return ((4.0 * (1.0 - p) * x) / ((1.0 + z) * (1.0 + z)));
}


x86 assembly (clang, -O0):
<Fdmira>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xee5(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
addsd  0x2eec(%rip),%xmm1
movsd  0xebc(%rip),%xmm2
addsd  0x2edc(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fdmira>:
movsd  0xef8(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  0xef4(%rip),%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
@Fdmira.z = internal global double 0.000000e+00
define double @Fdmira(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 = fsub double 1.000000e+00, %5
%7 = fmul double 4.000000e+00, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* @Fdmira.z
%11 = fadd double 1.000000e+00, %10
%12 = load double, double* @Fdmira.z
%13 = fadd double 1.000000e+00, %12
%14 = fmul double %11, %13
%15 = fdiv double %9, %14
ret double %15
}

LLVM IR (-O2):
define double @Fdmira(double %0, double %1) {
%3 = fsub double 1.000000e+00, %1
%4 = fmul double %3, 4.000000e+00
%5 = fmul double %4, %0
ret double %5
}
long minl(long int a, long int b) {
  if (a < b)
    return (a);
  else
    return (b);
}


x86 assembly (clang, -O0):
<minl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <minl+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <minl+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minl>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @minl(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t xL(uint64_t x) {
  uint32_t maxVal = 0xffffffff;
  return x & (uint64_t)maxVal;
}


x86 assembly (clang, -O0):
<xL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xL(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = and i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @xL(i32 returned %0) {
ret i32 %0
}
int test_imm_24int32_reg(int val) { return ((val) & (0x24 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_24int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x24,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_24int32_reg(i32 %0) {
%2 = and i32 %0, 36
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ jack_sysex_set_timeout(int);
void avr_api_set_timeout(int timeout) { jack_sysex_set_timeout(timeout); }


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

x86 assembly (clang, -O2):
<avr_api_set_timeout>:
jmp    1030 <jack_sysex_set_timeout@plt>

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

LLVM IR (-O2):
define void @avr_api_set_timeout(i32 %0) {
%2 = tail call i32 @jack_sysex_set_timeout(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ EBADF;
int /*<<< orphan*/ F_GETFL;
scalar_t__ errno;
scalar_t__ fcntl(int, int /*<<< orphan*/);
int dx_file_is_closed(int fd) {
  return fcntl(fd, F_GETFL) < 0 && errno == EBADF;
}


x86 assembly (clang, -O0):
<dx_file_is_closed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jge    1158 <dx_file_is_closed+0x48>
mov    0x2e9b(%rip),%rax
mov    (%rax),%rax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dx_file_is_closed>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
test   %rax,%rax
sets   %al
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e9a(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@errno = global i64 0
@EBADF = global i64 0
define i32 @dx_file_is_closed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_GETFL
%5 = call i64 @fcntl(i32 %3, i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* @errno
%9 = load i64, i64* @EBADF
%10 = icmp eq i64 %8, %9
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@errno = global i64 0
@EBADF = global i64 0
define i32 @dx_file_is_closed(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i64 @fcntl(i32 %0, i32 %2)
%4 = icmp slt i64 %3, 0
%5 = load i64, i64* @errno
%6 = load i64, i64* @EBADF
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
void fa69(int n) {
  {
    int b[n];
  a : {
    int c[n];
    0;
  }
    {
      int d[n];
      goto a;
      0;
    };
    int e[n];
    0;
  };
  {
    int f[n];
    {
      int g[n];
      0;
    };
    {
      int h[n];
      0;
    };
    ;
    int i[n];
    0;
  };
  ;
  int j[n];
  0;
}


x86 assembly (clang, -O0):
<fa69>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
jmp    111c <fa69+0x1c>

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

LLVM IR (-O0):
define void @fa69(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
store i32 %0, i32* %2
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %3
%22 = alloca i32, i64 %20
store i64 %20, i64* %4
br label %23
23: ; preds = %23, %1
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
%26 = call i8* @llvm.stacksave()
store i8* %26, i8** %5
%27 = alloca i32, i64 %25
store i64 %25, i64* %6
%28 = load i8*, i8** %5
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
%31 = call i8* @llvm.stacksave()
store i8* %31, i8** %7
%32 = alloca i32, i64 %30
store i64 %30, i64* %8
%33 = load i8*, i8** %7
br label %23
34: ; No predecessors!
%35 = load i32, i32* %2
%36 = zext i32 %35 to i64
%37 = alloca i32, i64 %36
store i64 %36, i64* %9
%38 = load i8*, i8** %3
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
%41 = call i8* @llvm.stacksave()
store i8* %41, i8** %10
%42 = alloca i32, i64 %40
store i64 %40, i64* %11
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
%45 = call i8* @llvm.stacksave()
store i8* %45, i8** %12
%46 = alloca i32, i64 %44
store i64 %44, i64* %13
%47 = load i8*, i8** %12
%48 = load i32, i32* %2
%49 = zext i32 %48 to i64
%50 = call i8* @llvm.stacksave()
store i8* %50, i8** %14
%51 = alloca i32, i64 %49
store i64 %49, i64* %15
%52 = load i8*, i8** %14
%53 = load i32, i32* %2
%54 = zext i32 %53 to i64
%55 = alloca i32, i64 %54
store i64 %54, i64* %16
%56 = load i8*, i8** %10
%57 = load i32, i32* %2
%58 = zext i32 %57 to i64
%59 = call i8* @llvm.stacksave()
store i8* %59, i8** %17
%60 = alloca i32, i64 %58
store i64 %58, i64* %18
%61 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @fa69(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int Mytop(uintptr_t);
int Mytop2(uintptr_t);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Physical Address:%u\n", Mytop((uintptr_t)3213076264));
  printf("Physical Address:%u\n", Mytop2((uintptr_t)3213076264));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf83a728,%edi
call   1030 <Mytop@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0xbf83a728,%edi
call   1050 <Mytop2@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xbf83a728,%edi
call   1030 <Mytop@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xbf83a728,%edi
call   1050 <Mytop2@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Physical Address:%u\0A\00"
define i32 @main() {
%1 = call i32 @Mytop(i64 3213076264)
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @Mytop2(i64 3213076264)
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Physical Address:%u\0A\00"
define i32 @main() {
%1 = tail call i32 @Mytop(i64 3213076264)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @Mytop2(i64 3213076264)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_read_byte(int /*<<< orphan*/ *);
uint8_t eeconfig_read_default_layer(void) {
  return eeprom_read_byte((uint8_t *)3);
}


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

x86 assembly (clang, -O2):
<eeconfig_read_default_layer>:
mov    $0x3,%edi
jmp    1030 <eeprom_read_byte@plt>

LLVM IR (-O0):
define i32 @eeconfig_read_default_layer() {
%1 = call i32 @eeprom_read_byte(i32* inttoptr (i64 3 to i32*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @eeconfig_read_default_layer() {
%1 = tail call i32 @eeprom_read_byte(i32* inttoptr (i64 3 to i32*))
ret i32 %1
}
void INT_TM03H(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_TM03H() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
uint32_t get_timestamp_s(void) {
  struct timeval tv;
  int ret;
  ret = gettimeofday(&tv, NULL);
  if (ret == -1)
    perror("gettimeofday");
  return tv.tv_sec;
}


x86 assembly (clang, -O0):
<get_timestamp_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    114e <get_timestamp_s+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timestamp_s>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cmp    $0xffffffff,%eax
je     1135 <get_timestamp_s+0x15>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xec4(%rip),%rdi
call   1040 <perror@plt>
jmp    1130 <get_timestamp_s+0x10>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"gettimeofday\00"
define i32 @get_timestamp_s() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"gettimeofday\00"
define i32 @get_timestamp_s() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
}
void caller_1_2_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_1_2_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ec_terminate_alarm();
void ec_os_fini(void) { ec_terminate_alarm(); }


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

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

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

LLVM IR (-O2):
define void @ec_os_fini() {
%1 = tail call i32 (...) @ec_terminate_alarm()
ret void
}
/* Variables and functions */
unsigned long inb(int);
unsigned long inl(int);
unsigned long inw(int);
unsigned long inx(int addr, int width) {
  switch (width) {
  case 2:
    return inw(addr);
    break;
  case 4:
    return inl(addr);
    break;
  default:
    return inb(addr);
  }
}


x86 assembly (clang, -O0):
<inx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x2,%eax
je     1163 <inx+0x33>
jmp    1152 <inx+0x22>
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
je     1174 <inx+0x44>
jmp    1185 <inx+0x55>
mov    -0xc(%rbp),%edi
call   1030 <inw@plt>
mov    %rax,-0x8(%rbp)
jmp    1191 <inx+0x61>
mov    -0xc(%rbp),%edi
call   1050 <inl@plt>
mov    %rax,-0x8(%rbp)
jmp    1191 <inx+0x61>
mov    -0xc(%rbp),%edi
call   1040 <inb@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inx>:
cmp    $0x4,%esi
je     113f <inx+0xf>
cmp    $0x2,%esi
jne    1144 <inx+0x14>
jmp    1030 <inw@plt>
jmp    1050 <inl@plt>
jmp    1040 <inb@plt>

LLVM IR (-O0):
define i64 @inx(i32 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %13 [
i32 2, label %7
i32 4, label %10
]
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i64 @inw(i32 %8)
store i64 %9, i64* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i64 @inl(i32 %11)
store i64 %12, i64* %3
br label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = call i64 @inb(i32 %14)
store i64 %15, i64* %3
br label %16
16: ; preds = %13, %10, %7
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @inx(i32 %0, i32 %1) {
switch i32 %1, label %7 [
i32 2, label %3
i32 4, label %5
]
3: ; preds = %2
%4 = tail call i64 @inw(i32 %0)
br label %9
5: ; preds = %2
%6 = tail call i64 @inl(i32 %0)
br label %9
7: ; preds = %2
%8 = tail call i64 @inb(i32 %0)
br label %9
9: ; preds = %7, %5, %3
%10 = phi i64 [ %8, %7 ], [ %6, %5 ], [ %4, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ IF_fct_2(char);
void IF_Linf(void) { IF_fct_2('<'); }


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

x86 assembly (clang, -O2):
<IF_Linf>:
mov    $0x3c,%edi
jmp    1030 <IF_fct_2@plt>

LLVM IR (-O0):
define void @IF_Linf() {
%1 = call i32 @IF_fct_2(i8 signext 60)
ret void
}

LLVM IR (-O2):
define void @IF_Linf() {
%1 = tail call i32 @IF_fct_2(i8 signext 60)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *getenv(char *);
char *db_default_gln_dir() {
  char *hm = getenv("HOME");
  if (hm == NULL)
    err(1, "failed to get $HOME");
  return hm;
}


x86 assembly (clang, -O0):
<db_default_gln_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee0(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1154 <db_default_gln_dir+0x34>
mov    $0x1,%edi
lea    0xeb1(%rip),%rsi
call   1040 <err@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_default_gln_dir>:
push   %rbx
lea    0xee7(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <db_default_gln_dir+0x26>
lea    0xec4(%rip),%rsi
mov    $0x1,%edi
call   1040 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [20 x i8] c"failed to get $HOME\00"
define i8* @db_default_gln_dir() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @err(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [20 x i8] c"failed to get $HOME\00"
define i8* @db_default_gln_dir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i8* %1
}
int nan_ne_assign(double x) {
  volatile double y = x;
  volatile double z = y;
  int rc;
  rc = (y != z);
  return rc;
}


x86 assembly (clang, -O0):
<nan_ne_assign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nan_ne_assign>:
movsd  %xmm0,-0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
movsd  %xmm0,-0x8(%rsp)
movsd  -0x10(%rsp),%xmm0
cmpneqsd -0x8(%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nan_ne_assign(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %2
%6 = load double, double* %2
store volatile double %6, double* %3
%7 = load volatile double, double* %3
store volatile double %7, double* %4
%8 = load volatile double, double* %3
%9 = load volatile double, double* %4
%10 = fcmp une double %8, %9
%11 = zext i1 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @nan_ne_assign(double %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
store volatile double %0, double* %2
%5 = bitcast double* %3 to i8*
%6 = load volatile double, double* %2
store volatile double %6, double* %3
%7 = load volatile double, double* %2
%8 = load volatile double, double* %3
%9 = fcmp une double %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: setpci [<options>] (<device>+ "
          "<reg>[=<values>]*)*\n-f\t\tDon't complain if there's nothing to "
          "do\n-v\t\tBe verbose\n-D\t\tList changes, don't commit them\n"
          "-G\t\tEnable PCI access debugging\n"
          "<device>:\t-s [[<bus>]:][<slot>][.[<func>]]\n\t|\t-d "
          "[<vendor>]:[<device>]\n<reg>:\t\t<number>[.(B|W|L)]\n     "
          "|\t\t<name>\n<values>:\t<value>[,<value>...]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [329 x i8] c"Usage: setpci [<options>] (<device>+ <reg>[=<values>]*)*\0A-f\09\09Don't complain if there's nothing to do\0A-v\09\09Be verbose\0A-D\09\09List changes, don't commit them\0A-G\09\09Enable PCI access debugging\0A<device>:\09-s [[<bus>]:][<slot>][.[<func>]]\0A\09|\09-d [<vendor>]:[<device>]\0A<reg>:\09\09<number>[.(B|W|L)]\0A |\09\09<name>\0A<values>:\09<value>[,<value>...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [329 x i8] c"Usage: setpci [<options>] (<device>+ <reg>[=<values>]*)*\0A-f\09\09Don't complain if there's nothing to do\0A-v\09\09Be verbose\0A-D\09\09List changes, don't commit them\0A-G\09\09Enable PCI access debugging\0A<device>:\09-s [[<bus>]:][<slot>][.[<func>]]\0A\09|\09-d [<vendor>]:[<device>]\0A<reg>:\09\09<number>[.(B|W|L)]\0A |\09\09<name>\0A<values>:\09<value>[,<value>...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double sqrt(double);
double hypotenuse(double a, double b) { return sqrt(a * a + b * b); }


x86 assembly (clang, -O0):
<hypotenuse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypotenuse>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <hypotenuse+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @hypotenuse(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @hypotenuse(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
long max0(long x) { return x & ~(x >> (32 - 1)); }


x86 assembly (clang, -O0):
<max0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sar    $0x1f,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max0>:
mov    %rdi,%rax
sar    $0x1f,%rax
not    %rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max0(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = ashr i64 %4, 31
%6 = xor i64 %5, -1
%7 = and i64 %3, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @max0(i64 %0) {
%2 = ashr i64 %0, 31
%3 = xor i64 %2, -1
%4 = and i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
signed int puts(const char *pStr) { return fputs(pStr, stdout); }


x86 assembly (clang, -O0):
<puts>:
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):
<puts>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @puts(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 i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ galois_arch_reset(char, char const *);
void arch_reset(char mode, const char *cmd) { galois_arch_reset(mode, cmd); }


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <galois_arch_reset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_reset>:
jmp    1030 <galois_arch_reset@plt>

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

LLVM IR (-O2):
define void @arch_reset(i8 signext %0, i8* %1) {
%3 = tail call i32 @galois_arch_reset(i8 signext %0, i8* %1)
ret void
}
unsigned xrop3_29_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ D;
  stk2 = S & stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_29_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_29_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_29_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %5
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_29_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -256
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  while (x >= 0) {
    y = y - 1;
    if (y < 0) {
      x = x - 1;
      y = __VERIFIER_nondet_int();
    }
    if (y < 0) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1163 <main+0x53>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114f <main+0x3f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115e <main+0x4e>
jmp    1163 <main+0x53>
jmp    111f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
sub    $0x1,%eax
jae    112f <main+0x1f>
add    $0xffffffff,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     1137 <main+0x27>
test   %ebx,%ebx
jns    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %20, %0
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %2
%15 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %7
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
br label %21
20: ; preds = %16
br label %4
21: ; preds = %19, %4
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %9
%2 = phi i32 [ undef, %0 ], [ %10, %9 ]
%3 = phi i32 [ undef, %0 ], [ %11, %9 ]
%4 = add nsw i32 %3, -1
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = add nsw i32 %2, -1
%8 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %9
9: ; preds = %6, %1
%10 = phi i32 [ %7, %6 ], [ %2, %1 ]
%11 = phi i32 [ %8, %6 ], [ %4, %1 ]
%12 = icmp sgt i32 %11, -1
%13 = icmp sgt i32 %10, -1
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %1, label %15
15: ; preds = %9
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_number_of_quaddobl_solutions(int *length) {
  int *a, fail;
  double *c;
  fail = _ada_use_c2phc(392, a, length, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<solcon_number_of_quaddobl_solutions>:
mov    %rdi,%rdx
mov    $0x188,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_number_of_quaddobl_solutions(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %3
%7 = load i32*, i32** %2
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 392, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_number_of_quaddobl_solutions(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 392, i32* undef, i32* %0, double* undef)
ret i32 %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_IFCHR;
int _fstat(int file, struct stat *st) {
  (void)(file);
  st->st_mode = S_IFCHR;
  return 0;
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @S_IFCHR
%7 = load %struct.stat*, %struct.stat** %4
%8 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
store i32 %6, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* nocapture writeonly %1) {
%3 = load i32, i32* @S_IFCHR
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
store i32 %3, i32* %4
ret i32 0
}
long intval(vp)
struct tbl *vp;
{
  long num;
  int base;
  base = getint(vp, &num);
  if (base == -1)
    errorf("%s: bad number", str_val(vp));
  return num;
}


x86 assembly (clang, -O0):
<intval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <getint@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1173 <intval+0x43>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <str_val@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1050 <errorf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intval>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <getint@plt>
cmp    $0xffffffff,%eax
jne    1163 <intval+0x33>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <str_val@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <errorf@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tbl = type opaque
@.str = [15 x i8] c"%s: bad number\00"
define i64 @intval(%struct.tbl* %0) {
%2 = alloca %struct.tbl*
%3 = alloca i64
%4 = alloca i32
store %struct.tbl* %0, %struct.tbl** %2
%5 = load %struct.tbl*, %struct.tbl** %2
%6 = call i32 (%struct.tbl*, i64*, ...) bitcast (i32 (...)* @getint to i32 (%struct.tbl*, i64*, ...)*)(%struct.tbl* %5, i64* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load %struct.tbl*, %struct.tbl** %2
%11 = call i32 (%struct.tbl*, ...) bitcast (i32 (...)* @str_val to i32 (%struct.tbl*, ...)*)(%struct.tbl* %10)
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @errorf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %1
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
%struct.tbl = type opaque
@.str = [15 x i8] c"%s: bad number\00"
define i64 @intval(%struct.tbl* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 (%struct.tbl*, i64*, ...) bitcast (i32 (...)* @getint to i32 (%struct.tbl*, i64*, ...)*)(%struct.tbl* %0, i64* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (%struct.tbl*, ...) bitcast (i32 (...)* @str_val to i32 (%struct.tbl*, ...)*)(%struct.tbl* %0)
%8 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @errorf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %2
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char const *);
void append_nickname(const char *nickname, char *src, char *dst) {
  int n;
  n = strlen(nickname);
  if (n > 0) {
    sprintf(dst, "%s_%s", nickname, src);
  } else {
    strcpy(dst, src);
  }
}


x86 assembly (clang, -O0):
<append_nickname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1177 <append_nickname+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe93(%rip),%rsi
call   1050 <sprintf@plt>
jmp    1184 <append_nickname+0x54>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_nickname>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <append_nickname+0x31>
lea    0xeb2(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s_%s\00"
define void @append_nickname(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
br label %21
17: ; preds = %3
%18 = load i8*, i8** %6
%19 = load i8*, i8** %5
%20 = call i32 @strcpy(i8* %18, i8* %19)
br label %21
21: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s_%s\00"
define void @append_nickname(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %10
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %2, i8* %1)
br label %10
10: ; preds = %8, %6
ret void
}
int main() {
  unsigned int a = 1;
  int b = 0x1234 << 2;
  a = a >> 1 >> 0;
  a = b >> a;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x48d0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
shr    $0x0,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 18640, i32* %3
%4 = load i32, i32* %2
%5 = lshr i32 %4, 1
%6 = lshr i32 %5, 0
store i32 %6, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = ashr i32 %7, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 18640
}
/* Variables and functions */
int /*<<< orphan*/ freeze(int);
int /*<<< orphan*/ move_stop(int, int, int, int);
int /*<<< orphan*/ say(char *, int);
int /*<<< orphan*/ sp_dir(int, int);
int /*<<< orphan*/ unfreeze(int);
void touch(void) {
  freeze(1);
  move_stop(1, 4, 300, 1);
  sp_dir(1, 6);
  say("It's locked.", 1);
  unfreeze(1);
}


x86 assembly (clang, -O0):
<touch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <freeze@plt>
mov    $0x1,%ecx
mov    $0x4,%esi
mov    $0x12c,%edx
mov    %ecx,%edi
call   1060 <move_stop@plt>
mov    $0x1,%edi
mov    $0x6,%esi
call   1030 <sp_dir@plt>
lea    0xe76(%rip),%rdi
mov    $0x1,%esi
call   1070 <say@plt>
mov    $0x1,%edi
call   1050 <unfreeze@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<touch>:
push   %rax
mov    $0x1,%edi
call   1040 <freeze@plt>
mov    $0x1,%edi
mov    $0x4,%esi
mov    $0x12c,%edx
mov    $0x1,%ecx
call   1060 <move_stop@plt>
mov    $0x1,%edi
mov    $0x6,%esi
call   1030 <sp_dir@plt>
lea    0xe76(%rip),%rdi
mov    $0x1,%esi
call   1070 <say@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <unfreeze@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"It's locked.\00"
define void @touch() {
%1 = call i32 @freeze(i32 1)
%2 = call i32 @move_stop(i32 1, i32 4, i32 300, i32 1)
%3 = call i32 @sp_dir(i32 1, i32 6)
%4 = call i32 @say(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = call i32 @unfreeze(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"It's locked.\00"
define void @touch() {
%1 = tail call i32 @freeze(i32 1)
%2 = tail call i32 @move_stop(i32 1, i32 4, i32 300, i32 1)
%3 = tail call i32 @sp_dir(i32 1, i32 6)
%4 = tail call i32 @say(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @unfreeze(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, int *, int);
void setI4(unsigned char *p, int i) { memcpy(p, &i, 4); }


x86 assembly (clang, -O0):
<setI4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setI4>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @setI4(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int read_exact(char *, int);
int read_cmd(char *buf) {
  int len;
  if (read_exact(buf, 2) != 2)
    return (-1);
  len = (buf[0] << 8) | buf[1];
  return read_exact(buf, len);
}


x86 assembly (clang, -O0):
<read_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <read_exact@plt>
cmp    $0x2,%eax
je     113f <read_cmd+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <read_cmd+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <read_exact@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cmd>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%esi
call   1030 <read_exact@plt>
cmp    $0x2,%eax
jne    1138 <read_cmd+0x28>
movsbl (%rbx),%eax
shl    $0x8,%eax
movsbl 0x1(%rbx),%esi
or     %eax,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <read_exact@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @read_cmd(i8* %0) {
%2 = tail call i32 @read_exact(i8* %0, i32 2)
%3 = icmp eq i32 %2, 2
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = or i32 %7, %10
%12 = tail call i32 @read_exact(i8* %0, i32 %11)
br label %13
13: ; preds = %1, %4
%14 = phi i32 [ %12, %4 ], [ -1, %1 ]
ret i32 %14
}
short isPositive(short n) {
  if (n < 0) {
    return 0;
  } else if (n > 0) {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isPositive>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jge    1123 <isPositive+0x23>
movw   $0x0,-0x2(%rbp)
jmp    1140 <isPositive+0x40>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jle    113b <isPositive+0x3b>
movw   $0x1,-0x2(%rbp)
jmp    1140 <isPositive+0x40>
jmp    1140 <isPositive+0x40>
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPositive>:
not    %edi
movzwl %di,%eax
shr    $0xf,%eax
ret

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

LLVM IR (-O2):
define signext i16 @isPositive(i16 signext %0) {
%2 = xor i16 %0, -1
%3 = lshr i16 %2, 15
ret i16 %3
}
/* Variables and functions */
float asin(float);
float Float_asin(float x) { return asin(x); }


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

x86 assembly (clang, -O2):
<Float_asin>:
jmp    1030 <asin@plt>

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

LLVM IR (-O2):
define float @Float_asin(float %0) {
%2 = tail call float @asin(float %0)
ret float %2
}
void UI_OpenSSL(void) {}


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

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

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

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