xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t pow10_g(uint32_t x) {
  uint32_t ret = 10;
  for (uint32_t i = 1; i < x; i++) {
    ret *= 10;
  }
  return ret;
}


x86 assembly (clang, -O0):
<pow10_g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0xa,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1140 <pow10_g+0x40>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <pow10_g+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow10_g>:
mov    $0xa,%eax
cmp    $0x2,%rdi
jl     115d <pow10_g+0x5d>
lea    -0x1(%rdi),%rdx
add    $0xfffffffffffffffe,%rdi
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x7,%rdi
jae    1125 <pow10_g+0x25>
mov    $0xa,%eax
jmp    113d <pow10_g+0x3d>
and    $0xfffffffffffffff8,%rdx
mov    $0xa,%eax
xchg   %ax,%ax
imul   $0x5f5e100,%rax,%rax
add    $0xfffffffffffffff8,%rdx
jne    1130 <pow10_g+0x30>
test   %rcx,%rcx
je     115d <pow10_g+0x5d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %rax,%rax
lea    (%rax,%rax,4),%rax
add    $0xffffffffffffffff,%rcx
jne    1150 <pow10_g+0x50>
ret

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

LLVM IR (-O2):
define i64 @pow10_g(i64 %0) {
%2 = icmp sgt i64 %0, 1
br i1 %2, label %3, label %20
3: ; preds = %1
%4 = add i64 %0, -1
%5 = add i64 %0, -2
%6 = and i64 %4, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = and i64 %4, -8
br label %22
10: ; preds = %22, %3
%11 = phi i64 [ undef, %3 ], [ %25, %22 ]
%12 = phi i64 [ 10, %3 ], [ %25, %22 ]
%13 = icmp eq i64 %6, 0
br i1 %13, label %20, label %14
14: ; preds = %10, %14
%15 = phi i64 [ %17, %14 ], [ %12, %10 ]
%16 = phi i64 [ %18, %14 ], [ 0, %10 ]
%17 = mul nsw i64 %15, 10
%18 = add i64 %16, 1
%19 = icmp eq i64 %18, %6
br i1 %19, label %20, label %14
20: ; preds = %10, %14, %1
%21 = phi i64 [ 10, %1 ], [ %11, %10 ], [ %17, %14 ]
ret i64 %21
22: ; preds = %22, %8
%23 = phi i64 [ 10, %8 ], [ %25, %22 ]
%24 = phi i64 [ 0, %8 ], [ %26, %22 ]
%25 = mul i64 %23, 100000000
%26 = add i64 %24, 8
%27 = icmp eq i64 %26, %9
br i1 %27, label %10, label %22
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void setup() {
  signal(SIGINT, SIG_IGN);
  signal(SIGQUIT, SIG_IGN);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGQUIT = global i32 0
define void @setup() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGQUIT
%5 = load i32, i32* @SIG_IGN
%6 = call i32 @signal(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGQUIT = global i32 0
define void @setup() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGQUIT
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
ret void
}
void XrmPutLineResource() {}


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

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

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

LLVM IR (-O2):
define void @XrmPutLineResource() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BN_GENCB;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void BN_GENCB_free(BN_GENCB *cb) {
  if (cb == NULL)
    return;
  free(cb);
}


x86 assembly (clang, -O0):
<BN_GENCB_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <BN_GENCB_free+0x1c>
jmp    1135 <BN_GENCB_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_GENCB_free>:
test   %rdi,%rdi
je     111a <BN_GENCB_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @BN_GENCB_free(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i32* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char const *, int, unsigned int,
                          int /*<<< orphan*/ *);
void sendBytes(const unsigned char *data, unsigned int numBytes, FILE *out) {
  if (data != NULL && numBytes > 0)
    fwrite(data, 1, numBytes, out);
}


x86 assembly (clang, -O0):
<sendBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114d <sendBytes+0x3d>
cmpl   $0x0,-0xc(%rbp)
jbe    114d <sendBytes+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendBytes>:
test   %rdi,%rdi
je     1128 <sendBytes+0x18>
mov    %rdx,%rcx
mov    %esi,%edx
test   %esi,%esi
je     1128 <sendBytes+0x18>
mov    $0x1,%esi
jmp    1030 <fwrite@plt>
ret

LLVM IR (-O0):
define void @sendBytes(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 i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp ugt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = load i32*, i32** %6
%16 = call i32 @fwrite(i8* %13, i32 1, i32 %14, i32* %15)
br label %17
17: ; preds = %12, %9, %3
ret void
}

LLVM IR (-O2):
define void @sendBytes(i8* %0, i32 %1, i32* nocapture %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i32 %1, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32* %2)
br label %9
9: ; preds = %7, %3
ret void
}
void i2d_X509_CINF(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_X509_CINF() {
ret void
}
long CG_im11(i)
long i;
{ return (((0x400 & i) >> 10) | ((0x3ff & i) << 1)); }


x86 assembly (clang, -O0):
<CG_im11>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x400,%rax
sar    $0xa,%rax
mov    -0x8(%rbp),%rcx
and    $0x3ff,%rcx
shl    $0x1,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_im11>:
mov    %edi,%eax
shr    $0xa,%eax
and    $0x1,%eax
and    $0x3ff,%edi
lea    (%rax,%rdi,2),%rax
ret

LLVM IR (-O0):
define i64 @CG_im11(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 1024, %3
%5 = ashr i64 %4, 10
%6 = load i64, i64* %2
%7 = and i64 1023, %6
%8 = shl i64 %7, 1
%9 = or i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @CG_im11(i64 %0) {
%2 = lshr i64 %0, 10
%3 = and i64 %2, 1
%4 = shl i64 %0, 1
%5 = and i64 %4, 2046
%6 = or i64 %3, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void rem(void *e) { free(e); }


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

x86 assembly (clang, -O2):
<rem>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @rem(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int sprintf(char *, char *, char *, unsigned char, unsigned char, unsigned char,
            unsigned char);
int sprintip(char *dest, char *pre, unsigned char *ip) {
  return sprintf(dest, "%s%d.%d.%d.%d ", pre, ip[0], ip[1], ip[2], ip[3]);
}


x86 assembly (clang, -O0):
<sprintip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%r8b
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%r9b
mov    -0x18(%rbp),%rax
lea    0xeb3(%rip),%rsi
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl 0x3(%rax),%eax
mov    %eax,(%rsp)
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprintip>:
push   %rax
mov    %rsi,%rax
movzbl (%rdx),%ecx
movzbl 0x1(%rdx),%r8d
movzbl 0x2(%rdx),%r9d
movzbl 0x3(%rdx),%edx
mov    %edx,(%rsp)
lea    0xed1(%rip),%rsi
mov    %rax,%rdx
call   1030 <sprintf@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s%d.%d.%d.%d \00"
define i32 @sprintip(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = load i8, i8* %19
%21 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %8, i8 zeroext %11, i8 zeroext %14, i8 zeroext %17, i8 zeroext %20)
ret i32 %21
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s%d.%d.%d.%d \00"
define i32 @sprintip(i8* nocapture writeonly %0, i8* %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %2, i64 2
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %2, i64 3
%10 = load i8, i8* %9
%11 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8 zeroext %4, i8 zeroext %6, i8 zeroext %8, i8 zeroext %10)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ MQTTClient_yield();
void mqtt_yield(void) { MQTTClient_yield(); }


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

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

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

LLVM IR (-O2):
define void @mqtt_yield() {
%1 = tail call i32 (...) @MQTTClient_yield()
ret void
}
__attribute__((always_)) void cl_prefetch_w(void *p) {
  asm volatile("prefetchw (%0)\n\t" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<cl_prefetch_w>:
prefetchw (%rdi)
ret

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

LLVM IR (-O2):
define void @cl_prefetch_w(i8* %0) {
tail call void asm sideeffect "prefetchw ($0)\0A\09", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
int conditional(int x, int y, int z) { return (~!!x + 1 & y) + (~!x + 1 & z); }


x86 assembly (clang, -O0):
<conditional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
and    -0x8(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
and    -0xc(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditional>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @conditional(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 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = xor i32 %11, -1
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %5
%15 = and i32 %13, %14
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
%20 = xor i32 %19, -1
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = and i32 %21, %22
%24 = add nsw i32 %15, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @conditional(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int flac_vsnprintf(char *str, size_t size, const char *fmt, va_list va) {
  int rc;
  rc = vsnprintf(str, size, fmt, va);
  return rc;
}


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

x86 assembly (clang, -O2):
<flac_vsnprintf>:
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @flac_vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
int getNum(char a, char b) {
  int x = 10 * (a - '0');
  return (x + (b - '0'));
}


x86 assembly (clang, -O0):
<getNum>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNum>:
lea    (%rdi,%rdi,4),%eax
lea    (%rsi,%rax,2),%eax
add    $0xfffffdf0,%eax
ret

LLVM IR (-O0):
define i32 @getNum(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 48
%9 = mul nsw i32 10, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = add nsw i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @getNum(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = mul nsw i32 %3, 10
%5 = sext i8 %1 to i32
%6 = add nsw i32 %5, -528
%7 = add nsw i32 %6, %4
ret i32 %7
}
int ned_getdouble(d)
long double *d;
{
  char s[100 + 1];
  if (ned_gets(s) < 0)
    return (-1);
  sscanf(s, "%lf", d);
  return (0);
}


x86 assembly (clang, -O0):
<ned_getdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1030 <ned_gets@plt>
cmp    $0x0,%eax
jge    114f <ned_getdouble+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <ned_getdouble+0x4c>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea2(%rip),%rsi
mov    $0x0,%al
call   1040 <sscanf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ned_getdouble>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%r14
xor    %ebx,%ebx
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <ned_gets@plt>
test   %eax,%eax
js     1150 <ned_getdouble+0x30>
lea    0xebf(%rip),%rsi
mov    %rsp,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
jmp    1155 <ned_getdouble+0x35>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @ned_getdouble(x86_fp80* %0) {
%2 = alloca i32
%3 = alloca x86_fp80*
%4 = alloca [101 x i8]
store x86_fp80* %0, x86_fp80** %3
%5 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @ned_gets to i32 (i8*, ...)*)(i8* %5)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%11 = load x86_fp80*, x86_fp80** %3
%12 = call i32 (i8*, i8*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80* %11)
store i32 0, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @ned_getdouble(x86_fp80* %0) {
%2 = alloca [101 x i8]
%3 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ned_gets to i32 (i8*, ...)*)(i8* %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (i8*, i8*, ...) @sscanf(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80* %0)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 0, %6 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
__attribute__((section(".after_vectors"))) void SVC_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: enet_tap [-b <buffer size>] -i <device>\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: enet_tap [-b <buffer size>] -i <device>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: enet_tap [-b <buffer size>] -i <device>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void foo433(int p) {}


x86 assembly (clang, -O0):
<foo433>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo433(i32 %0) {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int plat_get_ticks_us(void) {
  struct timeval tv;
  unsigned int ret;
  gettimeofday(&tv, NULL);
  ret = (unsigned)tv.tv_sec * 1000000;
  ret += (unsigned)tv.tv_usec;
  return ret;
}


x86 assembly (clang, -O0):
<plat_get_ticks_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plat_get_ticks_us>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @plat_get_ticks_us() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul i32 %6, 1000000
store i32 %7, i32* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = load i32, i32* %2
%12 = add i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @plat_get_ticks_us() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add i32 %7, %10
ret i32 %11
}
/* Variables and functions */
void make_space_string(char *P_string, size_t P_size) {
  size_t L_i;
  for (L_i = 0; L_i < P_size; L_i++) {
    P_string[L_i] = ' ';
  }
  P_string[L_i] = '\0';
}


x86 assembly (clang, -O0):
<make_space_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    113f <make_space_string+0x3f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <make_space_string+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_space_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     112f <make_space_string+0x1f>
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @make_space_string(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %14, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8 32, i8* %13
br label %14
14: ; preds = %10
%15 = load i64, i64* %5
%16 = add i64 %15, 1
store i64 %16, i64* %5
br label %6
17: ; preds = %6
%18 = load i8*, i8** %3
%19 = load i64, i64* %5
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %20
ret void
}

LLVM IR (-O2):
define void @make_space_string(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
%6 = getelementptr inbounds i8, i8* %0, i64 %1
store i8 0, i8* %6
ret void
}
int SupportFunction(int arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i32 @SupportFunction(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ core6_swap(char *, int);
void U_EMRPOLYLINE16_swap(char *record, int torev) {
  core6_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYLINE16_swap>:
jmp    1030 <core6_swap@plt>

LLVM IR (-O0):
define void @U_EMRPOLYLINE16_swap(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 = call i32 @core6_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_EMRPOLYLINE16_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core6_swap(i8* %0, i32 %1)
ret void
}
int myatoi(char s[]) {
  int i;
  int n = 0;
  for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i) {
    n = 10 * n + s[i] - '0';
  }
  return n;
}


x86 assembly (clang, -O0):
<myatoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
jl     1145 <myatoi+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1155 <myatoi+0x55>
jmp    117b <myatoi+0x7b>
imul   $0xa,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <myatoi+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myatoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <myatoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <myatoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @myatoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %18
5: ; preds = %1, %5
%6 = phi i64 [ %13, %5 ], [ 0, %1 ]
%7 = phi i8 [ %15, %5 ], [ %2, %1 ]
%8 = phi i32 [ %12, %5 ], [ 0, %1 ]
%9 = zext i8 %7 to i32
%10 = mul nsw i32 %8, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = add nuw nsw i64 %6, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %5, label %18
18: ; preds = %5, %1
%19 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %19
}
int consecutivechar(char line[], char c, int pos, int times) {
  int i, limit = pos + times;
  for (i = pos; i < limit; i++)
    line[i] = c;
  return limit;
}


x86 assembly (clang, -O0):
<consecutivechar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    114b <consecutivechar+0x4b>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1123 <consecutivechar+0x23>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<consecutivechar>:
push   %rbx
lea    (%rcx,%rdx,1),%ebx
test   %ecx,%ecx
jle    1137 <consecutivechar+0x27>
movslq %edx,%rdx
add    %rdx,%rdi
lea    0x1(%rdx),%eax
cmp    %eax,%ebx
cmovg  %ebx,%eax
not    %edx
add    %eax,%edx
add    $0x1,%rdx
movzbl %sil,%esi
call   1030 <memset@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @consecutivechar(i8* %0, i8 signext %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = add nsw i32 %11, %12
store i32 %13, i32* %10
%14 = load i32, i32* %7
store i32 %14, i32* %9
br label %15
15: ; preds = %25, %4
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8, i8* %6
%21 = load i8*, i8** %5
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
br label %25
25: ; preds = %19
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %15
28: ; preds = %15
%29 = load i32, i32* %10
ret i32 %29
}

LLVM IR (-O2):
define i32 @consecutivechar(i8* nocapture writeonly %0, i8 signext %1, i32 %2, i32 %3) {
%5 = add i32 %3, %2
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = sext i32 %2 to i64
%9 = getelementptr i8, i8* %0, i64 %8
%10 = add i32 %2, 1
%11 = call i32 @llvm.smax.i32(i32 %5, i32 %10)
%12 = xor i32 %2, -1
%13 = add i32 %11, %12
%14 = zext i32 %13 to i64
%15 = add nuw nsw i64 %14, 1
br label %16
16: ; preds = %7, %4
ret i32 %5
}
extern float Int24ToFloat(int a) {
  float out = ((float)(a << 8)) * 4.656612873e-10;
  return (out);
}


x86 assembly (clang, -O0):
<Int24ToFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int24ToFloat>:
shl    $0x8,%edi
cvtsi2ss %edi,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeed(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @Int24ToFloat(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 8
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
%8 = fmul double %7, 0x3DFFFFFFFFFDB73D
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %3
ret float %10
}

LLVM IR (-O2):
define float @Int24ToFloat(i32 %0) {
%2 = shl i32 %0, 8
%3 = sitofp i32 %2 to float
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3DFFFFFFFFFDB73D
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ JSIOCGNAME(int);
scalar_t__ ioctl(int, int /*<<< orphan*/, char *);
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *ljoy_GetName(int id) {
  char *name = malloc(128);
  if (ioctl(id, JSIOCGNAME(128), name) < 0)
    strcpy(name, "Unknown");
  return (name);
}


x86 assembly (clang, -O0):
<ljoy_GetName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x80,%edi
call   1060 <JSIOCGNAME@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
jge    1191 <ljoy_GetName+0x51>
mov    -0x10(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ljoy_GetName>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x80,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x80,%edi
call   1060 <JSIOCGNAME@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <ioctl@plt>
test   %rax,%rax
jns    117c <ljoy_GetName+0x3c>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Unknown\00"
define i8* @ljoy_GetName(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 128)
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = call i32 @JSIOCGNAME(i32 128)
%7 = load i8*, i8** %3
%8 = call i64 @ioctl(i32 %5, i32 %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [8 x i8] c"Unknown\00"
define i8* @ljoy_GetName(i32 %0) {
%2 = tail call dereferenceable_or_null(128) i8* @malloc(i32 128)
%3 = tail call i32 @JSIOCGNAME(i32 128)
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i8* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int arg2(int a1, int a2) {
  printf("%d\n", a1 + a2);
  return a2;
}


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

x86 assembly (clang, -O2):
<arg2>:
push   %rbx
mov    %esi,%ebx
lea    (%rdi,%rbx,1),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @arg2(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 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @arg2(i32 %0, i32 returned %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %1
}
int maxInt(int a, int b) { return (a > b) ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @maxInt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct response {
  int dummy;
};

/* Variables and functions */
int resp_header_locate(struct response const *, char const *,
                       int /*<<< orphan*/, char const **, char const **);
unsigned char resp_header_get(const struct response *resp, const char *name,
                              const char **begptr, const char **endptr) {
  int pos = resp_header_locate(resp, name, 0, begptr, endptr);
  return pos != -1;
}


x86 assembly (clang, -O0):
<resp_header_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
xor    %edx,%edx
call   1030 <resp_header_locate@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resp_header_get>:
push   %rax
mov    %rcx,%r8
mov    %rdx,%rcx
xor    %edx,%edx
call   1030 <resp_header_locate@plt>
cmp    $0xffffffff,%eax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.response = type { i32 }
define zeroext i8 @resp_header_get(%struct.response* %0, i8* %1, i8** %2, i8** %3) {
%5 = alloca %struct.response*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32
store %struct.response* %0, %struct.response** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%10 = load %struct.response*, %struct.response** %5
%11 = load i8*, i8** %6
%12 = load i8**, i8*** %7
%13 = load i8**, i8*** %8
%14 = call i32 @resp_header_locate(%struct.response* %10, i8* %11, i32 0, i8** %12, i8** %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp ne i32 %15, -1
%17 = zext i1 %16 to i32
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
%struct.response = type { i32 }
define zeroext i8 @resp_header_get(%struct.response* %0, i8* %1, i8** %2, i8** %3) {
%5 = tail call i32 @resp_header_locate(%struct.response* %0, i8* %1, i32 0, i8** %2, i8** %3)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) die(char const *message) {
  fflush(NULL);
  fprintf(stderr, "FATAL: %s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <fflush@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"FATAL: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fflush(i32* null)
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"FATAL: %s\0A\00"
define void @die(i8* %0) {
%2 = tail call i32 @fflush(i32* null)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, int *, int);
int frandom() {
  int data = open("/dev/random", O_RDONLY);
  int result = 0;
  read(data, &result, sizeof result);
  close(data);
  return result;
}


x86 assembly (clang, -O0):
<frandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frandom>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <read@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/random\00"
@O_RDONLY = global i32 0
define i32 @frandom() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %1
store i32 0, i32* %2
%5 = load i32, i32* %1
%6 = call i32 @read(i32 %5, i32* %2, i32 4)
%7 = load i32, i32* %1
%8 = call i32 @close(i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/random\00"
@O_RDONLY = global i32 0
define i32 @frandom() {
%1 = alloca i32
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = call i32 @read(i32 %3, i32* %1, i32 4)
%6 = tail call i32 @close(i32 %3)
%7 = load i32, i32* %1
ret i32 %7
}
void TMTimerToMicro(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerToMicro() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printCounting(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  printf("Enter last no: ");
  scanf("%d", &i);
  printf("\nCalling header function ");
  printCounting(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <printCounting@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
call   1040 <printCounting@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter last no: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0ACalling header function \00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 @printCounting(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter last no: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0ACalling header function \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @printCounting(i32 %6)
ret i32 0
}
int GoogleHotwordDspInit(void *hotword_memmap) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @GoogleHotwordDspInit(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ list_remove(int);
void list_clear(void) {
  int i;
  for (i = 0; i < 1000; i++) {
    list_remove(i);
  }
}


x86 assembly (clang, -O0):
<list_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    1142 <list_clear+0x32>
mov    -0x4(%rbp),%edi
call   1030 <list_remove@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <list_clear+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_clear>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <list_remove@plt>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1120 <list_clear+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @list_clear() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @list_remove(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @list_clear() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @list_remove(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}