xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char const *const, scalar_t__);
char *skip_whitespace(char *);
scalar_t__ strlen(char const *const);
void remove_leading_whitespace(char line[]) {
  const char *const non_whitespace = skip_whitespace(line);
  if (non_whitespace != line) {
    memmove(line, non_whitespace, strlen(non_whitespace) + 1);
  }
}


x86 assembly (clang, -O0):
<remove_leading_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_whitespace@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1184 <remove_leading_whitespace+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_leading_whitespace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <skip_whitespace@plt>
cmp    %rbx,%rax
je     1162 <remove_leading_whitespace+0x32>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <memmove@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @remove_leading_whitespace(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @skip_whitespace(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = icmp ne i8* %6, %7
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = call i64 @strlen(i8* %12)
%14 = add nsw i64 %13, 1
%15 = call i32 @memmove(i8* %10, i8* %11, i64 %14)
br label %16
16: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @remove_leading_whitespace(i8* %0) {
%2 = tail call i8* @skip_whitespace(i8* %0)
%3 = icmp eq i8* %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @memmove(i8* %0, i8* %2, i64 %6)
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d", foo()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
double GetMaxDouble(void) {
  unsigned long long bits = ((unsigned long long)-1) >> 12;
  bits = bits |
         ((((unsigned long long)-1) >> 1) ^ (((unsigned long long)-1) >> 11));
  return *(double *)&bits;
}


x86 assembly (clang, -O0):
<GetMaxDouble>:
push   %rbp
mov    %rsp,%rbp
movabs $0xfffffffffffff,%rax
mov    %rax,-0x8(%rbp)
movabs $0x7fe0000000000000,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMaxDouble>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @GetMaxDouble() {
%1 = alloca i64
store i64 4503599627370495, i64* %1
%2 = load i64, i64* %1
%3 = or i64 %2, 9214364837600034816
store i64 %3, i64* %1
%4 = bitcast i64* %1 to double*
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @GetMaxDouble() {
ret double 0x7FEFFFFFFFFFFFFF
}
void set_cr4(unsigned long value) {
  __asm__ volatile("mov %0, %%cr4" : : "r"(value));
}


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

x86 assembly (clang, -O2):
<set_cr4>:
mov    %rdi,%cr4
ret

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

LLVM IR (-O2):
define void @set_cr4(i64 %0) {
tail call void asm sideeffect "mov $0, %cr4", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
void w32mem(unsigned char *mem, unsigned long w32) {
  int i;
  for (i = 0; i < 4; i++)
    *mem++ = (unsigned char)((((w32)&4294967295U) >> (24 - i * 8)) & 0xff);
}


x86 assembly (clang, -O0):
<w32mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1164 <w32mem+0x64>
movabs $0xffffffff,%rax
and    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edx
shl    $0x3,%edx
mov    $0x18,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <w32mem+0x13>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @w32mem(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %5
%9 = lshr i64 %1, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %10, i8* %8
%12 = trunc i64 %1 to i8
store i8 %12, i8* %11
ret void
}
void PR16931(int *x) {
  typedef struct {
    _Atomic(_Bool) flag;
  } flag;
  flag flagvar = {0};
  PR16931(&flagvar);
}


x86 assembly (clang, -O0):
<PR16931>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
call   1040 <PR16931@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.flag = type { i8 }
define void @PR16931(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.flag
store i32* %0, i32** %2
%4 = bitcast %struct.flag* %3 to i8*
%5 = bitcast %struct.flag* %3 to i32*
ret void
}

LLVM IR (-O2):
define void @PR16931(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef scalar_t__ u_int64_t;

/* Variables and functions */
double getpksec(u_int64_t speed_bps, int mtu) {
  return (double)speed_bps / (double)8 / (double)mtu;
}


x86 assembly (clang, -O0):
<getpksec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xee7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpksec>:
cvtsi2sd %rdi,%xmm0
mulsd  0xef3(%rip),%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @getpksec(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = fdiv double %6, 8.000000e+00
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @getpksec(i64 %0, i32 %1) {
%3 = sitofp i64 %0 to double
%4 = fmul double %3, 1.250000e-01
%5 = sitofp i32 %1 to double
%6 = fdiv double %4, %5
ret double %6
}
void bc_2L_none(struct grid *g, struct parList *par) {}


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

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

LLVM IR (-O0):
%struct.grid = type opaque
%struct.parList = type opaque
define void @bc_2L_none(%struct.grid* %0, %struct.parList* %1) {
%3 = alloca %struct.grid*
%4 = alloca %struct.parList*
store %struct.grid* %0, %struct.grid** %3
store %struct.parList* %1, %struct.parList** %4
ret void
}

LLVM IR (-O2):
%struct.grid = type opaque
%struct.parList = type opaque
define void @bc_2L_none(%struct.grid* nocapture %0, %struct.parList* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mp2vpicx_get_alternatescan(const uint8_t *p_mp2vpicx) {
  return !!(p_mp2vpicx[7] & 0x4);
}


x86 assembly (clang, -O0):
<mp2vpicx_get_alternatescan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_get_alternatescan>:
mov    0x1c(%rdi),%eax
shr    $0x2,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpicx_get_alternatescan(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = and i32 %5, 4
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vpicx_get_alternatescan(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = lshr i32 %3, 2
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int f_nl(int mode, unsigned char **sec, float *data, unsigned int ndata,
         char *inv_out, void **local) {
  if (mode >= 0)
    strcpy(inv_out, "\n");
  return 0;
}


x86 assembly (clang, -O0):
<f_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1148 <f_nl+0x38>
mov    -0x28(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_nl>:
test   %edi,%edi
js     1128 <f_nl+0x18>
push   %rax
lea    0xee4(%rip),%rsi
mov    %r8,%rdi
call   1030 <strcpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @f_nl(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* %4, i8** nocapture readnone %5) {
%7 = icmp sgt i32 %0, -1
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}
void nop() { return; }


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

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

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

LLVM IR (-O2):
define void @nop() {
ret void
}
/* Type definitions */
typedef int uint16_t;
struct p4_field_match_range {
  int dummy;
};

/* Variables and functions */
struct p4_field_match_range *unpack_p4_field_match_range(char *buffer,
                                                         uint16_t offset) {
  return (struct p4_field_match_range *)(buffer + offset);
}


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

x86 assembly (clang, -O2):
<unpack_p4_field_match_range>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.p4_field_match_range = type { i32 }
define %struct.p4_field_match_range* @unpack_p4_field_match_range(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to %struct.p4_field_match_range*
ret %struct.p4_field_match_range* %9
}

LLVM IR (-O2):
%struct.p4_field_match_range = type { i32 }
define %struct.p4_field_match_range* @unpack_p4_field_match_range(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.p4_field_match_range*
ret %struct.p4_field_match_range* %5
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_add_hl_sp(void) { op_write1(0x39); }


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

x86 assembly (clang, -O2):
<op_enc_add_hl_sp>:
mov    $0x39,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_add_hl_sp() {
%1 = call i32 @op_write1(i32 57)
ret void
}

LLVM IR (-O2):
define void @op_enc_add_hl_sp() {
%1 = tail call i32 @op_write1(i32 57)
ret void
}
int do_277() { return 277; }


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

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

LLVM IR (-O0):
define i32 @do_277() {
ret i32 277
}

LLVM IR (-O2):
define i32 @do_277() {
ret i32 277
}
float absoluteValue(float x) {
  if (x < 0)
    x = -x;
  return (x);
}


x86 assembly (clang, -O0):
<absoluteValue>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <absoluteValue+0x2d>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absoluteValue>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @absoluteValue(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
store float %7, float* %2
br label %8
8: ; preds = %5, %1
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @absoluteValue(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
char *langDbgDevRs232() { return "RS232"; }


x86 assembly (clang, -O0):
<langDbgDevRs232>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgDevRs232>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"RS232\00"
define i8* @langDbgDevRs232() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"RS232\00"
define i8* @langDbgDevRs232() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char tolower(char);
char toupper(char);
char flag(char symbol, int value) {
  return value ? toupper(symbol) : tolower(symbol);
}


x86 assembly (clang, -O0):
<flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114f <flag+0x2f>
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    115e <flag+0x3e>
movsbl -0x1(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag>:
movsbl %dil,%edi
test   %esi,%esi
je     112d <flag+0xd>
jmp    1030 <toupper@plt>
jmp    1040 <tolower@plt>

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

LLVM IR (-O2):
define signext i8 @flag(i8 signext %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call signext i8 @toupper(i8 signext %0)
br label %8
6: ; preds = %2
%7 = tail call signext i8 @tolower(i8 signext %0)
br label %8
8: ; preds = %6, %4
%9 = phi i8 [ %5, %4 ], [ %7, %6 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print() {
  printf("Program pendataan masyarakat\n");
  printf("Pilih opsi yang anda inginkan\n");
  printf("1.Input Data\n2.Hapus Data\n3.Tampilkan Data\n4.Cari berdasarkan "
         "nama\n5.Cari berdasarkan nomor KTP\n0.Keluar\n");
  printf("Silahkan Ketik disini");
}


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

x86 assembly (clang, -O2):
<print>:
push   %rax
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Program pendataan masyarakat\0A\00"
@.str.1 = [31 x i8] c"Pilih opsi yang anda inginkan\0A\00"
@.str.2 = [106 x i8] c"1.Input Data\0A2.Hapus Data\0A3.Tampilkan Data\0A4.Cari berdasarkan nama\0A5.Cari berdasarkan nomor KTP\0A0.Keluar\0A\00"
@.str.3 = [22 x i8] c"Silahkan Ketik disini\00"
define void @print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.3 = [22 x i8] c"Silahkan Ketik disini\00"
@str = [29 x i8] c"Program pendataan masyarakat\00"
@str.4 = [30 x i8] c"Pilih opsi yang anda inginkan\00"
@str.5 = [105 x i8] c"1.Input Data\0A2.Hapus Data\0A3.Tampilkan Data\0A4.Cari berdasarkan nama\0A5.Cari berdasarkan nomor KTP\0A0.Keluar\00"
define void @print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([105 x i8], [105 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Cyc_Port_Cenv {
  int dummy;
};
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
void *Cyc_Port_gen_exp(int /*<<< orphan*/, struct Cyc_Port_Cenv *,
                       struct Cyc_Absyn_Exp *);
void *Cyc_Port_gen_exp_false(struct Cyc_Port_Cenv *env,
                             struct Cyc_Absyn_Exp *e) {
  void *_T0;
  _T0 = Cyc_Port_gen_exp(0, env, e);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Port_gen_exp_false>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <Cyc_Port_gen_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Port_Cenv = type { i32 }
%struct.Cyc_Absyn_Exp = type { i32 }
define i8* @Cyc_Port_gen_exp_false(%struct.Cyc_Port_Cenv* %0, %struct.Cyc_Absyn_Exp* %1) {
%3 = alloca %struct.Cyc_Port_Cenv*
%4 = alloca %struct.Cyc_Absyn_Exp*
%5 = alloca i8*
store %struct.Cyc_Port_Cenv* %0, %struct.Cyc_Port_Cenv** %3
store %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_Absyn_Exp** %4
%6 = load %struct.Cyc_Port_Cenv*, %struct.Cyc_Port_Cenv** %3
%7 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %4
%8 = call i8* @Cyc_Port_gen_exp(i32 0, %struct.Cyc_Port_Cenv* %6, %struct.Cyc_Absyn_Exp* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.Cyc_Port_Cenv = type { i32 }
%struct.Cyc_Absyn_Exp = type { i32 }
define i8* @Cyc_Port_gen_exp_false(%struct.Cyc_Port_Cenv* %0, %struct.Cyc_Absyn_Exp* %1) {
%3 = tail call i8* @Cyc_Port_gen_exp(i32 0, %struct.Cyc_Port_Cenv* %0, %struct.Cyc_Absyn_Exp* %1)
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ sleep(int);
int main() {
  pid_t child_pid;
  child_pid = fork();
  if (child_pid != 0) {
    sleep(60);
  } else {
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <main+0x34>
mov    $0x3c,%edi
call   1040 <sleep@plt>
jmp    116b <main+0x3b>
xor    %edi,%edi
call   1030 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     114b <main+0x1b>
mov    $0x3c,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @sleep(i32 60)
br label %10
8: ; preds = %0
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @sleep(i32 60)
ret i32 0
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int iabs(int x) { return (x >= 0) ? x : -x; }


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <iabs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <iabs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iabs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushreal32array(char *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 32));
}


x86 assembly (clang, -O0):
<pushreal32array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x5,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushreal32array>:
shl    $0x5,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushreal32array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 32
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushreal32array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
int test_imm_62uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x62 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_62uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 98
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int f(int z) {
  if (z + sizeof(enum {a}))
    return 1 + sizeof(enum {a});
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
add    $0x4,%rax
cmp    $0x0,%rax
je     1125 <f+0x25>
movl   $0x5,-0x4(%rbp)
jmp    112c <f+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0xfffffffc,%edi
setne  %al
lea    (%rax,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, -4
%3 = select i1 %2, i32 0, i32 5
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void cpu_to_le16wu(uint16_t *p, uint16_t v) {
  uint8_t *p1 = (uint8_t *)p;
  p1[0] = v & 0xff;
  p1[1] = v >> 8;
}


x86 assembly (clang, -O0):
<cpu_to_le16wu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_le16wu>:
movzbl %sil,%eax
mov    %eax,(%rdi)
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @cpu_to_le16wu(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @cpu_to_le16wu(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
store i32 %3, i32* %0
%4 = ashr i32 %1, 8
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
char *DbgPutBaseUint(char *, int, int);
char *DbgPutBaseInt(char *p, int b, int d) {
  if (d < 0) {
    *p++ = '-';
    d = -d;
  }
  return DbgPutBaseUint(p, b, d);
}


x86 assembly (clang, -O0):
<DbgPutBaseInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1146 <DbgPutBaseInt+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <DbgPutBaseUint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DbgPutBaseInt>:
test   %edx,%edx
js     1119 <DbgPutBaseInt+0x9>
jmp    1030 <DbgPutBaseUint@plt>
movb   $0x2d,(%rdi)
add    $0x1,%rdi
neg    %edx
jmp    1030 <DbgPutBaseUint@plt>

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

LLVM IR (-O2):
define i8* @DbgPutBaseInt(i8* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 45, i8* %0
%7 = sub nsw i32 0, %2
br label %8
8: ; preds = %5, %3
%9 = phi i8* [ %6, %5 ], [ %0, %3 ]
%10 = phi i32 [ %7, %5 ], [ %2, %3 ]
%11 = tail call i8* @DbgPutBaseUint(i8* %9, i32 %1, i32 %10)
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ const *);
char *ctime(const time_t *clock) { return asctime(localtime(clock)); }


x86 assembly (clang, -O0):
<ctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime>:
push   %rax
call   1030 <localtime@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <asctime@plt>

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

LLVM IR (-O2):
define i8* @ctime(i32* %0) {
%2 = tail call i32 @localtime(i32* %0)
%3 = tail call i8* @asctime(i32 %2)
ret i8* %3
}
/* Variables and functions */
int mode_size_x(int /*<<< orphan*/);
int /*<<< orphan*/ video_current_mode();
unsigned video_size_x(void) { return mode_size_x(video_current_mode()); }


x86 assembly (clang, -O0):
<video_size_x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <video_current_mode@plt>
mov    %eax,%edi
call   1030 <mode_size_x@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_size_x>:
push   %rax
xor    %eax,%eax
call   1040 <video_current_mode@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <mode_size_x@plt>

LLVM IR (-O0):
define i32 @video_size_x() {
%1 = call i32 (...) @video_current_mode()
%2 = call i32 @mode_size_x(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @video_size_x() {
%1 = tail call i32 (...) @video_current_mode()
%2 = tail call i32 @mode_size_x(i32 %1)
ret i32 %2
}
/* Variables and functions */
int memcmp(char const *, char const *, size_t);
int different(const char *old, const char *new, size_t oldlen, size_t newlen) {
  int order;
  order = memcmp(old, new, ((oldlen) < (newlen) ? (oldlen) : (newlen)));
  if (order == 0)
    return oldlen - newlen;
  return order;
}


x86 assembly (clang, -O0):
<different>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1153 <different+0x43>
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    115b <different+0x4b>
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rdx
call   1030 <memcmp@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1189 <different+0x79>
mov    -0x20(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    118f <different+0x7f>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<different>:
push   %rbx
mov    %rdx,%rbx
sub    %rcx,%rbx
cmovae %rcx,%rdx
call   1030 <memcmp@plt>
test   %eax,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @different(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = load i64, i64* %8
br label %20
18: ; preds = %4
%19 = load i64, i64* %9
br label %20
20: ; preds = %18, %16
%21 = phi i64 [ %17, %16 ], [ %19, %18 ]
%22 = call i32 @memcmp(i8* %11, i8* %12, i64 %21)
store i32 %22, i32* %10
%23 = load i32, i32* %10
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %20
%26 = load i64, i64* %8
%27 = load i64, i64* %9
%28 = sub i64 %26, %27
%29 = trunc i64 %28 to i32
store i32 %29, i32* %5
br label %32
30: ; preds = %20
%31 = load i32, i32* %10
store i32 %31, i32* %5
br label %32
32: ; preds = %30, %25
%33 = load i32, i32* %5
ret i32 %33
}

LLVM IR (-O2):
define i32 @different(i8* nocapture %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = icmp ult i64 %2, %3
%6 = select i1 %5, i64 %2, i64 %3
%7 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %6)
%8 = icmp eq i32 %7, 0
%9 = sub i64 %2, %3
%10 = trunc i64 %9 to i32
%11 = select i1 %8, i32 %10, i32 %7
ret i32 %11
}
__attribute__((no, noclone)) unsigned __int128 t164_2sub(unsigned __int128 y) {
  unsigned __int128 x = (15);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t164_2sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0xf,-0x40(%rbp)
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
setb   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t164_2sub+0x5e>
jmp    1175 <t164_2sub+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t164_2sub>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
mov    $0xf,%ebx
sub    %rdi,%rbx
sbb    %rsi,%r14
jae    112b <t164_2sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t164_2sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 15, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t164_2sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.usub.with.overflow.i128(i128 15, i128 %6)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ esp_rom_crc8_le(int /*<<< orphan*/,
                                   int /*<<< orphan*/ const *,
                                   int /*<<< orphan*/);
uint8_t esp_crc8_le(uint8_t crc, uint8_t const *buf, uint32_t len) {
  return esp_rom_crc8_le(crc, buf, len);
}


x86 assembly (clang, -O0):
<esp_crc8_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <esp_rom_crc8_le@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp_crc8_le>:
jmp    1030 <esp_rom_crc8_le@plt>

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

LLVM IR (-O2):
define i32 @esp_crc8_le(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @esp_rom_crc8_le(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
char div_char(void) {
  char a = 4, b = 2;
  (void)_Generic((a / b), int : 0);
}


x86 assembly (clang, -O0):
<div_char>:
push   %rbp
mov    %rsp,%rbp
movb   $0x4,-0x2(%rbp)
movb   $0x2,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @div_char() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
store i8 4, i8* %2
store i8 2, i8* %3
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @div_char() {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ recv_ack();
scalar_t__ send_msg(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
void set_asr(int flag) {
  char buf[80];
  sprintf(buf, "C ASR %d\n", flag);
  if (send_msg(buf, strlen(buf))) {
    recv_ack();
  }
}


x86 assembly (clang, -O0):
<set_asr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea7(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x68(%rbp),%rdi
mov    %eax,%esi
call   1050 <send_msg@plt>
cmp    $0x0,%rax
je     118b <set_asr+0x4b>
mov    $0x0,%al
call   1030 <recv_ack@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_asr>:
push   %rbx
sub    $0x50,%rsp
mov    %edi,%edx
lea    0xeb2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <send_msg@plt>
test   %rax,%rax
je     1177 <set_asr+0x37>
xor    %eax,%eax
call   1030 <recv_ack@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"C ASR %d\0A\00"
define void @set_asr(i32 %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = call i64 @send_msg(i8* %7, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 (...) @recv_ack()
br label %14
14: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"C ASR %d\0A\00"
define void @set_asr(i32 %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @strlen(i8* %3)
%6 = call i64 @send_msg(i8* %3, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @recv_ack()
br label %10
10: ; preds = %8, %1
ret void
}
/* Variables and functions */
int i2c_send_byte_2(int, int, char);
int OLED_wrcmd(char cmd) { return i2c_send_byte_2(0x3C, 0x00, cmd); }


x86 assembly (clang, -O0):
<OLED_wrcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3c,%edi
xor    %esi,%esi
movsbl -0x1(%rbp),%edx
call   1030 <i2c_send_byte_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OLED_wrcmd>:
mov    %edi,%edx
mov    $0x3c,%edi
xor    %esi,%esi
jmp    1030 <i2c_send_byte_2@plt>

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

LLVM IR (-O2):
define i32 @OLED_wrcmd(i8 signext %0) {
%2 = tail call i32 @i2c_send_byte_2(i32 60, i32 0, i8 signext %0)
ret i32 %2
}
double func1(double *x, int N) {
  double f;
  f = x[0] * x[0] + x[1] * x[1] - 2;
  return f;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  0xee3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @func1(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fmul double %14, %17
%19 = call double @llvm.fmuladd.f64(double %8, double %11, double %18)
%20 = fsub double %19, 2.000000e+00
store double %20, double* %5
%21 = load double, double* %5
ret double %21
}

LLVM IR (-O2):
define double @func1(double* nocapture %0, i32 %1) {
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = fmul double %5, %5
%7 = tail call double @llvm.fmuladd.f64(double %3, double %3, double %6)
%8 = fadd double %7, -2.000000e+00
ret double %8
}
/* Variables and functions */
char *place_commas_in_number_string(char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
char *place_commas_in_unsigned_int(unsigned int n) {
  char s[20];
  sprintf(s, "%u", n);
  return place_commas_in_number_string(s);
}


x86 assembly (clang, -O0):
<place_commas_in_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<place_commas_in_unsigned_int>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i8* @place_commas_in_unsigned_int(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i8* @place_commas_in_number_string(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i8* @place_commas_in_unsigned_int(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i8* @place_commas_in_number_string(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_roundf();
scalar_t__ roundf(float);
void test_roundf(float f) {
  if (roundf(f) != roundf(f))
    link_failure_roundf();
}


x86 assembly (clang, -O0):
<test_roundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <roundf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <roundf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_roundf+0x3c>
mov    $0x0,%al
call   1030 <link_failure_roundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_roundf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <roundf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <roundf@plt>
cmp    %rax,%rbx
jne    1149 <test_roundf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_roundf@plt>

LLVM IR (-O0):
define void @test_roundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @roundf(float %3)
%5 = load float, float* %2
%6 = call i64 @roundf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_roundf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_roundf(float %0) {
%2 = tail call i64 @roundf(float %0)
%3 = tail call i64 @roundf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_roundf()
br label %7
7: ; preds = %5, %1
ret void
}