xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ istty();
char *rdz_gn() { return istty() ? "[0;32m" : ""; }


x86 assembly (clang, -O0):
<rdz_gn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <istty@plt>
mov    %rax,%rdx
lea    0xee2(%rip),%rax
lea    0xed4(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdz_gn>:
push   %rax
xor    %eax,%eax
call   1030 <istty@plt>
test   %rax,%rax
lea    0xee5(%rip),%rcx
lea    0xed7(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;32m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @rdz_gn() {
%1 = call i64 (...) @istty()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;32m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @rdz_gn() {
%1 = tail call i64 (...) @istty()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
long int __attribute__((const)) labs(long int n) { return (n > 0) ? n : -n; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <labs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
struct gdb_data {
  int dummy;
};

/* Variables and functions */
int gdb_flush_ack(struct gdb_data *);
int /*<<< orphan*/ gdb_packet_end(struct gdb_data *);
int /*<<< orphan*/ gdb_packet_start(struct gdb_data *);
int /*<<< orphan*/ gdb_printf(struct gdb_data *, char *, char const *);
int gdb_send(struct gdb_data *data, const char *msg) {
  gdb_packet_start(data);
  gdb_printf(data, "%s", msg);
  gdb_packet_end(data);
  return gdb_flush_ack(data);
}


x86 assembly (clang, -O0):
<gdb_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gdb_packet_start@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1050 <gdb_printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <gdb_packet_end@plt>
mov    -0x8(%rbp),%rdi
call   1040 <gdb_flush_ack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_send>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <gdb_packet_start@plt>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <gdb_printf@plt>
mov    %rbx,%rdi
call   1060 <gdb_packet_end@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <gdb_flush_ack@plt>

LLVM IR (-O0):
%struct.gdb_data = type { i32 }
@.str = [3 x i8] c"%s\00"
define i32 @gdb_send(%struct.gdb_data* %0, i8* %1) {
%3 = alloca %struct.gdb_data*
%4 = alloca i8*
store %struct.gdb_data* %0, %struct.gdb_data** %3
store i8* %1, i8** %4
%5 = load %struct.gdb_data*, %struct.gdb_data** %3
%6 = call i32 @gdb_packet_start(%struct.gdb_data* %5)
%7 = load %struct.gdb_data*, %struct.gdb_data** %3
%8 = load i8*, i8** %4
%9 = call i32 @gdb_printf(%struct.gdb_data* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load %struct.gdb_data*, %struct.gdb_data** %3
%11 = call i32 @gdb_packet_end(%struct.gdb_data* %10)
%12 = load %struct.gdb_data*, %struct.gdb_data** %3
%13 = call i32 @gdb_flush_ack(%struct.gdb_data* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.gdb_data = type { i32 }
@.str = [3 x i8] c"%s\00"
define i32 @gdb_send(%struct.gdb_data* %0, i8* %1) {
%3 = tail call i32 @gdb_packet_start(%struct.gdb_data* %0)
%4 = tail call i32 @gdb_printf(%struct.gdb_data* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @gdb_packet_end(%struct.gdb_data* %0)
%6 = tail call i32 @gdb_flush_ack(%struct.gdb_data* %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void testTortureExecute(void) {
  foo(1);
  return;
}


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

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

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @foo(i32 1)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @foo(i32 1)
ret void
}
void foo375(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo375(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal_error(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int yyparse();
int main(void) { return yyparse(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
void Check(int cond, const char *filename, int lineno, const char *expr) {
  if (!cond) {
    printf("condition failed at %s:%i: %s\n", filename, lineno, expr);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<Check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1161 <Check+0x41>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Check>:
test   %edi,%edi
je     1125 <Check+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"condition failed at %s:%i: %s\0A\00"
define void @Check(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %4
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i8* %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"condition failed at %s:%i: %s\0A\00"
define void @Check(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %4
ret void
}
void palm27x_power_init(int ac, int usb) {}


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

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

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

LLVM IR (-O2):
define void @palm27x_power_init(i32 %0, i32 %1) {
ret void
}
void unmap_physmem(void *vaddr, unsigned long flags) {}


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

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

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

LLVM IR (-O2):
define void @unmap_physmem(i8* nocapture %0, i64 %1) {
ret void
}
int main() {
  volatile int i = 1;
  while (i > 0) {
    i++;
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
jle    1135 <main+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x1,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jle    1121 <main+0x21>
nop
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jg     1110 <main+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = add nsw i32 %8, 1
store volatile i32 %9, i32* %1
%10 = load volatile i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
char *memchr(char const *, int /*<<< orphan*/, size_t);
size_t strnlen(const char *str, size_t maxlen) {
  char *p = memchr(str, 0, maxlen);
  if (p == NULL)
    return maxlen;
  else
    return (p - str);
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114b <strnlen+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <strnlen+0x4a>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i32 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
int colon(char c) { return c == ':'; }


x86 assembly (clang, -O0):
<colon>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colon>:
xor    %eax,%eax
cmp    $0x3a,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @colon(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 58
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @colon(i8 signext %0) {
%2 = icmp eq i8 %0, 58
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void forTest() {
  int x = 0;
  for (x = 1; 2 == 3; x++)
    x = 4;
  assert(x == 4);
}


x86 assembly (clang, -O0):
<forTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1135 <forTest+0x25>
jmp    114a <forTest+0x3a>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <forTest+0x16>
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @forTest() {
%1 = tail call i32 @assert(i32 0)
ret void
}
void ff_hevc_put_hevc_uni_epel_hv24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv24_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ puts(char *);
void my_printf(char *str, int value) {
  puts(str);
  print_int(value);
  puts("\n");
}


x86 assembly (clang, -O0):
<my_printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%edi
call   1040 <print_int@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_printf>:
push   %rbx
mov    %esi,%ebx
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <print_int@plt>
lea    0xeca(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @my_printf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @print_int(i32 %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ flashfsGetSize();
int /*<<< orphan*/ flashfsIdentifyStartOfFreeSpace();
int /*<<< orphan*/ flashfsSeekAbs(int /*<<< orphan*/);
void flashfsInit(void) {
  if (flashfsGetSize() > 0) {
    flashfsSeekAbs(flashfsIdentifyStartOfFreeSpace());
  }
}


x86 assembly (clang, -O0):
<flashfsInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <flashfsGetSize@plt>
cmp    $0x0,%rax
jle    1153 <flashfsInit+0x23>
mov    $0x0,%al
call   1050 <flashfsIdentifyStartOfFreeSpace@plt>
mov    %eax,%edi
call   1030 <flashfsSeekAbs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flashfsInit>:
push   %rax
xor    %eax,%eax
call   1040 <flashfsGetSize@plt>
test   %rax,%rax
jle    114c <flashfsInit+0x1c>
xor    %eax,%eax
call   1050 <flashfsIdentifyStartOfFreeSpace@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <flashfsSeekAbs@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @flashfsInit() {
%1 = call i64 (...) @flashfsGetSize()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @flashfsIdentifyStartOfFreeSpace()
%5 = call i32 @flashfsSeekAbs(i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @flashfsInit() {
%1 = tail call i64 (...) @flashfsGetSize()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @flashfsIdentifyStartOfFreeSpace()
%5 = tail call i32 @flashfsSeekAbs(i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned short attributes;
};
struct TYPE_4__ {
  TYPE_1__ max_bounds;
};
typedef TYPE_2__ XFontStruct;

/* Variables and functions */
void set_XFontStruct_max_bounds_attributes(void *_p, unsigned short _v) {
  ((XFontStruct *)_p)->max_bounds.attributes = (unsigned short)_v;
}


x86 assembly (clang, -O0):
<set_XFontStruct_max_bounds_attributes>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XFontStruct_max_bounds_attributes>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i16 }
define void @set_XFontStruct_max_bounds_attributes(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i16 %5, i16* %9
ret void
}

LLVM IR (-O2):
define void @set_XFontStruct_max_bounds_attributes(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ y;
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int x = 0, y = 1;
  printf("before --> x - %d, y - %d\n", x, y);
  {
    if (sizeof(x) == sizeof(int) && sizeof(y) == sizeof(int)) {
      int tmp;
      tmp = x;
      x = y;
      y = tmp;
    }
  };
  printf("after --> x - %d, y - %d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"before --> x - %d, y - %d\0A\00"
@.str.1 = [26 x i8] c"after --> x - %d, y - %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %2
store i32 %8, i32* %4
%9 = load i32, i32* %3
store i32 %9, i32* %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"before --> x - %d, y - %d\0A\00"
@.str.1 = [26 x i8] c"after --> x - %d, y - %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0)
ret i32 0
}
double calc(double a, double b, double c) {
  return c * b * b * a + 150 * b + c;
}


x86 assembly (clang, -O0):
<calc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xed1(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc>:
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
mulsd  0xeec(%rip),%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @calc(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %5
%9 = fmul double %7, %8
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = load double, double* %4
%13 = load double, double* %5
%14 = fmul double 1.500000e+02, %13
%15 = call double @llvm.fmuladd.f64(double %11, double %12, double %14)
%16 = load double, double* %6
%17 = fadd double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @calc(double %0, double %1, double %2) {
%4 = fmul double %1, %2
%5 = fmul double %4, %1
%6 = fmul double %1, 1.500000e+02
%7 = tail call double @llvm.fmuladd.f64(double %5, double %0, double %6)
%8 = fadd double %7, %2
ret double %8
}
/* Variables and functions */
float _acoshf(float);
float acoshf(float x) { return _acoshf(x); }


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

x86 assembly (clang, -O2):
<acoshf>:
jmp    1030 <_acoshf@plt>

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

LLVM IR (-O2):
define float @acoshf(float %0) {
%2 = tail call float @_acoshf(float %0)
ret float %2
}
/* Variables and functions */
char *_tempnam(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
char *mktempname(void) { return _tempnam(NULL, NULL); }


x86 assembly (clang, -O0):
<mktempname>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <_tempnam@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mktempname>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <_tempnam@plt>

LLVM IR (-O0):
define i8* @mktempname() {
%1 = call i8* @_tempnam(i32* null, i32* null)
ret i8* %1
}

LLVM IR (-O2):
define i8* @mktempname() {
%1 = tail call i8* @_tempnam(i32* null, i32* null)
ret i8* %1
}
void Lut_Lab2Lut8(double *out, double *in) {
  out[0] = in[0] * 1.0 / 100.0;
  out[1] = (in[1] + 128.0) * 1.0 / 255.0;
  out[2] = (in[2] + 128.0) * 1.0 / 255.0;
}


x86 assembly (clang, -O0):
<Lut_Lab2Lut8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xef0(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xed4(%rip),%xmm0
addsd  0x8(%rax),%xmm0
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xea2(%rip),%xmm0
addsd  0x10(%rax),%xmm0
movsd  0xe8d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lut_Lab2Lut8>:
movsd  (%rsi),%xmm0
divsd  0xef4(%rip),%xmm0
movsd  %xmm0,(%rdi)
movsd  0xef0(%rip),%xmm0
movsd  0x8(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0xee7(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rdi)
addsd  0x10(%rsi),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @Lut_Lab2Lut8(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fmul double %7, 1.000000e+00
%9 = fdiv double %8, 1.000000e+02
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fadd double %14, 1.280000e+02
%16 = fmul double %15, 1.000000e+00
%17 = fdiv double %16, 2.550000e+02
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 1
store double %17, double* %19
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = fadd double %22, 1.280000e+02
%24 = fmul double %23, 1.000000e+00
%25 = fdiv double %24, 2.550000e+02
%26 = load double*, double** %3
%27 = getelementptr inbounds double, double* %26, i64 2
store double %25, double* %27
ret void
}

LLVM IR (-O2):
define void @Lut_Lab2Lut8(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fdiv double %3, 1.000000e+02
store double %4, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fadd double %6, 1.280000e+02
%8 = fdiv double %7, 2.550000e+02
%9 = getelementptr inbounds double, double* %0, i64 1
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = fadd double %11, 1.280000e+02
%13 = fdiv double %12, 2.550000e+02
%14 = getelementptr inbounds double, double* %0, i64 2
store double %13, double* %14
ret void
}
int mhia_handle_probe_timer(struct user_t *user, struct mhia_msg *msg) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.user_t = type opaque
%struct.mhia_msg = type opaque
define i32 @mhia_handle_probe_timer(%struct.user_t* %0, %struct.mhia_msg* %1) {
%3 = alloca %struct.user_t*
%4 = alloca %struct.mhia_msg*
store %struct.user_t* %0, %struct.user_t** %3
store %struct.mhia_msg* %1, %struct.mhia_msg** %4
ret i32 0
}

LLVM IR (-O2):
%struct.user_t = type opaque
%struct.mhia_msg = type opaque
define i32 @mhia_handle_probe_timer(%struct.user_t* nocapture readnone %0, %struct.mhia_msg* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void htab_default_dtor(const void *const data) { free((void *)data); }


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

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

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

LLVM IR (-O2):
define void @htab_default_dtor(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct client {
  int dummy;
};

/* Variables and functions */
int spr16_server_reset_client(struct client *);
int focus_client(struct client *cl) {
  if (!cl)
    return -1;
  return spr16_server_reset_client(cl);
}


x86 assembly (clang, -O0):
<focus_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <focus_client+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <focus_client+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <spr16_server_reset_client@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<focus_client>:
test   %rdi,%rdi
je     111a <focus_client+0xa>
jmp    1030 <spr16_server_reset_client@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.client = type { i32 }
define i32 @focus_client(%struct.client* %0) {
%2 = alloca i32
%3 = alloca %struct.client*
store %struct.client* %0, %struct.client** %3
%4 = load %struct.client*, %struct.client** %3
%5 = icmp ne %struct.client* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
%8 = load %struct.client*, %struct.client** %3
%9 = call i32 @spr16_server_reset_client(%struct.client* %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.client = type { i32 }
define i32 @focus_client(%struct.client* %0) {
%2 = icmp eq %struct.client* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @spr16_server_reset_client(%struct.client* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
void av_codec_get_tag2() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_get_tag2() {
ret void
}
int cairo_code_draw_whiteTinyButton_get_height() { return 22; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_whiteTinyButton_get_height() {
ret i32 22
}

LLVM IR (-O2):
define i32 @cairo_code_draw_whiteTinyButton_get_height() {
ret i32 22
}
/* Variables and functions */
scalar_t__ isdigit(int);
unsigned parsedig(const char **p) {
  unsigned i = 0;
  while (isdigit((int)(unsigned char)**p)) {
    i = i * 10 + **p - '0';
    ++*p;
  }
  return (i);
}


x86 assembly (clang, -O0):
<parsedig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1165 <parsedig+0x55>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1123 <parsedig+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsedig>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1154 <parsedig+0x44>
nopl   0x0(%rax)
lea    (%rbx,%rbx,4),%eax
mov    (%r14),%rcx
movsbl (%rcx),%edx
lea    (%rdx,%rax,2),%ebx
add    $0xffffffd0,%ebx
lea    0x1(%rcx),%rax
mov    %rax,(%r14)
movzbl 0x1(%rcx),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1130 <parsedig+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @parsedig(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = tail call i64 @isdigit(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %20, label %7
7: ; preds = %1, %7
%8 = phi i32 [ %14, %7 ], [ 0, %1 ]
%9 = mul i32 %8, 10
%10 = load i8*, i8** %0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add i32 %9, -48
%14 = add i32 %13, %12
%15 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %15, i8** %0
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = tail call i64 @isdigit(i32 %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %7
20: ; preds = %7, %1
%21 = phi i32 [ 0, %1 ], [ %14, %7 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void function2(int b) {
  printf("You entered %d so function2 was called.\n\n", b);
}


x86 assembly (clang, -O0):
<function2>:
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):
<function2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"You entered %d so function2 was called.\0A\0A\00"
define void @function2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"You entered %d so function2 was called.\0A\0A\00"
define void @function2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
char *ft_stpncpy(char *__restrict s1, const char *__restrict s2,
                 unsigned long n) {
  char *cp_s1;
  cp_s1 = (char *)s1;
  while (*s2 != 0x00 && n--)
    *s1++ = *s2++;
  return (cp_s1);
}


x86 assembly (clang, -O0):
<ft_stpncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
je     1146 <ft_stpncpy+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1156 <ft_stpncpy+0x56>
jmp    117d <ft_stpncpy+0x7d>
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    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1118 <ft_stpncpy+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_stpncpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1138 <ft_stpncpy+0x38>
test   %rdx,%rdx
je     1138 <ft_stpncpy+0x38>
add    $0xffffffffffffffff,%rdx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %cl,(%rax,%rdi,1)
movzbl 0x1(%rsi,%rdi,1),%ecx
test   %cl,%cl
je     1138 <ft_stpncpy+0x38>
lea    0x1(%rdi),%r8
cmp    %rdi,%rdx
mov    %r8,%rdi
jne    1120 <ft_stpncpy+0x20>
ret

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

LLVM IR (-O2):
define i8* @ft_stpncpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1, i64 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
%6 = icmp eq i64 %2, 0
%7 = or i1 %5, %6
br i1 %7, label %20, label %8
8: ; preds = %3, %8
%9 = phi i8 [ %16, %8 ], [ %4, %3 ]
%10 = phi i8* [ %15, %8 ], [ %0, %3 ]
%11 = phi i64 [ %13, %8 ], [ %2, %3 ]
%12 = phi i8* [ %14, %8 ], [ %1, %3 ]
%13 = add i64 %11, -1
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %9, i8* %10
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
%18 = icmp eq i64 %13, 0
%19 = select i1 %17, i1 true, i1 %18
br i1 %19, label %20, label %8
20: ; preds = %8, %3
ret i8* %0
}
/* Variables and functions */
int rand();
float rand_uniform(int, float);
float rand_scale(float s) {
  float scale = rand_uniform(1, s);
  if (rand() % 2)
    return scale;
  return 1. / scale;
}


x86 assembly (clang, -O0):
<rand_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <rand_uniform@plt>
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1168 <rand_scale+0x48>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1186 <rand_scale+0x66>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe87(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_scale>:
push   %rax
mov    $0x1,%edi
call   1030 <rand_uniform@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
movss  0x4(%rsp),%xmm0
test   $0x1,%al
je     1144 <rand_scale+0x24>
pop    %rax
ret
movss  0xeb4(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rand_scale(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = call float @rand_uniform(i32 1, float %5)
store float %6, float* %4
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load float, float* %4
store float %11, float* %2
br label %17
12: ; preds = %1
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = fdiv double 1.000000e+00, %14
%16 = fptrunc double %15 to float
store float %16, float* %2
br label %17
17: ; preds = %12, %10
%18 = load float, float* %2
ret float %18
}

LLVM IR (-O2):
define float @rand_scale(float %0) {
%2 = tail call float @rand_uniform(i32 1, float %0)
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = fdiv float 1.000000e+00, %2
%7 = select i1 %5, float %6, float %2
ret float %7
}
int Decrementa() {
  int i = 10;
  return --i;
}


x86 assembly (clang, -O0):
<Decrementa>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Decrementa() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, -1
store i32 %3, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @Decrementa() {
ret i32 9
}
int WMin(int w1, int w2) { return w1 < w2 ? w1 : w2; }


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

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

LLVM IR (-O0):
define i32 @WMin(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 slt 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 @WMin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void load_remote_stream(char *stream_name) {}


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

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

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

LLVM IR (-O2):
define void @load_remote_stream(i8* nocapture %0) {
ret void
}
struct bwb_line *bwb_TIMER_STOP(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  bwb_Timer_Off();
  return bwb_zline(l);
}


x86 assembly (clang, -O0):
<bwb_TIMER_STOP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <bwx_DEBUG@plt>
mov    $0x0,%al
call   1050 <bwb_Timer_Off@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bwb_zline@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_TIMER_STOP>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <bwx_DEBUG@plt>
xor    %eax,%eax
call   1050 <bwb_Timer_Off@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <bwb_zline@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_TIMER_STOP = [15 x i8] c"bwb_TIMER_STOP\00"
define %struct.bwb_line* @bwb_TIMER_STOP(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.bwb_TIMER_STOP, i64 0, i64 0))
%4 = call i32 (...) @bwb_Timer_Off()
%5 = load %struct.bwb_line*, %struct.bwb_line** %2
%6 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.bwb_line*
ret %struct.bwb_line* %8
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_TIMER_STOP = [15 x i8] c"bwb_TIMER_STOP\00"
define %struct.bwb_line* @bwb_TIMER_STOP(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.bwb_TIMER_STOP, i64 0, i64 0))
%3 = tail call i32 (...) @bwb_Timer_Off()
%4 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.bwb_line*
ret %struct.bwb_line* %6
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_RADIO_RESET_PIN() { set_io_bit(-1, 2); }


x86 assembly (clang, -O0):
<TOSH_SET_RADIO_RESET_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_RADIO_RESET_PIN>:
mov    $0xffffffff,%edi
mov    $0x2,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_RADIO_RESET_PIN() {
%1 = call i32 @set_io_bit(i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_RADIO_RESET_PIN() {
%1 = tail call i32 @set_io_bit(i32 -1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int write(int, char *, int);
int serial_write(int fd, char *buff, int datalen) {
  int len = 0;
  len = write(fd, buff, datalen);
  printf("send data OK! datalen=%d\n", len);
  return len;
}


x86 assembly (clang, -O0):
<serial_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"send data OK! datalen=%d\0A\00"
define i32 @serial_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
@.str = [26 x i8] c"send data OK! datalen=%d\0A\00"
define i32 @serial_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 %4
}