xunge/DecIR huggingface dataset:
char *ufmt(unsigned int v, unsigned int base, char *end) {
  unsigned int r, q = v;
  char *p = end;
  do {
    v = q;
    r = q % base;
    q = q / base;
    *--p = r >= 10 ? r - 10 + 'a' : r + '0';
  } while (q);
  return p;
}


x86 assembly (clang, -O0):
<ufmt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x18(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0x18(%rbp)
cmpl   $0xa,-0x14(%rbp)
jb     1153 <ufmt+0x53>
mov    -0x14(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %eax,-0x24(%rbp)
jmp    115c <ufmt+0x5c>
mov    -0x14(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,-0x1(%rax)
cmpl   $0x0,-0x18(%rbp)
jne    111c <ufmt+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ufmt>:
mov    %rdx,%rcx
mov    %edi,%r9d
cs nopw 0x0(%rax,%rax,1)
mov    %r9d,%eax
xor    %edx,%edx
div    %esi
lea    0x30(%rdx),%r8d
lea    0x57(%rdx),%edi
cmp    $0xa,%edx
cmovb  %r8d,%edi
mov    %dil,-0x1(%rcx)
add    $0xffffffffffffffff,%rcx
cmp    %esi,%r9d
mov    %eax,%r9d
jae    1110 <ufmt+0x10>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @ufmt(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%10 = load i32, i32* %4
store i32 %10, i32* %8
%11 = load i8*, i8** %6
store i8* %11, i8** %9
br label %12
12: ; preds = %34, %3
%13 = load i32, i32* %8
store i32 %13, i32* %4
%14 = load i32, i32* %8
%15 = load i32, i32* %5
%16 = urem i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %8
%18 = load i32, i32* %5
%19 = udiv i32 %17, %18
store i32 %19, i32* %8
%20 = load i32, i32* %7
%21 = icmp uge i32 %20, 10
br i1 %21, label %22, label %26
22: ; preds = %12
%23 = load i32, i32* %7
%24 = sub i32 %23, 10
%25 = add i32 %24, 97
br label %29
26: ; preds = %12
%27 = load i32, i32* %7
%28 = add i32 %27, 48
br label %29
29: ; preds = %26, %22
%30 = phi i32 [ %25, %22 ], [ %28, %26 ]
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %9
%33 = getelementptr inbounds i8, i8* %32, i32 -1
store i8* %33, i8** %9
store i8 %31, i8* %33
br label %34
34: ; preds = %29
%35 = load i32, i32* %8
%36 = icmp ne i32 %35, 0
br i1 %36, label %12, label %37
37: ; preds = %34
%38 = load i8*, i8** %9
ret i8* %38
}

LLVM IR (-O2):
define i8* @ufmt(i32 %0, i32 %1, i8* writeonly %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ %0, %3 ], [ %8, %4 ]
%6 = phi i8* [ %2, %3 ], [ %13, %4 ]
%7 = urem i32 %5, %1
%8 = udiv i32 %5, %1
%9 = icmp ugt i32 %7, 9
%10 = select i1 %9, i32 87, i32 48
%11 = add i32 %10, %7
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %12, i8* %13
%14 = icmp ult i32 %5, %1
br i1 %14, label %15, label %4
15: ; preds = %4
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int pAddress(char *value) {
  printf("Address : %s\n", value);
  return 0;
}


x86 assembly (clang, -O0):
<pAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pAddress>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Address : %s\0A\00"
define i32 @pAddress(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Address : %s\0A\00"
define i32 @pAddress(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
void set_dword(unsigned char *data, unsigned long value) {
  data[3] = (value >> 24) & 0xff;
  data[2] = (value >> 16) & 0xff;
  data[1] = (value >> 8) & 0xff;
  data[0] = (value >> 0) & 0xff;
}


x86 assembly (clang, -O0):
<set_dword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x0,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @set_dword(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %4, i8* %5
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %8
%9 = lshr i64 %1, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %10, i8* %11
%12 = trunc i64 %1 to i8
store i8 %12, i8* %0
ret void
}
long double __attribute__((const)) cargl(long double _Complex _Z) {
  long double res;
  __asm__("fpatan;" : "=t"(res) : "0"(__real__ _Z), "u"(__imag__ _Z) : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<cargl>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fpatan
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cargl>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fxch   %st(1)
fpatan
ret

LLVM IR (-O0):
define x86_fp80 @cargl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca x86_fp80
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = call x86_fp80 asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4, x86_fp80 %6)
store x86_fp80 %7, x86_fp80* %2
%8 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @cargl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%5 = load x86_fp80, x86_fp80* %4
%6 = tail call x86_fp80 asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %3, x86_fp80 %5)
ret x86_fp80 %6
}
/* Variables and functions */
int /*<<< orphan*/ RESET();
void CPU_RESET() { RESET(); }


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

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

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

LLVM IR (-O2):
define void @CPU_RESET() {
%1 = tail call i32 (...) @RESET()
ret void
}
void msm_fsusb_rpc_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_fsusb_rpc_deinit() {
ret void
}
/* Variables and functions */
int atoi(char *);
int ExtractSecond(const char *RawDate) {
  char RawSecond[5];
  int Temp;
  RawSecond[0] = RawDate[17];
  RawSecond[1] = RawDate[18];
  RawSecond[2] = 0;
  Temp = atoi(RawSecond);
  return Temp;
}


x86 assembly (clang, -O0):
<ExtractSecond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x11(%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    0x12(%rax),%al
mov    %al,-0xc(%rbp)
movb   $0x0,-0xb(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExtractSecond>:
push   %rax
mov    0x11(%rdi),%al
mov    %al,0x3(%rsp)
mov    0x12(%rdi),%al
mov    %al,0x4(%rsp)
movb   $0x0,0x5(%rsp)
lea    0x3(%rsp),%rdi
call   1030 <atoi@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ExtractSecond(i8* nocapture %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %0, i64 17
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = getelementptr inbounds i8, i8* %0, i64 18
%7 = load i8, i8* %6
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 2
store i8 0, i8* %9
%10 = call i32 @atoi(i8* %3)
ret i32 %10
}
int wpas_p2p_in_progress(struct wpa_supplicant *wpa_s) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define i32 @wpas_p2p_in_progress(%struct.wpa_supplicant* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double absolute_timestamp(void) {
  struct timespec t;
  clock_gettime(CLOCK_REALTIME, &t);
  return t.tv_sec + t.tv_nsec * 1e-9;
}


x86 assembly (clang, -O0):
<absolute_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute_timestamp>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
@CLOCK_REALTIME = global i32 0
define double @absolute_timestamp() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-09, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
@CLOCK_REALTIME = global i32 0
define double @absolute_timestamp() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-09, double %6)
ret double %10
}
reg0reg1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (r0 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0reg1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     113c <reg0reg1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <reg0reg1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0reg1>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @reg0reg1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* %8
%15 = load double, double* %9
%16 = fcmp ole double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %7
br label %19
18: ; preds = %6
store i32 0, i32* %7
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @reg0reg1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = fcmp ole double %0, %1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int /*<<< orphan*/);
void C67_LDW_PTR(int r, int r2) { C67_asm("LDW.D *", r, r2, 0); }


x86 assembly (clang, -O0):
<C67_LDW_PTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
xor    %ecx,%ecx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_LDW_PTR>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"LDW.D *\00"
define void @C67_LDW_PTR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"LDW.D *\00"
define void @C67_LDW_PTR(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ long2str(char *, long);
char *new_str(int /*<<< orphan*/);
char *new_long2str(long n) {
  char tmp[22];
  return new_str(long2str(tmp, n));
}


x86 assembly (clang, -O0):
<new_long2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <long2str@plt>
mov    %eax,%edi
call   1040 <new_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_long2str>:
sub    $0x18,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <long2str@plt>
mov    %eax,%edi
call   1040 <new_str@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i8* @new_long2str(i64 %0) {
%2 = alloca i64
%3 = alloca [22 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [22 x i8], [22 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = call i32 @long2str(i8* %4, i64 %5)
%7 = call i8* @new_str(i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @new_long2str(i64 %0) {
%2 = alloca [22 x i8]
%3 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%4 = call i32 @long2str(i8* %3, i64 %0)
%5 = call i8* @new_str(i32 %4)
ret i8* %5
}
int check_servname(char *servname) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @check_servname(i8* nocapture readnone %0) {
ret i32 1
}
void swap(int *arr, int i, int j) {
  int temp = arr[i];
  arr[i] = arr[j];
  arr[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void foo_1_2_1_2_2_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_2_1_2_2_2() {
ret void
}
int gtm_event_log_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gtm_event_log_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ benchmark_example();
int main() {
  benchmark_example();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @benchmark_example()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putch(int /*<<< orphan*/);
void puts0(char *s) {
  while (*s)
    putch(*s++);
}


x86 assembly (clang, -O0):
<puts0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts0+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putch@plt>
jmp    111c <puts0+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts0>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts0+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts0+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts0(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putch(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void my_puts(char *s) {
  while (*s)
    putchar(*s++);
}


x86 assembly (clang, -O0):
<my_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <my_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <my_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <my_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <my_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @my_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int foo(unsigned char a, _Bool b) { return (!a & a) | (b & !b); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
and    $0x1,%al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x1(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
and    %ecx,%eax
mov    -0x2(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    -0x2(%rbp),%dl
xor    $0xff,%dl
and    $0x1,%dl
movzbl %dl,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i8 zeroext %0, i1 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = zext i1 %1 to i8
store i8 %5, i8* %4
%6 = load i8, i8* %3
%7 = icmp ne i8 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = and i32 %9, %11
%13 = load i8, i8* %4
%14 = trunc i8 %13 to i1
%15 = zext i1 %14 to i32
%16 = load i8, i8* %4
%17 = trunc i8 %16 to i1
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
%20 = and i32 %15, %19
%21 = or i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @foo(i8 zeroext %0, i1 zeroext %1) {
%3 = icmp eq i8 %0, 0
%4 = zext i1 %3 to i32
%5 = zext i8 %0 to i32
%6 = and i32 %4, %5
ret i32 %6
}
/* Type definitions */
struct KIrand {
  int dummy;
};

/* Variables and functions */
scalar_t__ KIrand_genrand_int32(struct KIrand *);
double KIrand_genrand_real2(struct KIrand *r) {
  return (double)KIrand_genrand_int32(r) * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<KIrand_genrand_real2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <KIrand_genrand_int32@plt>
cvtsi2sd %rax,%xmm0
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIrand_genrand_real2>:
push   %rax
call   1030 <KIrand_genrand_int32@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.KIrand = type { i32 }
define double @KIrand_genrand_real2(%struct.KIrand* %0) {
%2 = alloca %struct.KIrand*
store %struct.KIrand* %0, %struct.KIrand** %2
%3 = load %struct.KIrand*, %struct.KIrand** %2
%4 = call i64 @KIrand_genrand_int32(%struct.KIrand* %3)
%5 = sitofp i64 %4 to double
%6 = fmul double %5, 0x3DF0000000000000
ret double %6
}

LLVM IR (-O2):
%struct.KIrand = type { i32 }
define double @KIrand_genrand_real2(%struct.KIrand* %0) {
%2 = tail call i64 @KIrand_genrand_int32(%struct.KIrand* %0)
%3 = sitofp i64 %2 to double
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}
/* Type definitions */
union i2c_smbus_data {
  int word;
};
typedef int __s32;

/* Variables and functions */
scalar_t__ i2c_smbus_access(int, int, int, int, union i2c_smbus_data *);
extern __s32 i2c_smbus_read_word_data(int fd, int cmd) {
  union i2c_smbus_data data;
  if (i2c_smbus_access(fd, 1, cmd, 3, &data) <= 0) {
    return -1;
  } else {
    return 0x0FFFF & data.word;
  }
}


x86 assembly (clang, -O0):
<i2c_smbus_read_word_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
mov    $0x3,%ecx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
cmp    $0x0,%rax
jg     114d <i2c_smbus_read_word_data+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <i2c_smbus_read_word_data+0x48>
mov    -0x10(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_read_word_data>:
push   %rax
mov    %esi,%edx
mov    %rsp,%r8
mov    $0x1,%esi
mov    $0x3,%ecx
call   1030 <i2c_smbus_access@plt>
test   %rax,%rax
movzwl (%rsp),%ecx
mov    $0xffffffff,%eax
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
define i32 @i2c_smbus_read_word_data(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %union.i2c_smbus_data
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i64 @i2c_smbus_access(i32 %7, i32 1, i32 %8, i32 3, %union.i2c_smbus_data* %6)
%10 = icmp sle i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = bitcast %union.i2c_smbus_data* %6 to i32*
%14 = load i32, i32* %13
%15 = and i32 65535, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
define i32 @i2c_smbus_read_word_data(i32 %0, i32 %1) {
%3 = alloca %union.i2c_smbus_data
%4 = bitcast %union.i2c_smbus_data* %3 to i8*
%5 = call i64 @i2c_smbus_access(i32 %0, i32 1, i32 %1, i32 3, %union.i2c_smbus_data* %3)
%6 = icmp slt i64 %5, 1
%7 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %3, i64 0, i32 0
%8 = load i32, i32* %7
%9 = and i32 %8, 65535
%10 = select i1 %6, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ do_stuff(int);
int /*<<< orphan*/ printf(char *);
void recurse(int ctr, int v) {
  if (ctr--)
    recurse(ctr, v);
  else
    do_stuff(v);
  printf("ERROR!\n");
}


x86 assembly (clang, -O0):
<recurse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1162 <recurse+0x32>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <recurse@plt>
jmp    116a <recurse+0x3a>
mov    -0x8(%rbp),%edi
call   1050 <do_stuff@plt>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse>:
push   %rax
test   %edi,%edi
je     113f <recurse+0xf>
add    $0xffffffff,%edi
call   1030 <recurse@plt>
jmp    1146 <recurse+0x16>
mov    %esi,%edi
call   1050 <do_stuff@plt>
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@str = [7 x i8] c"ERROR!\00"
define void @recurse(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = add nsw i32 %0, -1
tail call void @recurse(i32 %5, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @do_stuff(i32 %1)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(const char *s) {
  int n;
  for (n = 0; *s != '\0'; s++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void mac_init(void) { puts("called mac_init"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"called mac_init\00"
define void @mac_init() {
%1 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"called mac_init\00"
define void @mac_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char getch();
int /*<<< orphan*/ kbhit();
char pressSmallKey() {
  char key;
  kbhit();
  key = getch();
  return key;
}


x86 assembly (clang, -O0):
<pressSmallKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <kbhit@plt>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @pressSmallKey() {
%1 = alloca i8
%2 = call i32 (...) @kbhit()
%3 = call signext i8 (...) @getch()
store i8 %3, i8* %1
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @pressSmallKey() {
%1 = tail call i32 (...) @kbhit()
%2 = tail call signext i8 (...) @getch()
ret i8 %2
}
/* Variables and functions */
int encode_decode_lib(char *, char *, int, char **);
int main(int argc, char **argv) {
  return encode_decode_lib("base64", "encode", argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xecc(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1030 <encode_decode_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    %rsi,%rcx
mov    %edi,%edx
lea    0xee4(%rip),%rdi
lea    0xee4(%rip),%rsi
jmp    1030 <encode_decode_lib@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"base64\00"
@.str.1 = [7 x i8] c"encode\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @encode_decode_lib(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8** %1)
ret i32 %3
}
void pcm8_write_dev(unsigned char *data, int len) {}


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

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

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

LLVM IR (-O2):
define void @pcm8_write_dev(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int ztimed_read_write_wait_millisecond(int, long, int *, int *);
int ztimed_read_write_wait(int fd, int read_write_wait_timeout, int *readable,
                           int *writeable) {
  return ztimed_read_write_wait_millisecond(fd, 1000L * read_write_wait_timeout,
                                            readable, writeable);
}


x86 assembly (clang, -O0):
<ztimed_read_write_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
movslq -0x8(%rbp),%rax
imul   $0x3e8,%rax,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <ztimed_read_write_wait_millisecond@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ztimed_read_write_wait>:
movslq %esi,%rax
imul   $0x3e8,%rax,%rsi
jmp    1030 <ztimed_read_write_wait_millisecond@plt>

LLVM IR (-O0):
define i32 @ztimed_read_write_wait(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = mul nsw i64 1000, %11
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = call i32 @ztimed_read_write_wait_millisecond(i32 %9, i64 %12, i32* %13, i32* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @ztimed_read_write_wait(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = sext i32 %1 to i64
%6 = mul nsw i64 %5, 1000
%7 = tail call i32 @ztimed_read_write_wait_millisecond(i32 %0, i64 %6, i32* %2, i32* %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void f(const int *xPtr) { printf("*XPtr's value is %d", *xPtr); }


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

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"*XPtr's value is %d\00"
define void @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"*XPtr's value is %d\00"
define void @f(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void register_iconv_charsets(void) {}


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

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

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

LLVM IR (-O2):
define void @register_iconv_charsets() {
ret void
}
double min(double x, double y) {
  if (x < y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <min+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void *extract_max(struct max_heap *h) {}


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

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

LLVM IR (-O0):
%struct.max_heap = type opaque
define i8* @extract_max(%struct.max_heap* %0) {
%2 = alloca i8*
%3 = alloca %struct.max_heap*
store %struct.max_heap* %0, %struct.max_heap** %3
%4 = load i8*, i8** %2
ret i8* %4
}

LLVM IR (-O2):
%struct.max_heap = type opaque
define noalias i8* @extract_max(%struct.max_heap* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ err(int, int);
char *malloc(int);
void test_brk(void) {
  char *big_stack;
  big_stack = malloc(16 * 1024 * 1024);
  if (big_stack == NULL)
    err(7, 1);
}


x86 assembly (clang, -O0):
<test_brk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1000000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1150 <test_brk+0x30>
mov    $0x7,%edi
mov    $0x1,%esi
call   1030 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_brk() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 16777216)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @err(i32 7, i32 1)
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @test_brk() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *res = realloc(ptr, size);
  if (!res)
    errx(1, "out of memory");
  return res;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115d <xrealloc+0x3d>
mov    $0x1,%edi
lea    0xea8(%rip),%rsi
call   1030 <errx@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xrealloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
int test_imm_5Cint32_mem(int *val) {
  return ((*val) & (0x5C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Cint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 92
%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_5Cint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 92
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int multfn(int x, int y) { return x * y; }


x86 assembly (clang, -O0):
<multfn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @multfn(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PR_SET_PDEATHSIG;
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ prctl(int /*<<< orphan*/, int /*<<< orphan*/);
void h_exit(char *errmesg) {
  perror(errmesg);
  prctl(PR_SET_PDEATHSIG, SIGHUP);
  exit(1);
}


x86 assembly (clang, -O0):
<h_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1030 <prctl@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<h_exit>:
push   %rax
call   1040 <perror@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
call   1030 <prctl@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@PR_SET_PDEATHSIG = global i32 0
@SIGHUP = global i32 0
define void @h_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @PR_SET_PDEATHSIG
%6 = load i32, i32* @SIGHUP
%7 = call i32 @prctl(i32 %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@PR_SET_PDEATHSIG = global i32 0
@SIGHUP = global i32 0
define void @h_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @PR_SET_PDEATHSIG
%4 = load i32, i32* @SIGHUP
%5 = tail call i32 @prctl(i32 %3, i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int setcns(int, int, char *);
int cmd_radio_off(int argc, char **argv) {
  char data[4] = {0x00, 0x00, 0x00, 0x00};
  return setcns(0x1075, 4, data);
}


x86 assembly (clang, -O0):
<cmd_radio_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x14(%rbp),%rdx
mov    $0x1075,%edi
mov    $0x4,%esi
call   1040 <setcns@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_radio_off>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x1075,%edi
mov    $0x4,%esi
call   1030 <setcns@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmd_radio_off(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [4 x i8]* %5 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%8 = call i32 @setcns(i32 4213, i32 4, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmd_radio_off(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @setcns(i32 4213, i32 4, i8* %4)
ret i32 %5
}