xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_number_cmp();
int main() {
  test_number_cmp();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_number_cmp()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_number_cmp()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ sleep(int);
void *sub_thread_int(int *thread_no) {
  char sub_buf[1024] = {0x00};
  pthread_t tid = pthread_self();
  ;
  sleep(1);
  ;
  return NULL;
}


x86 assembly (clang, -O0):
<sub_thread_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,-0x414(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_thread_int>:
push   %rax
xor    %eax,%eax
call   1030 <pthread_self@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sub_thread_int(i32* %0) {
%2 = alloca i32*
%3 = alloca [1024 x i8]
%4 = alloca i32
store i32* %0, i32** %2
%5 = bitcast [1024 x i8]* %3 to i8*
%6 = call i32 (...) @pthread_self()
store i32 %6, i32* %4
%7 = call i32 @sleep(i32 1)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sub_thread_int(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @sleep(i32 1)
ret i8* null
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
scalar_t__ WEOF;
scalar_t__ toupper(scalar_t__);
wint_t towupper(wint_t wc) {
  if (wc == WEOF)
    return WEOF;
  return (wc < (wint_t)0x100 ? toupper(wc) : wc);
}


x86 assembly (clang, -O0):
<towupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%rax
jne    1143 <towupper+0x33>
mov    0x2ea9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <towupper+0x63>
cmpq   $0x100,-0x10(%rbp)
jge    1163 <towupper+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <toupper@plt>
mov    %rax,-0x18(%rbp)
jmp    116b <towupper+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towupper>:
mov    0x2ec9(%rip),%rax
cmp    %rdi,(%rax)
je     112a <towupper+0x1a>
cmp    $0xff,%rdi
jg     112a <towupper+0x1a>
jmp    1030 <toupper@plt>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
@WEOF = global i64 0
define i64 @towupper(i64 %0) {
%2 = load i64, i64* @WEOF
%3 = icmp ne i64 %2, %0
%4 = icmp slt i64 %0, 256
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i64 @toupper(i64 %0)
br label %8
8: ; preds = %6, %1
%9 = phi i64 [ %0, %1 ], [ %7, %6 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __dealloc(void *cc, void *c) { free(c); }


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

x86 assembly (clang, -O2):
<__dealloc>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__dealloc(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char x[80];
  gets(x);
  printf("%s", x);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
unsigned char x86_64_cmos_read(unsigned char addr) {
  unsigned char ret;
  x86_64_outb(0x70, addr);
  asm volatile("jmp 1f; 1: jmp 1f;1:");
  ret = x86_64_inb(0x71);
  asm volatile("jmp 1f; 1: jmp 1f;1:");
  return ret;
}


x86 assembly (clang, -O0):
<x86_64_cmos_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%esi
mov    $0x70,%edi
mov    $0x0,%al
call   1040 <x86_64_outb@plt>
jmp    1143 <x86_64_cmos_read+0x23>
jmp    1148 <x86_64_cmos_read+0x28>
mov    $0x71,%edi
mov    $0x0,%al
call   1030 <x86_64_inb@plt>
mov    %al,-0x2(%rbp)
jmp    115c <x86_64_cmos_read+0x3c>
jmp    1161 <x86_64_cmos_read+0x41>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_64_cmos_read>:
push   %rax
mov    %edi,%esi
mov    $0x70,%edi
xor    %eax,%eax
call   1040 <x86_64_outb@plt>
jmp    1131 <x86_64_cmos_read+0x11>
jmp    1133 <x86_64_cmos_read+0x13>
mov    $0x71,%edi
xor    %eax,%eax
call   1030 <x86_64_inb@plt>
jmp    1141 <x86_64_cmos_read+0x21>
jmp    1143 <x86_64_cmos_read+0x23>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @x86_64_cmos_read(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @x86_64_outb to i32 (i32, i32, ...)*)(i32 112, i32 %5)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @x86_64_inb to i32 (i32, ...)*)(i32 113)
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @x86_64_cmos_read(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @x86_64_outb to i32 (i32, i32, ...)*)(i32 112, i32 %2)
tail call void asm sideeffect "jmp 1f; 1: jmp 1f;1:", "~{dirflag},~{fpsr},~{flags}"()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @x86_64_inb to i32 (i32, ...)*)(i32 113)
%5 = trunc i32 %4 to i8
tail call void asm sideeffect "jmp 1f; 1: jmp 1f;1:", "~{dirflag},~{fpsr},~{flags}"()
ret i8 %5
}
double f(double x) {
  x = x * x - 3;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double -3.000000e+00)
store double %5, double* %2
%6 = load double, double* %2
ret double %6
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -3.000000e+00)
ret double %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
void encode_uint64_to_buffer(uint64_t num, uint8_t buf[8]) {
  for (int i = 0; i < 8; ++i) {
    buf[i] = (num >> 8 * (7 - i)) & 0xffu;
  }
}


x86 assembly (clang, -O0):
<encode_uint64_to_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    114b <encode_uint64_to_buffer+0x4b>
mov    -0x4(%rbp),%edx
mov    $0x7,%ecx
sub    -0x14(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%edx
and    $0xff,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <encode_uint64_to_buffer+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_uint64_to_buffer>:
mov    %edi,%eax
mov    %edi,%ecx
movzbl %ah,%edx
movzbl %al,%edi
shr    $0x18,%eax
mov    %eax,0x10(%rsi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x14(%rsi)
mov    %edx,0x18(%rsi)
mov    %edi,0x1c(%rsi)
ret

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

LLVM IR (-O2):
define void @encode_uint64_to_buffer(i32 %0, i32* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = getelementptr inbounds i32, i32* %1, i64 4
store i32 %3, i32* %4
%5 = lshr i32 %0, 16
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %1, i64 5
store i32 %6, i32* %7
%8 = lshr i32 %0, 8
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %1, i64 6
store i32 %9, i32* %10
%11 = and i32 %0, 255
%12 = getelementptr inbounds i32, i32* %1, i64 7
store i32 %11, i32* %12
ret void
}
long double longdouble_ignoring_longint(long double x, long int y) { return x; }


x86 assembly (clang, -O0):
<longdouble_ignoring_longint>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_longint>:
fldt   0x8(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_longint(x86_fp80 returned %0, i64 %1) {
ret x86_fp80 %0
}
int Quit(const double *args, int argc, double *OutResult) { return 8; }


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

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

LLVM IR (-O0):
define i32 @Quit(double* %0, i32 %1, double* %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca double*
store double* %0, double** %4
store i32 %1, i32* %5
store double* %2, double** %6
ret i32 8
}

LLVM IR (-O2):
define i32 @Quit(double* nocapture readnone %0, i32 %1, double* nocapture readnone %2) {
ret i32 8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtpu16_ps(int /*<<< orphan*/);
__m128 __attribute__((no, unused)) test(__m64 __A) {
  return _mm_cvtpu16_ps(__A);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_cvtpu16_ps@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = tail call i32 @_mm_cvtpu16_ps(i32 %0)
ret i32 %2
}
int test_imm_00uint16_reg(unsigned short val) {
  return ((val) & (-0x00 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_00uint16_reg(i16 zeroext %0) {
ret i32 -40
}
/* Variables and functions */
int U_WMRCREATEFONTINDIRECT_get(char const *, char const **);
int /*<<< orphan*/ font_print(char const *);
int /*<<< orphan*/ printf(char *);
void U_WMRCREATEFONTINDIRECT_print(const char *contents) {
  const char *font;
  int size = U_WMRCREATEFONTINDIRECT_get(contents, &font);
  if (size > 0) {
    printf("   Font:");
    font_print(font);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<U_WMRCREATEFONTINDIRECT_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <U_WMRCREATEFONTINDIRECT_get@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1177 <U_WMRCREATEFONTINDIRECT_print+0x47>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <font_print@plt>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRCREATEFONTINDIRECT_print>:
push   %rax
mov    %rsp,%rsi
call   1050 <U_WMRCREATEFONTINDIRECT_get@plt>
test   %eax,%eax
jle    116c <U_WMRCREATEFONTINDIRECT_print+0x2c>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    (%rsp),%rdi
call   1060 <font_print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c" Font:\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @U_WMRCREATEFONTINDIRECT_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @U_WMRCREATEFONTINDIRECT_get(i8* %5, i8** %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = call i32 @font_print(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" Font:\00"
define void @U_WMRCREATEFONTINDIRECT_print(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @U_WMRCREATEFONTINDIRECT_get(i8* %0, i8** %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %2
%9 = call i32 @font_print(i8* %8)
%10 = call i32 @putchar(i32 10)
br label %11
11: ; preds = %6, %1
ret void
}
char *my_stpcpy(char *dest, const char *src) {
  while ((*dest++ = *src++) != '\0')
    ;
  return dest - 1;
}


x86 assembly (clang, -O0):
<my_stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <my_stpcpy+0x3f>
jmp    110c <my_stpcpy+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_stpcpy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <my_stpcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @my_stpcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %4
}
/* Variables and functions */
unsigned char *ecdh_compute_public_key(unsigned char *, size_t,
                                       unsigned char const *, size_t);
unsigned char *ke_ecdh_public(unsigned char *pub, size_t pub_size,
                              const unsigned char *priv, size_t priv_size) {
  return ecdh_compute_public_key(pub, pub_size, priv, priv_size);
}


x86 assembly (clang, -O0):
<ke_ecdh_public>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <ecdh_compute_public_key@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ke_ecdh_public>:
jmp    1030 <ecdh_compute_public_key@plt>

LLVM IR (-O0):
define i8* @ke_ecdh_public(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i8* @ecdh_compute_public_key(i8* %9, i64 %10, i8* %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @ke_ecdh_public(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i8* @ecdh_compute_public_key(i8* %0, i64 %1, i8* %2, i64 %3)
ret i8* %5
}
int _min(int a, int b) {
  if (a <= b)
    return (a);
  return (b);
}


x86 assembly (clang, -O0):
<_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <_min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @_min(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* %4
%7 = load i32, i32* %5
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int f2fs_set_bit(unsigned int nr, char *addr) {
  int mask;
  int ret;
  addr += (nr >> 3);
  mask = 1 << (7 - (nr & 0x07));
  ret = mask & *addr;
  *addr |= mask;
  return ret;
}


x86 assembly (clang, -O0):
<f2fs_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    $0x7,%ecx
sub    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2fs_set_bit>:
mov    %edi,%ecx
mov    %edi,%edx
shr    $0x3,%rdx
not    %cl
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
movzbl (%rsi,%rdx,1),%edi
and    %edi,%eax
bts    %ecx,%edi
mov    %dil,(%rsi,%rdx,1)
ret

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

LLVM IR (-O2):
define i32 @f2fs_set_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = xor i32 %6, 7
%8 = shl nuw i32 1, %7
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = and i32 %8, %10
%12 = trunc i32 %8 to i8
%13 = or i8 %9, %12
store i8 %13, i8* %5
ret i32 %11
}
void *test_anti_range_127(int n) {
  extern void *alloc_anti_range_127(int) __attribute__((alloc_size(1)));
  if ((-0x7fffffff - 1) + 2 <= n && n <= 1)
    n = (-0x7fffffff - 1) + 2 - 1;
  return alloc_anti_range_127(n);
}


x86 assembly (clang, -O0):
<test_anti_range_127>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80000002,%eax
cmp    -0x4(%rbp),%eax
jg     113a <test_anti_range_127+0x2a>
cmpl   $0x1,-0x4(%rbp)
jg     113a <test_anti_range_127+0x2a>
movl   $0x80000001,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_127@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_127>:
mov    %edi,%eax
add    $0x7ffffffe,%eax
mov    $0x80000001,%eax
cmovns %eax,%edi
jmp    1030 <alloc_anti_range_127@plt>

LLVM IR (-O0):
define i8* @test_anti_range_127(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 -2147483646, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -2147483647, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_127(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_127(i32 %0) {
%2 = add i32 %0, 2147483646
%3 = icmp sgt i32 %2, -1
%4 = select i1 %3, i32 -2147483647, i32 %0
%5 = tail call i8* @alloc_anti_range_127(i32 %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void print_banner(FILE *fd, char const *program) {
  fprintf(fd,
          "%s: Version "
          "Manual build"
          " on "
          "Linux"
          " "
          "x86_64"
          "\n",
          program);
}


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

x86 assembly (clang, -O2):
<print_banner>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"%s: Version Manual build on Linux x86_64\0A\00"
define void @print_banner(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"%s: Version Manual build on Linux x86_64\0A\00"
define void @print_banner(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int glutGetMenu(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @glutGetMenu() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tgi_done();
void screen_done(void) { tgi_done(); }


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

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

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

LLVM IR (-O2):
define void @screen_done() {
%1 = tail call i32 (...) @tgi_done()
ret void
}
void par_shapes__scale3(float *result, float a) {
  result[0] *= a;
  result[1] *= a;
  result[2] *= a;
}


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

x86 assembly (clang, -O2):
<par_shapes__scale3>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @par_shapes__scale3(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
/* Variables and functions */
int checker_read_double(int, char const *, int, double *);
int checker_read_corr_double(const char *name, int eof_error_flag,
                             double *p_val) {
  return checker_read_double(2, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_corr_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x2,%edi
call   1030 <checker_read_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_corr_double>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <checker_read_double@plt>

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

LLVM IR (-O2):
define i32 @checker_read_corr_double(i8* %0, i32 %1, double* %2) {
%4 = tail call i32 @checker_read_double(i32 2, i8* %0, i32 %1, double* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ft_strjoin(char *, char *);
void push_buf(char **remaining, char *buf) {
  char *tmp;
  tmp = *remaining;
  *remaining = ft_strjoin(*remaining, buf);
  free(tmp);
}


x86 assembly (clang, -O0):
<push_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ft_strjoin@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_buf>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r14
mov    %r14,%rdi
call   1040 <ft_strjoin@plt>
mov    %rax,(%rbx)
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @push_buf(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @ft_strjoin(i8* %3, i8* %1)
store i8* %4, i8** %0
%5 = tail call i32 @free(i8* %3)
ret void
}
void read_bigEndian_short(short *dest, unsigned char *source) {
  *dest = (source[0] << 8);
  *dest |= source[1];
}


x86 assembly (clang, -O0):
<read_bigEndian_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edx
mov    -0x8(%rbp),%rax
movswl (%rax),%ecx
or     %edx,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bigEndian_short>:
movzbl (%rsi),%eax
shl    $0x8,%eax
mov    %ax,(%rdi)
movzbl 0x1(%rsi),%ecx
or     %eax,%ecx
mov    %cx,(%rdi)
ret

LLVM IR (-O0):
define void @read_bigEndian_short(i16* %0, i8* %1) {
%3 = alloca i16*
%4 = alloca i8*
store i16* %0, i16** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = trunc i32 %9 to i16
%11 = load i16*, i16** %3
store i16 %10, i16* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i16*, i16** %3
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = or i32 %18, %15
%20 = trunc i32 %19 to i16
store i16 %20, i16* %16
ret void
}

LLVM IR (-O2):
define void @read_bigEndian_short(i16* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
store i16 %5, i16* %0
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = or i16 %5, %8
store i16 %9, i16* %0
ret void
}
const char *s(const char *str) { return str; }


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):

:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @s(i8* readnone returned %0) {
ret i8* %0
}
int and3(int a) { return (a & 7) != 0; }


x86 assembly (clang, -O0):
<and3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<and3>:
xor    %eax,%eax
test   $0x7,%dil
setne  %al
ret

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

LLVM IR (-O2):
define i32 @and3(i32 %0) {
%2 = and i32 %0, 7
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo252() {}


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

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

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

LLVM IR (-O2):
define void @foo252() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char const *const);
int dialog_textbox(char const *, char const *const, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int j_textbox(const char *t, int ac, const char *const *av) {
  return dialog_textbox(t, av[2], atoi(av[3]), atoi(av[4]));
}


x86 assembly (clang, -O0):
<j_textbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <atoi@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
call   1040 <dialog_textbox@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_textbox>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    0x10(%rdx),%r15
mov    0x18(%rdx),%rdi
call   1030 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%rbx),%rdi
call   1030 <atoi@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <dialog_textbox@plt>

LLVM IR (-O0):
define i32 @j_textbox(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 2
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 3
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
%15 = load i8**, i8*** %6
%16 = getelementptr inbounds i8*, i8** %15, i64 4
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = call i32 @dialog_textbox(i8* %7, i8* %10, i32 %14, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @j_textbox(i8* %0, i32 %1, i8** nocapture %2) {
%4 = getelementptr inbounds i8*, i8** %2, i64 2
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %2, i64 3
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = getelementptr inbounds i8*, i8** %2, i64 4
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = tail call i32 @dialog_textbox(i8* %0, i8* %5, i32 %8, i32 %11)
ret i32 %12
}
int test_imm_E2uint8_reg(unsigned char val) {
  return ((val) & (-0xE2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E2uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff1e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E2uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 30
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gen_return_function();
int /*<<< orphan*/ gen_run_code();
void dyn_run_code(void) {
  gen_run_code();
  gen_return_function();
}


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

x86 assembly (clang, -O2):
<dyn_run_code>:
push   %rax
xor    %eax,%eax
call   1030 <gen_run_code@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <gen_return_function@plt>

LLVM IR (-O0):
define void @dyn_run_code() {
%1 = call i32 (...) @gen_run_code()
%2 = call i32 (...) @gen_return_function()
ret void
}

LLVM IR (-O2):
define void @dyn_run_code() {
%1 = tail call i32 (...) @gen_run_code()
%2 = tail call i32 (...) @gen_return_function()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_Cmd(int);
int /*<<< orphan*/ Lcd_Port(int);
int /*<<< orphan*/ __delay_ms(int);
void Lcd_Init() {
  Lcd_Port(0x00);
  __delay_ms(20);
  Lcd_Cmd(0x03);
  __delay_ms(5);
  Lcd_Cmd(0x03);
  __delay_ms(11);
  Lcd_Cmd(0x03);
  Lcd_Cmd(0x02);
  Lcd_Cmd(0x02);
  Lcd_Cmd(0x08);
  Lcd_Cmd(0x00);
  Lcd_Cmd(0x0C);
  Lcd_Cmd(0x00);
  Lcd_Cmd(0x06);
}


x86 assembly (clang, -O0):
<Lcd_Init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <Lcd_Port@plt>
mov    $0x14,%edi
call   1030 <__delay_ms@plt>
mov    $0x3,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x5,%edi
call   1030 <__delay_ms@plt>
mov    $0x3,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0xb,%edi
call   1030 <__delay_ms@plt>
mov    $0x3,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x2,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x2,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x8,%edi
call   1040 <Lcd_Cmd@plt>
xor    %edi,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0xc,%edi
call   1040 <Lcd_Cmd@plt>
xor    %edi,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x6,%edi
call   1040 <Lcd_Cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lcd_Init>:
push   %rax
xor    %edi,%edi
call   1050 <Lcd_Port@plt>
mov    $0x14,%edi
call   1030 <__delay_ms@plt>
mov    $0x3,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x5,%edi
call   1030 <__delay_ms@plt>
mov    $0x3,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0xb,%edi
call   1030 <__delay_ms@plt>
mov    $0x3,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x2,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x2,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x8,%edi
call   1040 <Lcd_Cmd@plt>
xor    %edi,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0xc,%edi
call   1040 <Lcd_Cmd@plt>
xor    %edi,%edi
call   1040 <Lcd_Cmd@plt>
mov    $0x6,%edi
pop    %rax
jmp    1040 <Lcd_Cmd@plt>

LLVM IR (-O0):
define void @Lcd_Init() {
%1 = call i32 @Lcd_Port(i32 0)
%2 = call i32 @__delay_ms(i32 20)
%3 = call i32 @Lcd_Cmd(i32 3)
%4 = call i32 @__delay_ms(i32 5)
%5 = call i32 @Lcd_Cmd(i32 3)
%6 = call i32 @__delay_ms(i32 11)
%7 = call i32 @Lcd_Cmd(i32 3)
%8 = call i32 @Lcd_Cmd(i32 2)
%9 = call i32 @Lcd_Cmd(i32 2)
%10 = call i32 @Lcd_Cmd(i32 8)
%11 = call i32 @Lcd_Cmd(i32 0)
%12 = call i32 @Lcd_Cmd(i32 12)
%13 = call i32 @Lcd_Cmd(i32 0)
%14 = call i32 @Lcd_Cmd(i32 6)
ret void
}

LLVM IR (-O2):
define void @Lcd_Init() {
%1 = tail call i32 @Lcd_Port(i32 0)
%2 = tail call i32 @__delay_ms(i32 20)
%3 = tail call i32 @Lcd_Cmd(i32 3)
%4 = tail call i32 @__delay_ms(i32 5)
%5 = tail call i32 @Lcd_Cmd(i32 3)
%6 = tail call i32 @__delay_ms(i32 11)
%7 = tail call i32 @Lcd_Cmd(i32 3)
%8 = tail call i32 @Lcd_Cmd(i32 2)
%9 = tail call i32 @Lcd_Cmd(i32 2)
%10 = tail call i32 @Lcd_Cmd(i32 8)
%11 = tail call i32 @Lcd_Cmd(i32 0)
%12 = tail call i32 @Lcd_Cmd(i32 12)
%13 = tail call i32 @Lcd_Cmd(i32 0)
%14 = tail call i32 @Lcd_Cmd(i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ putxval(int, int /*<<< orphan*/);
int /*<<< orphan*/ serial_init(int);
int main(void) {
  serial_init(1);
  puts("Hello World!\n");
  putxval(0x10, 0);
  puts("\n");
  putxval(0xffff, 0);
  puts("\n");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <serial_init@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1040 <putxval@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffff,%edi
xor    %esi,%esi
call   1040 <putxval@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
jmp    1185 <main+0x55>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1050 <serial_init@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1040 <putxval@plt>
lea    0xeb2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xffff,%edi
xor    %esi,%esi
call   1040 <putxval@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @serial_init(i32 1)
%3 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @putxval(i32 16, i32 0)
%5 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @putxval(i32 65535, i32 0)
%7 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %8
br label %8
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @serial_init(i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @putxval(i32 16, i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @putxval(i32 65535, i32 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
br label %7
}
int lower(int c) {
  int res;
  return res = (c >= 'A' && c <= 'Z') ? c + 'a' - 'A' : c;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <lower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <lower+0x2c>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <lower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 97
%12 = sub nsw i32 %11, 65
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %2
br label %15
15: ; preds = %13, %9
%16 = phi i32 [ %12, %9 ], [ %14, %13 ]
store i32 %16, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int test_imm_69uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x69 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_69uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6881280
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t mbrtowc(int /*<<< orphan*/ *, char const *, size_t,
               int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) size_t
softboundcets_mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) {
  return mbrtowc(pwc, s, n, ps);
}


x86 assembly (clang, -O0):
<softboundcets_mbrtowc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <mbrtowc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_mbrtowc>:
jmp    1030 <mbrtowc@plt>

LLVM IR (-O0):
define weak i64 @softboundcets_mbrtowc(i32* %0, i8* %1, i64 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
store i32* %0, i32** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @mbrtowc(i32* %9, i8* %10, i64 %11, i32* %12)
ret i64 %13
}

LLVM IR (-O2):
define weak i64 @softboundcets_mbrtowc(i32* %0, i8* %1, i64 %2, i32* %3) {
%5 = tail call i64 @mbrtowc(i32* %0, i8* %1, i64 %2, i32* %3)
ret i64 %5
}