xunge/DecIR huggingface dataset:
/* Variables and functions */
int udp_sockopen(int, int /*<<< orphan*/);
int UdpSockNobind(int port) { return (udp_sockopen(port, 0)); }


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

x86 assembly (clang, -O2):
<UdpSockNobind>:
xor    %esi,%esi
jmp    1030 <udp_sockopen@plt>

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

LLVM IR (-O2):
define i32 @UdpSockNobind(i32 %0) {
%2 = tail call i32 @udp_sockopen(i32 %0, i32 0)
ret i32 %2
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int FakeRand() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  srand(tv.tv_usec);
  return rand();
}


x86 assembly (clang, -O0):
<FakeRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FakeRand>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
call   1040 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @FakeRand() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @rand()
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @FakeRand() {
%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 0
%5 = load i32, i32* %4
%6 = tail call i32 @srand(i32 %5)
%7 = tail call i32 (...) @rand()
ret i32 %7
}
void libhal_free_string(char *str) {}


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

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

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

LLVM IR (-O2):
define void @libhal_free_string(i8* nocapture %0) {
ret void
}
int is_space(char c) {
  if (c && ((c == ' ') || (c == '\t') || (c == '\r') || (c == '\n')))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     1157 <is_space+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     114b <is_space+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     114b <is_space+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     114b <is_space+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1157 <is_space+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <is_space+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
cmp    $0x20,%dil
ja     1120 <is_space+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    1120 <is_space+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
switch i8 %0, label %2 [
i8 9, label %3
i8 32, label %3
i8 13, label %3
i8 10, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int mkdir(char const *, int);
int createANewFolder(const char *name) { return mkdir(name, 0777); }


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

x86 assembly (clang, -O2):
<createANewFolder>:
mov    $0x1ff,%esi
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @createANewFolder(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 511)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ dprintf(int /*<<< orphan*/, char *, ...);
void usage(char *name) {
  dprintf(STDERR_FILENO, "Usage: %s file\n", name);
  dprintf(STDERR_FILENO, "Where: file      Memory file from Commander TM\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <dprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1030 <dprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <dprintf@plt>

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
@.str = [16 x i8] c"Usage: %s file\0A\00"
@.str.1 = [48 x i8] c"Where: file Memory file from Commander TM\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @STDERR_FILENO
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @dprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @STDERR_FILENO
%7 = call i32 (i32, i8*, ...) @dprintf(i32 %6, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
@.str = [16 x i8] c"Usage: %s file\0A\00"
@.str.1 = [48 x i8] c"Where: file Memory file from Commander TM\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @STDERR_FILENO
%3 = tail call i32 (i32, i8*, ...) @dprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @STDERR_FILENO
%5 = tail call i32 (i32, i8*, ...) @dprintf(i32 %4, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double Dot3D(int tbl[], double x, double y, double z) {
  return tbl[0] * x + tbl[1] * y + tbl[2] * z;
}


x86 assembly (clang, -O0):
<Dot3D>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm1
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x8(%rax),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dot3D>:
cvtsi2sdl (%rdi),%xmm3
cvtsi2sdl 0x4(%rdi),%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x8(%rdi),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Dot3D(i32* %0, double %1, double %2, double %3) {
%5 = alloca i32*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32* %0, i32** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to double
%13 = load double, double* %6
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to double
%18 = load double, double* %7
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %12, double %13, double %19)
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = sitofp i32 %23 to double
%25 = load double, double* %8
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double %20)
ret double %26
}

LLVM IR (-O2):
define double @Dot3D(i32* nocapture %0, double %1, double %2, double %3) {
%5 = load i32, i32* %0
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fmul double %9, %2
%11 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %10)
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to double
%15 = tail call double @llvm.fmuladd.f64(double %14, double %3, double %11)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
char *strchr(char *, char);
int main() {
  char *t = "MEAS:VALT:DC?";
  char *p;
  p = t;
  puts(p);
  while ((p = strchr(p, ':')) != NULL) {
    puts(++p);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x18(%rbp),%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     117d <main+0x5d>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x18(%rbp)
call   1030 <puts@plt>
jmp    114b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"MEAS:VALT:DC?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @puts(i8* %5)
br label %7
7: ; preds = %11, %0
%8 = load i8*, i8** %3
%9 = call i8* @strchr(i8* %8, i8 signext 58)
store i8* %9, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
%14 = call i32 @puts(i8* %13)
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"MEAS:VALT:DC?\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i8* [ %6, %2 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 4), %0 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = tail call i32 @puts(i8* %4)
%6 = tail call i8* @strchr(i8* dereferenceable(1) %4, i8 signext 58)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 0
}
/* Variables and functions */
void fill(unsigned char *addr, size_t amount) {
  unsigned long i;
  for (i = 0; i < amount; i++) {
    *(addr + i) = 42;
  }
}


x86 assembly (clang, -O0):
<fill>:
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 <fill+0x3f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x2a,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <fill+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
test   %rsi,%rsi
je     1127 <fill+0x17>
push   %rax
mov    %rsi,%rdx
mov    $0x2a,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @fill(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 42, 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
ret void
}

LLVM IR (-O2):
define void @fill(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
ret void
}
long long finddiv(long long x, long long div) {
  long long z = 0;
  while (x && x % div == 0) {
    z++;
    x /= div;
  }
  return z;
}


x86 assembly (clang, -O0):
<finddiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
je     1138 <finddiv+0x38>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
cmp    $0x0,%rdx
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1148 <finddiv+0x48>
jmp    116a <finddiv+0x6a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1114 <finddiv+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<finddiv>:
test   %rdi,%rdi
je     1146 <finddiv+0x46>
mov    %rdi,%rax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1130 <finddiv+0x30>
cqto
idiv   %rsi
test   %rdx,%rdx
je     1139 <finddiv+0x39>
jmp    1142 <finddiv+0x42>
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    1142 <finddiv+0x42>
add    $0x1,%rcx
test   %rax,%rax
jne    1110 <finddiv+0x10>
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @finddiv(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %10
%5 = phi i64 [ %11, %10 ], [ 0, %2 ]
%6 = phi i64 [ %8, %10 ], [ %0, %2 ]
%7 = srem i64 %6, %1
%8 = sdiv i64 %6, %1
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = add nuw nsw i64 %5, 1
%12 = icmp eq i64 %8, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %10, %2
%14 = phi i64 [ 0, %2 ], [ %11, %10 ], [ %5, %4 ]
ret i64 %14
}
int characterValueOf(int op) { return ((op - (515 << 2)) >> 2) / (10 + 1); }


x86 assembly (clang, -O0):
<characterValueOf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80c,%eax
sar    $0x2,%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<characterValueOf>:
add    $0xfffff7f4,%edi
sar    $0x2,%edi
movslq %edi,%rax
imul   $0x2e8ba2e9,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @characterValueOf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 2060
%5 = ashr i32 %4, 2
%6 = sdiv i32 %5, 11
ret i32 %6
}

LLVM IR (-O2):
define i32 @characterValueOf(i32 %0) {
%2 = add nsw i32 %0, -2060
%3 = ashr i32 %2, 2
%4 = sdiv i32 %3, 11
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SPI_SD_EnableRxInt();
int /*<<< orphan*/ SPI_SD_EnableTxInt();
void SPI_SD_EnableInt(void) {
  SPI_SD_EnableRxInt();
  SPI_SD_EnableTxInt();
}


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

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

LLVM IR (-O0):
define void @SPI_SD_EnableInt() {
%1 = call i32 (...) @SPI_SD_EnableRxInt()
%2 = call i32 (...) @SPI_SD_EnableTxInt()
ret void
}

LLVM IR (-O2):
define void @SPI_SD_EnableInt() {
%1 = tail call i32 (...) @SPI_SD_EnableRxInt()
%2 = tail call i32 (...) @SPI_SD_EnableTxInt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR9E_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_WMR9E_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 <U_WMRNOTIMPLEMENTED_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMR9E_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR9E_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
void *memdup(void const *, size_t);
scalar_t__ size_multiply_overflow(size_t, size_t);
__attribute__((alloc_size(2, 3))) void *
memdup_multiply(const void *p, size_t size, size_t need) {
  if (size_multiply_overflow(size, need))
    return NULL;
  return memdup(p, size * need);
}


x86 assembly (clang, -O0):
<memdup_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <size_multiply_overflow@plt>
cmp    $0x0,%rax
je     1158 <memdup_multiply+0x38>
movq   $0x0,-0x8(%rbp)
jmp    116e <memdup_multiply+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1040 <memdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup_multiply>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <size_multiply_overflow@plt>
test   %rax,%rax
je     1146 <memdup_multiply+0x26>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
imul   %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memdup@plt>

LLVM IR (-O0):
define i8* @memdup_multiply(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %6
%9 = load i64, i64* %7
%10 = call i64 @size_multiply_overflow(i64 %8, i64 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i8* null, i8** %4
br label %19
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = mul i64 %15, %16
%18 = call i8* @memdup(i8* %14, i64 %17)
store i8* %18, i8** %4
br label %19
19: ; preds = %13, %12
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @memdup_multiply(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @size_multiply_overflow(i64 %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = mul i64 %2, %1
%8 = tail call i8* @memdup(i8* %0, i64 %7)
br label %9
9: ; preds = %3, %6
%10 = phi i8* [ %8, %6 ], [ null, %3 ]
ret i8* %10
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
size_t wcslen(const wchar_t *wstr) {
  size_t cnt;
  for (cnt = 0; *wstr != L'\0'; ++cnt, ++wstr)
    ;
  return cnt;
}


x86 assembly (clang, -O0):
<wcslen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     113f <wcslen+0x3f>
jmp    1122 <wcslen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <wcslen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcslen>:
cmpl   $0x0,(%rdi)
je     111f <wcslen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpl   $0x0,0x4(%rdi,%rcx,4)
mov    %rax,%rcx
jne    1110 <wcslen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @wcslen(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i32* [ %8, %4 ], [ %0, %1 ]
%7 = add i64 %5, 1
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %7, %4 ]
ret i64 %12
}
__attribute__((always_)) void
__debug_show_held_locks(struct task_struct *task) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @__debug_show_held_locks(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
short find_pos(short *);
void move_down(short *puzzle) {
  short temp, pos = find_pos(puzzle);
  temp = puzzle[pos];
  puzzle[pos] = puzzle[pos + 4];
  puzzle[pos + 4] = temp;
}


x86 assembly (clang, -O0):
<move_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_pos@plt>
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movswq -0xc(%rbp),%rcx
mov    (%rax,%rcx,2),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movswl -0xc(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x8(%rbp),%rax
movswq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0xa(%rbp),%dx
mov    -0x8(%rbp),%rax
movswl -0xc(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_down>:
push   %rbx
mov    %rdi,%rbx
call   1030 <find_pos@plt>
movswq %ax,%rax
movzwl (%rbx,%rax,2),%ecx
movzwl 0x8(%rbx,%rax,2),%edx
mov    %dx,(%rbx,%rax,2)
mov    %cx,0x8(%rbx,%rax,2)
pop    %rbx
ret

LLVM IR (-O0):
define void @move_down(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = call signext i16 @find_pos(i16* %5)
store i16 %6, i16* %4
%7 = load i16*, i16** %2
%8 = load i16, i16* %4
%9 = sext i16 %8 to i64
%10 = getelementptr inbounds i16, i16* %7, i64 %9
%11 = load i16, i16* %10
store i16 %11, i16* %3
%12 = load i16*, i16** %2
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
%15 = add nsw i32 %14, 4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i16, i16* %12, i64 %16
%18 = load i16, i16* %17
%19 = load i16*, i16** %2
%20 = load i16, i16* %4
%21 = sext i16 %20 to i64
%22 = getelementptr inbounds i16, i16* %19, i64 %21
store i16 %18, i16* %22
%23 = load i16, i16* %3
%24 = load i16*, i16** %2
%25 = load i16, i16* %4
%26 = sext i16 %25 to i32
%27 = add nsw i32 %26, 4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i16, i16* %24, i64 %28
store i16 %23, i16* %29
ret void
}

LLVM IR (-O2):
define void @move_down(i16* %0) {
%2 = tail call signext i16 @find_pos(i16* %0)
%3 = sext i16 %2 to i64
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load i16, i16* %4
%6 = add nsw i64 %3, 4
%7 = getelementptr inbounds i16, i16* %0, i64 %6
%8 = load i16, i16* %7
store i16 %8, i16* %4
store i16 %5, i16* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_peristent_group_invoke_usage(void) {
  printf(
      "\nUsage : wifidirect_cfg_persistent_group_invoke [index] | <cancel>\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [68 x i8] c"\0AUsage : wifidirect_cfg_persistent_group_invoke [index] | <cancel>\0A\00"
define void @print_wifidirect_peristent_group_invoke_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [67 x i8] c"\0AUsage : wifidirect_cfg_persistent_group_invoke [index] | <cancel>\00"
define void @print_wifidirect_peristent_group_invoke_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
ret void
}
int do_131() { return 131; }


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

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

LLVM IR (-O0):
define i32 @do_131() {
ret i32 131
}

LLVM IR (-O2):
define i32 @do_131() {
ret i32 131
}
unsigned char valInArray(unsigned char r, unsigned char c) {
  unsigned char val = 0;
  val = (unsigned char)((r * 16) + c);
  return val;
}


x86 assembly (clang, -O0):
<valInArray>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x4,%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valInArray>:
shl    $0x4,%dil
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define zeroext i8 @valInArray(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
store i8 0, i8* %5
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = mul nsw i32 %7, 16
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = add nsw i32 %8, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %5
%13 = load i8, i8* %5
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @valInArray(i8 zeroext %0, i8 zeroext %1) {
%3 = shl i8 %0, 4
%4 = add i8 %3, %1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ probme();
int /*<<< orphan*/ prtusage();
int main(int argc, char *argv[]) {
  if (argc != 1) {
    prtusage();
    exit(EXIT_FAILURE);
  }
  probme();
  return 0;
}


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)
cmpl   $0x1,-0x8(%rbp)
je     1165 <main+0x35>
mov    $0x0,%al
call   1040 <prtusage@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1030 <probme@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
cmp    $0x1,%edi
jne    1141 <main+0x11>
call   1030 <probme@plt>
xor    %eax,%eax
pop    %rcx
ret
call   1040 <prtusage@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
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 = icmp ne i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = call i32 (...) @prtusage()
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
%13 = call i32 (...) @probme()
ret i32 0
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (...) @prtusage()
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
%9 = tail call i32 (...) @probme()
ret i32 0
}
/* Type definitions */
struct vsf_session {
  int dummy;
};

/* Variables and functions */
int vsf_privop_get_ftp_port_sock(struct vsf_session *);
int vsf_one_process_get_priv_data_sock(struct vsf_session *p_sess) {
  return vsf_privop_get_ftp_port_sock(p_sess);
}


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

x86 assembly (clang, -O2):
<vsf_one_process_get_priv_data_sock>:
jmp    1030 <vsf_privop_get_ftp_port_sock@plt>

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

LLVM IR (-O2):
%struct.vsf_session = type { i32 }
define i32 @vsf_one_process_get_priv_data_sock(%struct.vsf_session* %0) {
%2 = tail call i32 @vsf_privop_get_ftp_port_sock(%struct.vsf_session* %0)
ret i32 %2
}
unsigned int m_min_uint(unsigned int left, unsigned int right) {
  return (left < right) ? left : right;
}


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

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

LLVM IR (-O0):
define i32 @m_min_uint(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 ult 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 @m_min_uint(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void sapi_unix_tcp_server_destroy(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<sapi_unix_tcp_server_destroy>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @sapi_unix_tcp_server_destroy(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
void reverse(char *dst, char *src) {
  dst += strlen(src);
  *dst = 0;
  while (*src)
    *(--dst) = *(src++);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <reverse+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
jmp    1140 <reverse+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
movslq %eax,%rcx
movb   $0x0,(%r14,%rcx,1)
mov    (%rbx),%al
test   %al,%al
je     1151 <reverse+0x41>
add    $0x1,%rbx
add    %r14,%rcx
add    $0xffffffffffffffff,%rcx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rcx)
movzbl (%rbx),%eax
add    $0x1,%rbx
add    $0xffffffffffffffff,%rcx
test   %al,%al
jne    1140 <reverse+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @reverse(i8* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %2, %8
%9 = phi i8 [ %14, %8 ], [ %6, %2 ]
%10 = phi i8* [ %12, %8 ], [ %1, %2 ]
%11 = phi i8* [ %13, %8 ], [ %5, %2 ]
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = getelementptr inbounds i8, i8* %11, i64 -1
store i8 %9, i8* %13
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("Usage: rectangle [ap] -l num -b num\n"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: rectangle [ap] -l num -b num\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Usage: rectangle [ap] -l num -b num\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_command(unsigned int *, int, int);
int /*<<< orphan*/ ipfw_init(int, char **, unsigned int, char const *,
                             unsigned int);
scalar_t__ optind;
int ipfw_delete(int args, char **arglist, const char *chain,
                unsigned int rulenum) {
  unsigned int command = 0;
  add_command(&command, 0x0002U, 0x0000U);
  command = 0x0004U;
  ipfw_init(args, arglist, command, chain, rulenum);
  optind = 0;
  return (0);
}


x86 assembly (clang, -O0):
<ipfw_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
movl   $0x4,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <ipfw_init@plt>
mov    0x2e76(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipfw_delete>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %edi,%ebx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
movl   $0x4,0x4(%rsp)
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x4,%edx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e79(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@optind = global i64 0
define i32 @ipfw_delete(i32 %0, i8** %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%7 = call i32 @add_command(i32* %5, i32 2, i32 0)
store i32 4, i32* %5
%8 = call i32 @ipfw_init(i32 %0, i8** %1, i32 4, i8* %2, i32 %3)
store i64 0, i64* @optind
ret i32 0
}
void av_timecode_get_smpte_from_framenum() {}


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

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

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

LLVM IR (-O2):
define void @av_timecode_get_smpte_from_framenum() {
ret void
}
void av_opt_get_sample_fmt() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_get_sample_fmt() {
ret void
}
IR0AR1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (*p0) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<IR0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x43d11(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AR1>:
mov    0x43d11(%r9),%al
mov    %al,(%r8)
ret

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

LLVM IR (-O2):
define i32 @IR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4, i8* nocapture %5) {
%7 = getelementptr inbounds i8, i8* %5, i64 277777
%8 = load i8, i8* %7
store i8 %8, i8* %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ func_3(char *, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("backtrace TEST\n");
  func_3("backtrace test", 345);
  return 0;
}


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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x159,%esi
call   1040 <func_3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x159,%esi
call   1040 <func_3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"backtrace TEST\0A\00"
@.str.1 = [15 x i8] c"backtrace test\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 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @func_3(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 345)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"backtrace test\00"
@str = [15 x i8] c"backtrace TEST\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @func_3(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 345)
ret i32 0
}
void av_frame_set_metadata() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_set_metadata() {
ret void
}
/* Variables and functions */
int write_block(int, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/);
int motor_fwd(void) { return write_block(105, 0, 0, 0); }


x86 assembly (clang, -O0):
<motor_fwd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x69,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <write_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<motor_fwd>:
mov    $0x69,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @motor_fwd() {
%1 = call i32 @write_block(i32 105, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @motor_fwd() {
%1 = tail call i32 @write_block(i32 105, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
main() {
  int desconto;
  float d;
  desconto = 140 * 0.05;
  d = 140 - desconto;
  printf("\n Discount value: %d \n", desconto);
  printf("\n Final value: %f", d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x4(%rbp)
mov    $0x8c,%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0A Discount value: %d \0A\00"
@.str.1 = [18 x i8] c"\0A Final value: %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 7, i32* %1
%3 = load i32, i32* %1
%4 = sub nsw i32 140, %3
%5 = sitofp i32 %4 to float
store float %5, float* %2
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %7)
%9 = load float, float* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0A Discount value: %d \0A\00"
@.str.1 = [18 x i8] c"\0A Final value: %f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 7.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float 1.330000e+02)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func(int a) { printf("Value of a is %d;\n", a); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Value of a is %d;\0A\00"
define void @func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Value of a is %d;\0A\00"
define void @func(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f0(unsigned char *);
void g0(unsigned char *x) { f0(x); }


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

x86 assembly (clang, -O2):
<g0>:
jmp    1030 <f0@plt>

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

LLVM IR (-O2):
define void @g0(i8* %0) {
%2 = tail call i32 @f0(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handleResponses();
int /*<<< orphan*/ listNodes();
void listNodesMenu() {
  listNodes();
  handleResponses();
}


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

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

LLVM IR (-O0):
define void @listNodesMenu() {
%1 = call i32 (...) @listNodes()
%2 = call i32 (...) @handleResponses()
ret void
}

LLVM IR (-O2):
define void @listNodesMenu() {
%1 = tail call i32 (...) @listNodes()
%2 = tail call i32 (...) @handleResponses()
ret void
}
int check_int(int i) { return i > 0; }


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

x86 assembly (clang, -O2):
<check_int>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

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

LLVM IR (-O2):
define i32 @check_int(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}