xunge/DecIR huggingface dataset:
int main() {
  int a = 10;
  int b = 20;
  int result;
  asm("cmp %1, %2\n\t"
      "jge 0f\n\t"
      "movl %1, %0\n\t"
      "jmp 1f\n"
      "0:\n\t"
      "movl %2, %0\n"
      "1:"
      : "=r"(result)
      : "r"(a), "r"(b));
  printf("The larger value is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
cmp    %eax,%ecx
jge    1142 <main+0x32>
mov    %eax,%eax
jmp    1144 <main+0x34>
mov    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%eax
mov    $0x14,%ecx
cmp    %eax,%ecx
jge    1123 <main+0x13>
mov    %eax,%esi
jmp    1125 <main+0x15>
mov    %ecx,%esi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"The larger value is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm "cmp $1, $2\0A\09jge 0f\0A\09movl $1, $0\0A\09jmp 1f\0A0:\0A\09movl $2, $0\0A1:", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The larger value is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm "cmp $1, $2\0A\09jge 0f\0A\09movl $1, $0\0A\09jmp 1f\0A0:\0A\09movl $2, $0\0A1:", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write_pwm(int);
void adjust_fan(uint32_t pwm) {
  static uint32_t value = 0x3ff;
  if (value == pwm)
    return;
  value = pwm;
  if (value < 0)
    value = 0;
  if (value > 0x3ff)
    value = 0x3ff;
  write_pwm(value);
}


x86 assembly (clang, -O0):
<adjust_fan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f07(%rip),%eax
cmp    -0x4(%rbp),%eax
jne    112f <adjust_fan+0x1f>
jmp    1174 <adjust_fan+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,0x2ef0(%rip)
cmpl   $0x0,0x2ee9(%rip)
jge    114f <adjust_fan+0x3f>
movl   $0x0,0x2ed9(%rip)
cmpl   $0x3ff,0x2ecf(%rip)
jle    1169 <adjust_fan+0x59>
movl   $0x3ff,0x2ebf(%rip)
mov    0x2eb9(%rip),%edi
call   1030 <write_pwm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_fan>:
cmp    %edi,0x2f12(%rip)
jne    1119 <adjust_fan+0x9>
ret
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
cmp    $0x3ff,%eax
mov    $0x3ff,%edi
cmovb  %eax,%edi
mov    %edi,0x2ef5(%rip)
jmp    1030 <write_pwm@plt>

LLVM IR (-O0):
@adjust_fan.value = internal global i32 1023
define void @adjust_fan(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @adjust_fan.value
%4 = load i32, i32* %2
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %1
br label %19
7: ; preds = %1
%8 = load i32, i32* %2
store i32 %8, i32* @adjust_fan.value
%9 = load i32, i32* @adjust_fan.value
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* @adjust_fan.value
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* @adjust_fan.value
%14 = icmp sgt i32 %13, 1023
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1023, i32* @adjust_fan.value
br label %16
16: ; preds = %15, %12
%17 = load i32, i32* @adjust_fan.value
%18 = call i32 @write_pwm(i32 %17)
br label %19
19: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@adjust_fan.value = internal unnamed_addr global i32 1023
define void @adjust_fan(i32 %0) {
%2 = load i32, i32* @adjust_fan.value
%3 = icmp eq i32 %2, %0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = icmp sgt i32 %0, 0
%6 = select i1 %5, i32 %0, i32 0
%7 = icmp ult i32 %6, 1023
%8 = select i1 %7, i32 %6, i32 1023
store i32 %8, i32* @adjust_fan.value
%9 = tail call i32 @write_pwm(i32 %8)
br label %10
10: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ x(void *);
int main() {
  long i;
  for (i = 0; i < 5; i++)
    if (i > 0)
      x((void *)(i - 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x5,-0x10(%rbp)
jge    1160 <main+0x50>
cmpq   $0x0,-0x10(%rbp)
jle    114a <main+0x3a>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <x@plt>
jmp    114f <main+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <x@plt>
mov    $0x1,%edi
call   1030 <x@plt>
mov    $0x2,%edi
call   1030 <x@plt>
mov    $0x3,%edi
call   1030 <x@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @x(i8* null)
%2 = tail call i32 @x(i8* inttoptr (i64 1 to i8*))
%3 = tail call i32 @x(i8* inttoptr (i64 2 to i8*))
%4 = tail call i32 @x(i8* inttoptr (i64 3 to i8*))
ret i32 0
}
/* Type definitions */
struct UPort {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ digisparkBufferFlush(struct UPort *, int);
void DigisparkFlush(struct UPort *up) { digisparkBufferFlush(up, 0x04); }


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

x86 assembly (clang, -O2):
<DigisparkFlush>:
mov    $0x4,%esi
jmp    1030 <digisparkBufferFlush@plt>

LLVM IR (-O0):
%struct.UPort = type { i32 }
define void @DigisparkFlush(%struct.UPort* %0) {
%2 = alloca %struct.UPort*
store %struct.UPort* %0, %struct.UPort** %2
%3 = load %struct.UPort*, %struct.UPort** %2
%4 = call i32 @digisparkBufferFlush(%struct.UPort* %3, i32 4)
ret void
}

LLVM IR (-O2):
%struct.UPort = type { i32 }
define void @DigisparkFlush(%struct.UPort* %0) {
%2 = tail call i32 @digisparkBufferFlush(%struct.UPort* %0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *smm_free(void *ptr) {
  free(ptr);
  return NULL;
}


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

x86 assembly (clang, -O2):
<smm_free>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @smm_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i8* null
}
/* Variables and functions */
int malloc_trim(size_t pad) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @malloc_trim(i64 %0) {
ret i32 1
}
void ble_evt_attclient_indicated(
    const struct ble_msg_attclient_indicated_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attclient_indicated_evt_t = type opaque
define void @ble_evt_attclient_indicated(%struct.ble_msg_attclient_indicated_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int INT32_MAX;
int random();
int xrand(int min, int max) {
  return (int)(random() * (max - min + 0.5) / INT32_MAX + min);
}


x86 assembly (clang, -O0):
<xrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xec5(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    0x2e96(%rip),%rax
cvtsi2sdl (%rax),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %eax,%xmm0
sub    %ebp,%ebx
cvtsi2sd %ebx,%xmm1
addsd  0xed0(%rip),%xmm1
mulsd  %xmm0,%xmm1
mov    0x2ea5(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
cvtsi2sd %ebp,%xmm2
divsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@INT32_MAX = global i32 0
define i32 @xrand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @random()
%6 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 5.000000e-01
%12 = fmul double %6, %11
%13 = load i32, i32* @INT32_MAX
%14 = sitofp i32 %13 to double
%15 = fdiv double %12, %14
%16 = load i32, i32* %3
%17 = sitofp i32 %16 to double
%18 = fadd double %15, %17
%19 = fptosi double %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@INT32_MAX = global i32 0
define i32 @xrand(i32 %0, i32 %1) {
%3 = tail call i32 (...) @random()
%4 = sitofp i32 %3 to double
%5 = sub nsw i32 %1, %0
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fmul double %7, %4
%9 = load i32, i32* @INT32_MAX
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = sitofp i32 %0 to double
%13 = fadd double %11, %12
%14 = fptosi double %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ disable_interrupts();
int /*<<< orphan*/ term_printf(char *, char const *, char const *, int,
                               char const *);
void assert(const char *asserted_expr, const char *filename, const char *func,
            int line) {
  term_printf("\nFailed assert at %s, %s:%d\n %s", filename, func, line,
              asserted_expr);
  disable_interrupts();
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb3(%rip),%rdi
call   1030 <term_printf@plt>
mov    $0x0,%al
call   1040 <disable_interrupts@plt>
jmp    1159 <assert+0x39>

x86 assembly (clang, -O2):
<assert>:
push   %rax
mov    %rdi,%r8
lea    0xed5(%rip),%rdi
call   1030 <term_printf@plt>
xor    %eax,%eax
call   1040 <disable_interrupts@plt>
nopw   0x0(%rax,%rax,1)
jmp    1140 <assert+0x20>

LLVM IR (-O0):
@.str = [32 x i8] c"\0AFailed assert at %s, %s:%d\0A %s\00"
define void @assert(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = load i8*, i8** %5
%13 = call i32 @term_printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11, i8* %12)
%14 = call i32 (...) @disable_interrupts()
br label %15
15: ; preds = %15, %4
br label %15
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0AFailed assert at %s, %s:%d\0A %s\00"
define void @assert(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @term_printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i32 %3, i8* %0)
%6 = tail call i32 (...) @disable_interrupts()
br label %7
7: ; preds = %7, %4
br label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void cpu_to_le64s(uint64_t *p) {}


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

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

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

LLVM IR (-O2):
define void @cpu_to_le64s(i32* nocapture %0) {
ret void
}
short testme(const char *str) {
  printf("%s with arg %p\n", __FUNCTION__, str);
  printf("len of '%s' is %d\n", str, strlen(str));
  return 42;
}


x86 assembly (clang, -O0):
<testme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xec9(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2a,%ax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testme>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xede(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2a,%ax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%s with arg %p\0A\00"
@__FUNCTION__.testme = [7 x i8] c"testme\00"
@.str.1 = [19 x i8] c"len of '%s' is %d\0A\00"
define signext i16 @testme(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.testme, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %5, i64 %7)
ret i16 42
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s with arg %p\0A\00"
@__FUNCTION__.testme = [7 x i8] c"testme\00"
@.str.1 = [19 x i8] c"len of '%s' is %d\0A\00"
define signext i16 @testme(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.testme, i64 0, i64 0), i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0, i64 %3)
ret i16 42
}
void start() {
  extern unsigned long start_val;
  extern struct LifoStack values_stack;
  do {
    unsigned int __a, __d;
    asm volatile("rdtsc" : "=a"(__a), "=d"(__d));
    (start_val) = ((unsigned long)__a) | (((unsigned long)__d) << 32);
  } while (0);
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x20,%rax
or     %rax,%rcx
mov    0x2ec6(%rip),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rax,%rdx
mov    0x2ed6(%rip),%rax
mov    %rdx,(%rax)
ret

LLVM IR (-O0):
@start_val = external global i64
define void @start() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %0
%4 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%5 = extractvalue { i32, i32 } %4, 0
%6 = extractvalue { i32, i32 } %4, 1
store i32 %5, i32* %1
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 32
%12 = or i64 %8, %11
store i64 %12, i64* @start_val
br label %13
13: ; preds = %3
ret void
}

LLVM IR (-O2):
@start_val = external global i64
define void @start() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
store i64 %7, i64* @start_val
ret void
}
void ___before_service() {}


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

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

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

LLVM IR (-O2):
define void @___before_service() {
ret void
}
double do_fprem1(void) {
  double res = 0.0;
  __asm__ __volatile__("ffree %%st(0)\n\t"
                       "ffree %%st(1)\n\t"
                       "fldpi\n\t"
                       "fldln2\n\t"
                       "fprem1\n\t"
                       "fstpl 0(%0)"
                       :
                       : "r"(&res));
  return res;
}


x86 assembly (clang, -O0):
<do_fprem1>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
ffree  %st(0)
ffree  %st(1)
fldpi
fldln2
fprem1
fstpl  (%rax)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fprem1>:
movq   $0x0,-0x8(%rsp)
lea    -0x8(%rsp),%rax
ffree  %st(0)
ffree  %st(1)
fldpi
fldln2
fprem1
fstpl  (%rax)
movsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @do_fprem1() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @do_fprem1() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = load double, double* %1
ret double %3
}
/* Variables and functions */
int CheckVertexDegree();
int LayerColor(int /*<<< orphan*/);
int Is3Colorable() {
  int colorable = CheckVertexDegree();
  if (!colorable)
    return colorable;
  colorable = LayerColor(0);
  return colorable;
}


x86 assembly (clang, -O0):
<Is3Colorable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <CheckVertexDegree@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1147 <Is3Colorable+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <Is3Colorable+0x37>
xor    %edi,%edi
call   1030 <LayerColor@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Is3Colorable>:
push   %rax
xor    %eax,%eax
call   1040 <CheckVertexDegree@plt>
test   %eax,%eax
je     1134 <Is3Colorable+0x14>
xor    %edi,%edi
pop    %rax
jmp    1030 <LayerColor@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Is3Colorable() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @CheckVertexDegree()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %11
8: ; preds = %0
%9 = call i32 @LayerColor(i32 0)
store i32 %9, i32* %2
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @Is3Colorable() {
%1 = tail call i32 (...) @CheckVertexDegree()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @LayerColor(i32 0)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
void smoothsort(int arr[], int n) {}


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

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

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

LLVM IR (-O2):
define void @smoothsort(i32* nocapture %0, i32 %1) {
ret void
}
void baz(char *Msg) {
  __builtin___sprintf_chk(Msg, 0, 42, "  sizeof FoooLib            : =%3u\n",
                          12LL);
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2a,%edx
lea    0xed2(%rip),%rcx
mov    $0xc,%r8d
mov    $0x0,%al
call   1030 <__sprintf_chk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
lea    0xee9(%rip),%rcx
mov    $0x2a,%edx
mov    $0xc,%r8d
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <__sprintf_chk@plt>

LLVM IR (-O0):
@.str = [36 x i8] c" sizeof FoooLib : =%3u\0A\00"
define void @baz(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, i64, i8*, ...) @__sprintf_chk(i8* %3, i32 0, i64 42, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 12)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c" sizeof FoooLib : =%3u\0A\00"
define void @baz(i8* %0) {
%2 = tail call i32 (i8*, i32, i64, i8*, ...) @__sprintf_chk(i8* %0, i32 0, i64 42, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 12)
ret void
}
void shift_left_f(float *f) {
  f[0] = f[1];
  f[1] = f[2];
  f[2] = f[3];
  f[3] = 0.0f;
}


x86 assembly (clang, -O0):
<shift_left_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_left_f>:
mov    0x4(%rdi),%rax
mov    %rax,(%rdi)
movss  0xc(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
movl   $0x0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @shift_left_f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 1
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
store float %5, float* %7
%8 = load float*, float** %2
%9 = getelementptr inbounds float, float* %8, i64 2
%10 = load float, float* %9
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 1
store float %10, float* %12
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 3
%15 = load float, float* %14
%16 = load float*, float** %2
%17 = getelementptr inbounds float, float* %16, i64 2
store float %15, float* %17
%18 = load float*, float** %2
%19 = getelementptr inbounds float, float* %18, i64 3
store float 0.000000e+00, float* %19
ret void
}

LLVM IR (-O2):
define void @shift_left_f(float* nocapture %0) {
%2 = getelementptr inbounds float, float* %0, i64 1
%3 = load float, float* %2
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 2
%5 = load float, float* %4
store float %5, float* %2
%6 = getelementptr inbounds float, float* %0, i64 3
%7 = load float, float* %6
store float %7, float* %4
store float 0.000000e+00, float* %6
ret void
}
void i2d_X509_ALGOR(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_X509_ALGOR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(int argc) {
  char test[argc];
  if (0)
  label:
    printf("boom!\n");
  if (argc-- == 0)
    return;
  goto label;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1138 <f+0x28>
jmp    1149 <f+0x39>
jmp    113d <f+0x2d>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jne    1169 <f+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret
jmp    113d <f+0x2d>

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <f+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebx
jne    1130 <f+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"boom!\0A\00"
define void @f(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
br i1 false, label %9, label %12
9: ; preds = %1
br label %10
10: ; preds = %18, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %2
%14 = add nsw i32 %13, -1
store i32 %14, i32* %2
%15 = icmp eq i32 %13, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i8*, i8** %3
ret void
18: ; preds = %12
br label %10
}

LLVM IR (-O2):
@str = [6 x i8] c"boom!\00"
define void @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%8 = icmp eq i32 %6, 0
br i1 %8, label %3, label %4
}
int dns_v_rel(void) { return 0x20140811; }


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

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

LLVM IR (-O0):
define i32 @dns_v_rel() {
ret i32 538183697
}

LLVM IR (-O2):
define i32 @dns_v_rel() {
ret i32 538183697
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x03() {
  Assert_real((isdigit(3) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              20, ("isdigit should be 0 for 0x03"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x03\00"
define void @t_isdigit_0x03() {
%1 = tail call i64 @isdigit(i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ipack(unsigned char *f) {
  int i, j;
  i = *f;
  i = i << 24;
  j = *(f + 1);
  i |= j << 16;
  j = *(f + 2);
  i |= j << 8;
  j = *(f + 3);
  return (i | j);
}


x86 assembly (clang, -O0):
<ipack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipack>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @ipack(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Two plus two is %d\n", 4);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Two plus two is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Two plus two is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
void interrupt_svcall(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<interrupt_svcall>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <interrupt_svcall+0x9>
jmp    1109 <interrupt_svcall+0x9>

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

LLVM IR (-O0):
define void @interrupt_svcall() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @interrupt_svcall() {
br label %1
1: ; preds = %0, %1
br label %1
}
unsigned int buf2ushort(unsigned char *buf) {
  unsigned int val;
  val = buf[1];
  val = ((val << 8) + (0xff & buf[0]));
  return val;
}


x86 assembly (clang, -O0):
<buf2ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf2ushort>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @buf2ushort(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = shl i32 %8, 8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 255, %13
%15 = add i32 %9, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @buf2ushort(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void largeAdjustmentGE(unsigned a) {
  char *b = ((void *)0);
  if (a - 2 >= (0x7fffffff * 2U + 1U) - 1)
    b = malloc(1);
  if (a > 1)
    return;
  else if (a == 1 || a == 0)
    free(b);
  return;
}


x86 assembly (clang, -O0):
<largeAdjustmentGE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
cmp    $0xfffffffe,%eax
jb     1150 <largeAdjustmentGE+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jbe    115f <largeAdjustmentGE+0x3f>
jmp    1186 <largeAdjustmentGE+0x66>
cmpl   $0x1,-0x4(%rbp)
je     1173 <largeAdjustmentGE+0x53>
cmpl   $0x0,-0x4(%rbp)
jne    117c <largeAdjustmentGE+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1181 <largeAdjustmentGE+0x61>
jmp    1186 <largeAdjustmentGE+0x66>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<largeAdjustmentGE>:
cmp    $0x1,%edi
ja     1139 <largeAdjustmentGE+0x19>
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @largeAdjustmentGE(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %1, %3
ret void
}
int test_imm_C7int32_reg(int val) { return ((val) & (0xC7 << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_C7int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 199
%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_C7int32_reg(i32 %0) {
%2 = and i32 %0, 199
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getPasswd(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char pw[20];
  printf("Enter password :  ");
  getPasswd(pw);
  printf("your password is %s\n", pw);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <getPasswd@plt>
lea    -0x20(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <getPasswd@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter password : \00"
@.str.1 = [21 x i8] c"your password is %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = call i32 @getPasswd(i8* %3)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter password : \00"
@.str.1 = [21 x i8] c"your password is %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @getPasswd(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
int start_remote_job_p() { return 0; }


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

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

LLVM IR (-O0):
define i32 @start_remote_job_p() {
ret i32 0
}

LLVM IR (-O2):
define i32 @start_remote_job_p() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int8_t;

/* Variables and functions */
int8_t clamp(uint8_t x, uint8_t a, uint8_t b) {
  return x < a ? a : (x > b ? b : x);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112b <clamp+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1156 <clamp+0x56>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1146 <clamp+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    114e <clamp+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @clamp(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, int, int, int /*<<< orphan*/ *);
size_t read_data(FILE *in, void *buffer) {
  return fread(buffer, 1, 1000000, in);
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0xf4240,%edx
call   1030 <fread@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
mov    $0xf4240,%edx
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @read_data(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @fread(i8* %1, i32 1, i32 1000000, i32* %0)
ret i64 %3
}
int min_heap_insert(int *list[], int value) {}


x86 assembly (clang, -O0):
<min_heap_insert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min_heap_insert(i32** nocapture readnone %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
ris() { esc("c"); }


x86 assembly (clang, -O0):
<ris>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <esc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"c\00"
define i32 @ris() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
float __ocml_nextafter_f32(float, float);
float nextafterf(float x, float y) { return __ocml_nextafter_f32(x, y); }


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

x86 assembly (clang, -O2):
<nextafterf>:
jmp    1030 <__ocml_nextafter_f32@plt>

LLVM IR (-O0):
define float @nextafterf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__ocml_nextafter_f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @nextafterf(float %0, float %1) {
%3 = tail call float @__ocml_nextafter_f32(float %0, float %1)
ret float %3
}
int is_little() {
  int i = 1;
  char *p = (char *)&i;
  if (*p == 1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_little>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    112f <is_little+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <is_little+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_little() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 1, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_little() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void getAddress() {
  printf("Current State is: SHIPPING\n");
  printf("Getting address\n");
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Current State is: SHIPPING\0A\00"
@.str.1 = [17 x i8] c"Getting address\0A\00"
define void @getAddress() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Current State is: SHIPPING\00"
@str.2 = [16 x i8] c"Getting address\00"
define void @getAddress() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret void
}