xunge/DecIR huggingface dataset:
/* Variables and functions */
int fork();
int /*<<< orphan*/ printf(char *);
int main() {
  int pid;
  if ((pid = fork()) < 0) {
    printf("error\n");
  } else if (pid == 0) {
  } else {
    while (1) {
      pid++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1153 <main+0x33>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x5d>
cmpl   $0x0,-0x8(%rbp)
jne    1162 <main+0x42>
jmp    1178 <main+0x58>
jmp    1167 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1167 <main+0x47>
jmp    117d <main+0x5d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
js     1132 <main+0x12>
je     113e <main+0x1e>
xchg   %ax,%ax
jmp    1130 <main+0x10>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"error\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = icmp eq i32 %1, 0
br i1 %6, label %8, label %7
7: ; preds = %5, %7
br label %7
8: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
int msuspend(long);
extern int suspend(long seconds) {
  if (seconds <= 0L) {
    return (-1);
  }
  return msuspend(seconds * 1000L);
}


x86 assembly (clang, -O0):
<suspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1133 <suspend+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <suspend+0x33>
imul   $0x3e8,-0x10(%rbp),%rdi
call   1030 <msuspend@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suspend>:
test   %rdi,%rdi
jle    1121 <suspend+0x11>
imul   $0x3e8,%rdi,%rdi
jmp    1030 <msuspend@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @suspend(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sle i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %11
7: ; preds = %1
%8 = load i64, i64* %3
%9 = mul nsw i64 %8, 1000
%10 = call i32 @msuspend(i64 %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @suspend(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = mul nsw i64 %0, 1000
%5 = tail call i32 @msuspend(i64 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ -1, %1 ]
ret i32 %7
}
void RTManifestReadStandard(void) {}


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

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

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

LLVM IR (-O2):
define void @RTManifestReadStandard() {
ret void
}
/* Variables and functions */
unsigned int x(unsigned int);
unsigned int i(unsigned int a, unsigned int b) { return x(a) ^ b; }


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

x86 assembly (clang, -O2):
<i>:
push   %rbx
mov    %esi,%ebx
call   1030 <x@plt>
xor    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @i(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 = call i32 @x(i32 %5)
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @i(i32 %0, i32 %1) {
%3 = tail call i32 @x(i32 %0)
%4 = xor i32 %3, %1
ret i32 %4
}
int os_sleep(unsigned int seconds, unsigned int *rc) { return -1; }


x86 assembly (clang, -O0):
<os_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @os_sleep(i32 %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int glXSwapIntervalMESA(int);
int glXSwapIntervalSGI(int interval) { return glXSwapIntervalMESA(interval); }


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

x86 assembly (clang, -O2):
<glXSwapIntervalSGI>:
jmp    1030 <glXSwapIntervalMESA@plt>

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

LLVM IR (-O2):
define i32 @glXSwapIntervalSGI(i32 %0) {
%2 = tail call i32 @glXSwapIntervalMESA(i32 %0)
ret i32 %2
}
/* Variables and functions */
float cblas_snrm2(int const, float const *, int const);
void acc_snrm2_(const int *N, const float *X, const int *incX, float *result) {
  *result = cblas_snrm2(*N, X, *incX);
}


x86 assembly (clang, -O0):
<acc_snrm2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <cblas_snrm2@plt>
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acc_snrm2_>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
call   1030 <cblas_snrm2@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @acc_snrm2_(i32* nocapture %0, float* %1, i32* nocapture %2, float* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call float @cblas_snrm2(i32 %5, float* %1, i32 %6)
store float %7, float* %3
ret void
}
/* Variables and functions */
int zero_or_ten(int);
void l3_concrete_no_underrun_Good_FP() {
  int a[10];
  a[zero_or_ten(1) - 1] = 0;
}


x86 assembly (clang, -O0):
<l3_concrete_no_underrun_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x1,%edi
call   1030 <zero_or_ten@plt>
sub    $0x1,%eax
cltq
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l3_concrete_no_underrun_Good_FP>:
mov    $0x1,%edi
jmp    1030 <zero_or_ten@plt>

LLVM IR (-O0):
define void @l3_concrete_no_underrun_Good_FP() {
%1 = alloca [10 x i32]
%2 = call i32 @zero_or_ten(i32 1)
%3 = sub nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %4
store i32 0, i32* %5
ret void
}

LLVM IR (-O2):
define void @l3_concrete_no_underrun_Good_FP() {
%1 = tail call i32 @zero_or_ten(i32 1)
ret void
}
void g_object_set_valist() {}


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

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

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

LLVM IR (-O2):
define void @g_object_set_valist() {
ret void
}
/* Variables and functions */
int ans(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  printf("\nEnter two numbers: ");
  scanf("%d %d", &a, &b);
  printf("\nGCD: %d", ans(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <ans@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AEnter two numbers: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [9 x i8] c"\0AGCD: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @ans(i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0AEnter two numbers: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [9 x i8] c"\0AGCD: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @ans(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int);
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int i2c_setup(const char *bus) {
  assert(NULL != bus);
  int fd;
  if ((fd = open(bus, O_RDWR)) < 0) {
    perror("Failed to open I2C bus; Try specifying the bus with -b\n");
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<i2c_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1193 <i2c_setup+0x53>
lea    0xe7c(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_setup>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <open@plt>
test   %eax,%eax
js     1169 <i2c_setup+0x29>
pop    %rbx
ret
lea    0xe90(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [56 x i8] c"Failed to open I2C bus; Try specifying the bus with -b\0A\00"
define i32 @i2c_setup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* null, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %2
%9 = load i32, i32* @O_RDWR
%10 = call i32 @open(i8* %8, i32 %9)
store i32 %10, i32* %3
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = call i32 @perror(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@.str = [56 x i8] c"Failed to open I2C bus; Try specifying the bus with -b\0A\00"
define i32 @i2c_setup(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @O_RDWR
%6 = tail call i32 @open(i8* %0, i32 %5)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = tail call i32 @perror(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret i32 %6
}
/* Variables and functions */
char *nvram_get(char *);
scalar_t__ strcmp(char const *, char *);
int nvram_invmatch(char *name, char *invmatch) {
  const char *value = nvram_get(name);
  return (value && strcmp(value, invmatch));
}


x86 assembly (clang, -O0):
<nvram_invmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nvram_get@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1164 <nvram_invmatch+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_invmatch>:
push   %rbx
mov    %rsi,%rbx
call   1040 <nvram_get@plt>
test   %rax,%rax
je     1146 <nvram_invmatch+0x26>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nvram_invmatch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @nvram_get(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %10, %2
%16 = phi i1 [ false, %2 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @nvram_invmatch(i8* %0, i8* %1) {
%3 = tail call i8* @nvram_get(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %3, i8* %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ eat_blanks();
int /*<<< orphan*/ printf(char *, ...);
char *return_next_tok();
void do_thread(void) {
  char *function_name = return_next_tok();
  printf("\tpush _rexcall_%s\n", function_name);
  printf("\tsyscall SYSCALL_DISPATCH\n");
  printf("\tpop\n");
  eat_blanks();
}


x86 assembly (clang, -O0):
<do_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <return_next_tok@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <eat_blanks@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_thread>:
push   %rax
xor    %eax,%eax
call   1060 <return_next_tok@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <eat_blanks@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\09push _rexcall_%s\0A\00"
@.str.1 = [27 x i8] c"\09syscall SYSCALL_DISPATCH\0A\00"
@.str.2 = [6 x i8] c"\09pop\0A\00"
define void @do_thread() {
%1 = alloca i8*
%2 = call i8* (...) @return_next_tok()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @eat_blanks()
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\09push _rexcall_%s\0A\00"
@str = [26 x i8] c"\09syscall SYSCALL_DISPATCH\00"
@str.3 = [5 x i8] c"\09pop\00"
define void @do_thread() {
%1 = tail call i8* (...) @return_next_tok()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 (...) @eat_blanks()
ret void
}
void unsigned_char_mul_signed_char_signed_int(unsigned char *LHS,
                                              signed int RHS) {
  (*LHS) *= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_mul_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
imul   %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_mul_signed_char_signed_int>:
mov    (%rdi),%al
mul    %sil
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @unsigned_char_mul_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = mul i8 %3, %4
store i8 %5, i8* %0
ret void
}
void usb_init_device(void) {}


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

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

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

LLVM IR (-O2):
define void @usb_init_device() {
ret void
}
/* Variables and functions */
int sprintf(char *, char *, char const *);
int print_s(char *buf, const char *val) {
  return sprintf(buf,
                 "%"
                 "s",
                 val);
}


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

x86 assembly (clang, -O2):
<print_s>:
push   %rbx
mov    %rdi,%rbx
call   1030 <stpcpy@plt>
sub    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @print_s(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @stpcpy(i8* %0, i8* %1)
%4 = ptrtoint i8* %3 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void help(char *addr) {
  printf("Chatter V.0.1 BETA\n");
  printf("============================\n");
  printf("USAGE: %s <port> <user name>\n", addr);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Chatter V.0.1 BETA\0A\00"
@.str.1 = [30 x i8] c"============================\0A\00"
@.str.2 = [30 x i8] c"USAGE: %s <port> <user name>\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str.2 = [30 x i8] c"USAGE: %s <port> <user name>\0A\00"
@str = [19 x i8] c"Chatter V.0.1 BETA\00"
@str.3 = [29 x i8] c"============================\00"
define void @help(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ random_rand();
float random_float_unit_uniform(void) {
  return ((((float)random_rand()) / (float)(unsigned int)0xFFFFFFFF));
}


x86 assembly (clang, -O0):
<random_float_unit_uniform>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random_rand@plt>
cvtsi2ss %rax,%xmm0
movss  0xed8(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_float_unit_uniform>:
push   %rax
xor    %eax,%eax
call   1030 <random_rand@plt>
cvtsi2ss %rax,%xmm0
mulss  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @random_float_unit_uniform() {
%1 = call i64 (...) @random_rand()
%2 = sitofp i64 %1 to float
%3 = fdiv float %2, 0x41F0000000000000
ret float %3
}

LLVM IR (-O2):
define float @random_float_unit_uniform() {
%1 = tail call i64 (...) @random_rand()
%2 = sitofp i64 %1 to float
%3 = fmul float %2, 0x3DF0000000000000
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t mosquitto_time(void) { return time(NULL); }


x86 assembly (clang, -O0):
<mosquitto_time>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mosquitto_time>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i32 @mosquitto_time() {
%1 = call i32 @time(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mosquitto_time() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ CONSOLE_ClearAll();
int /*<<< orphan*/ LCD_Init();
void CONSOLE_Init() {
  CONSOLE_ClearAll();
  LCD_Init();
}


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

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

LLVM IR (-O0):
define void @CONSOLE_Init() {
%1 = call i32 (...) @CONSOLE_ClearAll()
%2 = call i32 (...) @LCD_Init()
ret void
}

LLVM IR (-O2):
define void @CONSOLE_Init() {
%1 = tail call i32 (...) @CONSOLE_ClearAll()
%2 = tail call i32 (...) @LCD_Init()
ret void
}
void IRC_OnChannelDeVoice(const struct instance_data *pID,
                          const struct userinfo *pUI, const char *szChannel,
                          const char *szTargetNick) {}


x86 assembly (clang, -O0):
<IRC_OnChannelDeVoice>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.instance_data = type opaque
%struct.userinfo = type opaque
define void @IRC_OnChannelDeVoice(%struct.instance_data* %0, %struct.userinfo* %1, i8* %2, i8* %3) {
%5 = alloca %struct.instance_data*
%6 = alloca %struct.userinfo*
%7 = alloca i8*
%8 = alloca i8*
store %struct.instance_data* %0, %struct.instance_data** %5
store %struct.userinfo* %1, %struct.userinfo** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
%struct.instance_data = type opaque
%struct.userinfo = type opaque
define void @IRC_OnChannelDeVoice(%struct.instance_data* nocapture %0, %struct.userinfo* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail(char const *, char const *, unsigned int,
                                 int /*<<< orphan*/ *);
void __aeabi_assert(const char *assertion, const char *file,
                    unsigned int line) {
  __assert_fail(assertion, file, line, NULL);
}


x86 assembly (clang, -O0):
<__aeabi_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <__assert_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_assert>:
xor    %ecx,%ecx
jmp    1030 <__assert_fail@plt>

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

LLVM IR (-O2):
define void @__aeabi_assert(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @__assert_fail(i8* %0, i8* %1, i32 %2, i32* null)
ret void
}
void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define void @rt2x00lib_free_firmware(%struct.rt2x00_dev* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void AESIVSet(uint32_t ui32Base, uint32_t *pui32IVdata) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000040))) = pui32IVdata[0];
  (*((volatile uint32_t *)(ui32Base + 0x00000044))) = pui32IVdata[1];
  (*((volatile uint32_t *)(ui32Base + 0x00000048))) = pui32IVdata[2];
  (*((volatile uint32_t *)(ui32Base + 0x0000004C))) = pui32IVdata[3];
}


x86 assembly (clang, -O0):
<AESIVSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x40(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x44(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x48(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x4c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESIVSet>:
mov    (%rsi),%rax
mov    %rax,0x40(%rdi)
mov    0x8(%rsi),%rax
mov    %rax,0x44(%rdi)
mov    0x10(%rsi),%rax
mov    %rax,0x48(%rdi)
mov    0x18(%rsi),%rax
mov    %rax,0x4c(%rdi)
ret

LLVM IR (-O0):
define void @AESIVSet(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 64
%10 = inttoptr i64 %9 to i64*
store volatile i64 %7, i64* %10
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
%14 = load i64, i64* %3
%15 = add nsw i64 %14, 68
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
%17 = load i64*, i64** %4
%18 = getelementptr inbounds i64, i64* %17, i64 2
%19 = load i64, i64* %18
%20 = load i64, i64* %3
%21 = add nsw i64 %20, 72
%22 = inttoptr i64 %21 to i64*
store volatile i64 %19, i64* %22
%23 = load i64*, i64** %4
%24 = getelementptr inbounds i64, i64* %23, i64 3
%25 = load i64, i64* %24
%26 = load i64, i64* %3
%27 = add nsw i64 %26, 76
%28 = inttoptr i64 %27 to i64*
store volatile i64 %25, i64* %28
ret void
}

LLVM IR (-O2):
define void @AESIVSet(i64 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = add nsw i64 %0, 64
%5 = inttoptr i64 %4 to i64*
store volatile i64 %3, i64* %5
%6 = getelementptr inbounds i64, i64* %1, i64 1
%7 = load i64, i64* %6
%8 = add nsw i64 %0, 68
%9 = inttoptr i64 %8 to i64*
store volatile i64 %7, i64* %9
%10 = getelementptr inbounds i64, i64* %1, i64 2
%11 = load i64, i64* %10
%12 = add nsw i64 %0, 72
%13 = inttoptr i64 %12 to i64*
store volatile i64 %11, i64* %13
%14 = getelementptr inbounds i64, i64* %1, i64 3
%15 = load i64, i64* %14
%16 = add nsw i64 %0, 76
%17 = inttoptr i64 %16 to i64*
store volatile i64 %15, i64* %17
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ line;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int length(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char line[100];
  while (1) {
    printf("Enter line:");
    fgets(line, sizeof(line), stdin);
    printf("Length (including newline) is: %d\n", length(line));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1050 <fgets@plt>
lea    -0x70(%rbp),%rdi
call   1030 <length@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xebe(%rip),%r14
mov    0x2e9f(%rip),%r12
mov    %rsp,%rbx
lea    0xeb9(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <length@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [12 x i8] c"Enter line:\00"
@stdin = global i32 0
@.str.1 = [35 x i8] c"Length (including newline) is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 100, i32 %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @length(i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %3
}

LLVM IR (-O2):
@.str = [12 x i8] c"Enter line:\00"
@stdin = global i32 0
@.str.1 = [35 x i8] c"Length (including newline) is: %d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %2, i32 100, i32 %5)
%7 = call i32 @length(i8* %2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ TerminalWrite(int /*<<< orphan*/);
void ConsoleWrite(char *str) {
  while (*str) {
    { TerminalWrite(*str++); };
  }
}


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

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

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

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


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

x86 assembly (clang, -O2):
<test_mm_clflushopt>:
jmp    1030 <_mm_clflushopt@plt>

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

LLVM IR (-O2):
define void @test_mm_clflushopt(i8* %0) {
%2 = tail call i32 @_mm_clflushopt(i8* %0)
ret void
}
__attribute__((no, noclone)) int fn2(char x, long int y) {
  short int res;
  int ovf = __builtin_mul_overflow(x, y, &res);
  int res2 = res;
  int res3 = res2 - 2;
  (void)ovf;
  return res;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
movsbq %cl,%rdx
imul   %rax,%rdx
seto   %al
mov    %dx,%cx
movswq %cx,%rsi
cmp    %rsi,%rdx
setne  %dl
or     %dl,%al
mov    %cx,-0x12(%rbp)
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
movswl -0x12(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x20(%rbp)
movswl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
imul   %edi,%esi
movswl %si,%eax
ret

LLVM IR (-O0):
define i32 @fn2(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
%5 = alloca i16
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i64 %1, i64* %4
%9 = load i8, i8* %3
%10 = load i64, i64* %4
%11 = sext i8 %9 to i64
%12 = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 %11, i64 %10)
%13 = extractvalue { i64, i1 } %12, 1
%14 = extractvalue { i64, i1 } %12, 0
%15 = trunc i64 %14 to i16
%16 = sext i16 %15 to i64
%17 = icmp ne i64 %14, %16
%18 = or i1 %13, %17
store i16 %15, i16* %5
%19 = zext i1 %18 to i32
store i32 %19, i32* %6
%20 = load i16, i16* %5
%21 = sext i16 %20 to i32
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = sub nsw i32 %22, 2
store i32 %23, i32* %8
%24 = load i32, i32* %6
%25 = load i16, i16* %5
%26 = sext i16 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @fn2(i8 signext %0, i64 %1) {
%3 = sext i8 %0 to i64
%4 = mul i64 %3, %1
%5 = trunc i64 %4 to i32
%6 = shl i32 %5, 16
%7 = ashr exact i32 %6, 16
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ wNotYet(char *);
char *wPopString();
int /*<<< orphan*/ wPushStringCopy(char *);
void wBasReplaceSubStr() {
  char *source, *replace, *with;
  with = wPopString();
  replace = wPopString();
  source = wPopString();
  wNotYet("ReplaceSubStr");
  free(with);
  free(replace);
  free(source);
  wPushStringCopy("");
}


x86 assembly (clang, -O0):
<wBasReplaceSubStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x8(%rbp)
lea    0xe90(%rip),%rdi
call   1060 <wNotYet@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    0xe76(%rip),%rdi
call   1050 <wPushStringCopy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasReplaceSubStr>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%rbx
lea    0xe96(%rip),%rdi
call   1060 <wNotYet@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe7f(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <wPushStringCopy@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"ReplaceSubStr\00"
@.str.1 = [1 x i8] zeroinitializer
define void @wBasReplaceSubStr() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = call i8* (...) @wPopString()
store i8* %4, i8** %3
%5 = call i8* (...) @wPopString()
store i8* %5, i8** %2
%6 = call i8* (...) @wPopString()
store i8* %6, i8** %1
%7 = call i32 @wNotYet(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
%12 = load i8*, i8** %1
%13 = call i32 @free(i8* %12)
%14 = call i32 @wPushStringCopy(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"ReplaceSubStr\00"
@.str.1 = [1 x i8] zeroinitializer
define void @wBasReplaceSubStr() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i8* (...) @wPopString()
%3 = tail call i8* (...) @wPopString()
%4 = tail call i32 @wNotYet(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @free(i8* %1)
%6 = tail call i32 @free(i8* %2)
%7 = tail call i32 @free(i8* %3)
%8 = tail call i32 @wPushStringCopy(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eembed_stdout();
int /*<<< orphan*/ eembed_stream_eol(int /*<<< orphan*/);
void eembed_stdout_println(void) { eembed_stream_eol(eembed_stdout()); }


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

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

LLVM IR (-O0):
define void @eembed_stdout_println() {
%1 = call i32 (...) @eembed_stdout()
%2 = call i32 @eembed_stream_eol(i32 %1)
ret void
}

LLVM IR (-O2):
define void @eembed_stdout_println() {
%1 = tail call i32 (...) @eembed_stdout()
%2 = tail call i32 @eembed_stream_eol(i32 %1)
ret void
}
/* Variables and functions */
int f342(int *);
int f343(int *p) { return f342(p); }


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

x86 assembly (clang, -O2):
<f343>:
jmp    1030 <f342@plt>

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

LLVM IR (-O2):
define i32 @f343(i32* %0) {
%2 = tail call i32 @f342(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *);
void *malloc(size_t);
void *emalloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p)
    eprintf("malloc: out of memory\n");
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <emalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <eprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <emalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <eprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"malloc: out of memory\0A\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @eprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void too_bad(void) {
  puts("SeeSaw Software extends its heartfelt condolences");
  puts("to you apon the failure of your program.");
}


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

x86 assembly (clang, -O2):
<too_bad>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"SeeSaw Software extends its heartfelt condolences\00"
@.str.1 = [41 x i8] c"to you apon the failure of your program.\00"
define void @too_bad() {
%1 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"SeeSaw Software extends its heartfelt condolences\00"
@.str.1 = [41 x i8] c"to you apon the failure of your program.\00"
define void @too_bad() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int uniquePaths(int, int);
int uniquePaths2(int, int);
int main() {
  int m = 10, n = 10;
  printf("m=%d, n=%d, res=%d\n", m, n, uniquePaths2(m, n));
  printf("m=%d, n=%d, res=%d\n", m, n, uniquePaths(m, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <uniquePaths2@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <uniquePaths@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
mov    $0xa,%esi
call   1050 <uniquePaths2@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0xa,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <uniquePaths@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0xa,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"m=%d, n=%d, res=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @uniquePaths2(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @uniquePaths(i32 %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"m=%d, n=%d, res=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @uniquePaths2(i32 10, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10, i32 10, i32 %1)
%3 = tail call i32 @uniquePaths(i32 10, i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10, i32 10, i32 %3)
ret i32 0
}
int comparator(const void *a, const void *b) {
  int f = *(int *)a;
  int s = *(int *)b;
  return f - s;
}


x86 assembly (clang, -O0):
<comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparator>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}