xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Exercise 02, using Makefiles to build your software!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Exercise 02, using Makefiles to build your software!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [53 x i8] c"Exercise 02, using Makefiles to build your software!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ smbus_delay();
int smbus_wait_until_done(void) {
  unsigned long loops;
  loops = (100 * 1000 * 10);
  do {
    unsigned char val;
    smbus_delay();
    val = inb(0x5000 + 0x0);
    if ((val & 1) == 0) {
      break;
    }
  } while (--loops);
  return loops ? 0 : -3;
}


x86 assembly (clang, -O0):
<smbus_wait_until_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0xf4240,-0x8(%rbp)
mov    $0x0,%al
call   1040 <smbus_delay@plt>
mov    $0x5000,%edi
call   1030 <inb@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1159 <smbus_wait_until_done+0x39>
jmp    1174 <smbus_wait_until_done+0x54>
jmp    115e <smbus_wait_until_done+0x3e>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1130 <smbus_wait_until_done+0x10>
mov    -0x8(%rbp),%rdx
mov    $0xfffffffd,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_wait_until_done>:
push   %rbp
push   %rbx
push   %rax
mov    $0xfffffffffff0bdc0,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <smbus_delay@plt>
mov    $0x5000,%edi
call   1030 <inb@plt>
test   $0x1,%al
je     114f <smbus_wait_until_done+0x2f>
inc    %rbx
jne    1130 <smbus_wait_until_done+0x10>
mov    $0xfffffffd,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @smbus_wait_until_done() {
%1 = alloca i64
%2 = alloca i8
store i64 1000000, i64* %1
br label %3
3: ; preds = %12, %0
%4 = call i32 (...) @smbus_delay()
%5 = call zeroext i8 @inb(i32 20480)
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
br label %16
11: ; preds = %3
br label %12
12: ; preds = %11
%13 = load i64, i64* %1
%14 = add i64 %13, -1
store i64 %14, i64* %1
%15 = icmp ne i64 %14, 0
br i1 %15, label %3, label %16
16: ; preds = %12, %10
%17 = load i64, i64* %1
%18 = icmp ne i64 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 0, i32 -3
ret i32 %20
}

LLVM IR (-O2):
define i32 @smbus_wait_until_done() {
br label %1
1: ; preds = %7, %0
%2 = phi i64 [ 1000000, %0 ], [ %8, %7 ]
%3 = tail call i32 (...) @smbus_delay()
%4 = tail call zeroext i8 @inb(i32 20480)
%5 = and i8 %4, 1
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = add nsw i64 %2, -1
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %1
10: ; preds = %7, %1
%11 = phi i32 [ 0, %1 ], [ -3, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void I2C3_ER_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @I2C3_ER_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @I2C3_ER_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void term_exit() { printf("\n"); }


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

x86 assembly (clang, -O2):
<term_exit>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @term_exit() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: jstat [-a] [-e events] program\n"
                  "--all -a  Measure global system\n"
                  "-e --events list  Comma separate list of events to measure. "
                  "Use {} for groups\n"
                  "Run event_download.py once first to use symbolic events\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [205 x i8] c"Usage: jstat [-a] [-e events] program\0A--all -a Measure global system\0A-e --events list Comma separate list of events to measure. Use {} for groups\0ARun event_download.py once first to use symbolic events\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [205 x i8] c"Usage: jstat [-a] [-e events] program\0A--all -a Measure global system\0A-e --events list Comma separate list of events to measure. Use {} for groups\0ARun event_download.py once first to use symbolic events\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fpu_interrupt_handler() { printf("FPU exception fired.\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"FPU exception fired.\0A\00"
define void @fpu_interrupt_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"FPU exception fired.\00"
define void @fpu_interrupt_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IN_DeactivateMouse();
void IN_Shutdown(void) { IN_DeactivateMouse(); }


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

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

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

LLVM IR (-O2):
define void @IN_Shutdown() {
%1 = tail call i32 (...) @IN_DeactivateMouse()
ret void
}
/* Type definitions */
struct rpc_err {
  int dummy;
};
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
void clntraw_geterr(CLIENT *x, struct rpc_err *x1) {}


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

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

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

LLVM IR (-O2):
%struct.rpc_err = type { i32 }
define void @clntraw_geterr(i32* nocapture %0, %struct.rpc_err* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ talloc_report_depth_file(void const *, int /*<<< orphan*/,
                                            int, int /*<<< orphan*/ *);
void talloc_report(const void *ptr, FILE *f) {
  talloc_report_depth_file(ptr, 0, 1, f);
}


x86 assembly (clang, -O0):
<talloc_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <talloc_report_depth_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<talloc_report>:
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <talloc_report_depth_file@plt>

LLVM IR (-O0):
define void @talloc_report(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = call i32 @talloc_report_depth_file(i8* %5, i32 0, i32 1, i32* %6)
ret void
}

LLVM IR (-O2):
define void @talloc_report(i8* %0, i32* %1) {
%3 = tail call i32 @talloc_report_depth_file(i8* %0, i32 0, i32 1, i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ htobe32(int /*<<< orphan*/);
void st_i32_be(void *x, int32_t i) { ((int32_t *)x)[0] = htobe32(i); }


x86 assembly (clang, -O0):
<st_i32_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htobe32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_i32_be>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htobe32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @st_i32_be(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 = call i32 @htobe32(i32 %5)
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %6, i32* %9
ret void
}

LLVM IR (-O2):
define void @st_i32_be(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htobe32(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int asprintf(char **, char *);
char *getenv(char *);
char *__eztrace_get_filedir() {
  char *res = getenv("EZTRACE_TRACE_DIR");
  int ret;
  if (!res) {
    ret = asprintf(&res, "/tmp");
  }
  return res;
}


x86 assembly (clang, -O0):
<__eztrace_get_filedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <__eztrace_get_filedir+0x36>
lea    -0x8(%rbp),%rdi
lea    0xec4(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__eztrace_get_filedir>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     1138 <__eztrace_get_filedir+0x18>
pop    %rcx
ret
lea    0xed3(%rip),%rsi
mov    %rsp,%rdi
call   1040 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"EZTRACE_TRACE_DIR\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i8* @__eztrace_get_filedir() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %2
br label %8
8: ; preds = %6, %0
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@.str = [18 x i8] c"EZTRACE_TRACE_DIR\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i8* @__eztrace_get_filedir() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %1
br label %8
8: ; preds = %5, %0
%9 = phi i8* [ %7, %5 ], [ %3, %0 ]
ret i8* %9
}
long long int factorial(long long int n) {
  if (n > 1) {
    return n * factorial(n - 1);
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jle    1150 <factorial+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <factorial+0x48>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%rdi
jl     1121 <factorial+0x21>
mov    $0x1,%eax
imul   %rdi,%rax
lea    -0x1(%rdi),%rcx
cmp    $0x2,%rdi
mov    %rcx,%rdi
ja     1110 <factorial+0x10>
ret

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

LLVM IR (-O2):
define i64 @factorial(i64 %0) {
%2 = icmp sgt i64 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 1, %1 ]
%6 = add nsw i64 %4, -1
%7 = mul nsw i64 %4, %5
%8 = icmp ugt i64 %4, 2
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
scalar_t__ malloc(int);
char *getStackMemory(int size, char shared) { return (char *)malloc(size); }


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

x86 assembly (clang, -O2):
<getStackMemory>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @getStackMemory(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @getStackMemory(i32 %0, i8 signext %1) {
%3 = tail call i64 @malloc(i32 %0)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int update_values(int *, int *);
int main() {
  int width = 0, height = 0;
  bool ok = update_values(&width, &height);
  if (ok)
    printf("%d:%d\n", width, height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <update_values@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1169 <main+0x49>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <update_values@plt>
test   %eax,%eax
je     1154 <main+0x34>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d:%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 0, i32* %3
%5 = call i32 @update_values(i32* %2, i32* %3)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @update_values(i32* %1, i32* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %11
11: ; preds = %7, %0
ret i32 0
}
/* Type definitions */
struct atnet_dsc {
  int dummy;
};

/* Variables and functions */
scalar_t__ dialog(struct atnet_dsc *, char *, int);
int atnet_set_clkm(void *handle, int mhz) {
  struct atnet_dsc *dsc = handle;
  return dialog(dsc, "CLKM %d", mhz) == 0;
}


x86 assembly (clang, -O0):
<atnet_set_clkm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xecb(%rip),%rsi
call   1030 <dialog@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atnet_set_clkm>:
push   %rax
mov    %esi,%edx
lea    0xee6(%rip),%rsi
call   1030 <dialog@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.atnet_dsc = type { i32 }
@.str = [8 x i8] c"CLKM %d\00"
define i32 @atnet_set_clkm(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.atnet_dsc*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.atnet_dsc*
store %struct.atnet_dsc* %7, %struct.atnet_dsc** %5
%8 = load %struct.atnet_dsc*, %struct.atnet_dsc** %5
%9 = load i32, i32* %4
%10 = call i64 @dialog(%struct.atnet_dsc* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.atnet_dsc = type { i32 }
@.str = [8 x i8] c"CLKM %d\00"
define i32 @atnet_set_clkm(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to %struct.atnet_dsc*
%4 = tail call i64 @dialog(%struct.atnet_dsc* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void separateExpressions(int a) {
  int b = a + 1;
  --b;
  char *buf = malloc(1);
  if (a != 0 && b == 0)
    return;
  free(buf);
}


x86 assembly (clang, -O0):
<separateExpressions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1164 <separateExpressions+0x44>
cmpl   $0x0,-0x8(%rbp)
jne    1164 <separateExpressions+0x44>
jmp    116d <separateExpressions+0x4d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<separateExpressions>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @separateExpressions(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, -1
store i32 %8, i32* %3
%9 = call i8* @malloc(i32 1)
store i8* %9, i8** %4
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
br label %19
16: ; preds = %12, %1
%17 = load i8*, i8** %4
%18 = call i32 @free(i8* %17)
br label %19
19: ; preds = %16, %15
ret void
}

LLVM IR (-O2):
define void @separateExpressions(i32 %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int _llseek(unsigned int, unsigned long long, unsigned long long, long long *,
            unsigned int);
long long my_llseek(unsigned int fd, long long offset, unsigned int origin) {
  long long result;
  int retval;
  retval = _llseek(fd, ((unsigned long long)offset) >> 32,
                   ((unsigned long long)offset) & 0xffffffff, &result, origin);
  return (retval == -1 ? (long long)retval : result);
}


x86 assembly (clang, -O0):
<my_llseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
shr    $0x20,%rsi
movabs $0xffffffff,%rdx
and    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%r8d
lea    -0x20(%rbp),%rcx
call   1030 <_llseek@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1162 <my_llseek+0x52>
movslq -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    116a <my_llseek+0x5a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_llseek>:
push   %rax
mov    %edx,%r8d
mov    %esi,%edx
shr    $0x20,%rsi
mov    %rsp,%rcx
call   1030 <_llseek@plt>
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
cmp    $0xffffffff,%ecx
je     1134 <my_llseek+0x24>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @my_llseek(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i64, i64* %5
%11 = lshr i64 %10, 32
%12 = load i64, i64* %5
%13 = and i64 %12, 4294967295
%14 = load i32, i32* %6
%15 = call i32 @_llseek(i32 %9, i64 %11, i64 %13, i64* %7, i32 %14)
store i32 %15, i32* %8
%16 = load i32, i32* %8
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %21
18: ; preds = %3
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
br label %23
21: ; preds = %3
%22 = load i64, i64* %7
br label %23
23: ; preds = %21, %18
%24 = phi i64 [ %20, %18 ], [ %22, %21 ]
ret i64 %24
}

LLVM IR (-O2):
define i64 @my_llseek(i32 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = lshr i64 %1, 32
%7 = and i64 %1, 4294967295
%8 = call i32 @_llseek(i32 %0, i64 %6, i64 %7, i64* %4, i32 %2)
%9 = icmp eq i32 %8, -1
%10 = load i64, i64* %4
%11 = select i1 %9, i64 -1, i64 %10
ret i64 %11
}
int f1(int i) {
  static void *labs[2] = {&&lab1, &&lab2};
  goto *(labs[i & 1]);
lab1:
  return 1;
lab2:
  return 2;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
movslq %eax,%rcx
lea    0x2f19(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    113c <f1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1137 <f1+0x37>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret
mov    -0x10(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<f1>:
and    $0x1,%edi
lea    0x2d36(%rip),%rax
jmp    *(%rax,%rdi,8)
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret

LLVM IR (-O0):
@f1.labs = internal global [2 x i8*] [i8* blockaddress(@f1, %9), i8* blockaddress(@f1, %10)]
define i32 @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* @f1.labs, i64 0, i64 %6
%8 = load i8*, i8** %7
br label %13
9: ; preds = %13
store i32 1, i32* %2
br label %11
10: ; preds = %13
store i32 2, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
13: ; preds = %1
%14 = phi i8* [ %8, %1 ]
indirectbr i8* %14, [label %9, label %10]
}

LLVM IR (-O2):
@f1.labs = internal unnamed_addr constant [2 x i8*] [i8* blockaddress(@f1, %7), i8* blockaddress(@f1, %6)]
define i32 @f1(i32 %0) {
%2 = and i32 %0, 1
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* @f1.labs, i64 0, i64 %3
%5 = load i8*, i8** %4
indirectbr i8* %5, [label %7, label %6]
6: ; preds = %1
br label %7
7: ; preds = %1, %6
%8 = phi i32 [ 2, %6 ], [ 1, %1 ]
ret i32 %8
}
int eqdf2(double a, double b) { return a == b; }


x86 assembly (clang, -O0):
<eqdf2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eqdf2>:
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @eqdf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @eqdf2(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float d_sqrt(float);
int /*<<< orphan*/ printf(char *, float, float);
int main(void) {
  float num = 2;
  float result;
  result = d_sqrt(num);
  printf("La raiz cuadrada de:%f es:%f\n", num, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <d_sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1030 <d_sqrt@plt>
movaps %xmm0,%xmm1
lea    0xecc(%rip),%rdi
movss  0xec0(%rip),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"La raiz cuadrada de:%f es:%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 2.000000e+00, float* %2
%4 = load float, float* %2
%5 = call float @d_sqrt(float %4)
store float %5, float* %3
%6 = load float, float* %2
%7 = load float, float* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float %6, float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"La raiz cuadrada de:%f es:%f\0A\00"
define i32 @main() {
%1 = tail call float @d_sqrt(float 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float 2.000000e+00, float %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ps2_common_init();
int /*<<< orphan*/ ps2_mca_board_model_80_type2_init();
void ps2_model_80_init() {
  ps2_common_init();
  ps2_mca_board_model_80_type2_init();
}


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

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

LLVM IR (-O0):
define void @ps2_model_80_init() {
%1 = call i32 (...) @ps2_common_init()
%2 = call i32 (...) @ps2_mca_board_model_80_type2_init()
ret void
}

LLVM IR (-O2):
define void @ps2_model_80_init() {
%1 = tail call i32 (...) @ps2_common_init()
%2 = tail call i32 (...) @ps2_mca_board_model_80_type2_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_X(int, int /*<<< orphan*/, int,
                                   int /*<<< orphan*/, int, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/);
void window_error_open(int stringId, int edx) {
  RCT2_CALLPROC_X(0x0066792F, 0, stringId, 0, edx, 0, 0, 0);
}


x86 assembly (clang, -O0):
<window_error_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%r8d
mov    $0x66792f,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%ecx
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <RCT2_CALLPROC_X@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_error_open>:
push   %rax
mov    %esi,%r8d
mov    %edi,%edx
mov    $0x66792f,%edi
xor    %esi,%esi
xor    %ecx,%ecx
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <RCT2_CALLPROC_X@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @window_error_open(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @RCT2_CALLPROC_X(i32 6715695, i32 0, i32 %5, i32 0, i32 %6, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @window_error_open(i32 %0, i32 %1) {
%3 = tail call i32 @RCT2_CALLPROC_X(i32 6715695, i32 0, i32 %0, i32 0, i32 %1, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *,
                           char *);
int /*<<< orphan*/ stderr;
int _netid_error(char const *message, int ret) {
  fprintf(stderr, "%s: %s: %s\n", "netid", message, "Network not found");
  return ret;
}


x86 assembly (clang, -O0):
<_netid_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xecd(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xed1(%rip),%r8
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_netid_error>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
lea    0xedf(%rip),%rdx
lea    0xede(%rip),%r8
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"%s: %s: %s\0A\00"
@.str.1 = [6 x i8] c"netid\00"
@.str.2 = [18 x i8] c"Network not found\00"
define i32 @_netid_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"%s: %s: %s\0A\00"
@.str.1 = [6 x i8] c"netid\00"
@.str.2 = [18 x i8] c"Network not found\00"
define i32 @_netid_error(i8* %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret i32 %1
}
unsigned long hash_str(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash_str+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_str+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash_str+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_str+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
const char *Filter_Name(void) { return "Filter"; }


x86 assembly (clang, -O0):
<Filter_Name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Filter_Name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Filter\00"
define i8* @Filter_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"Filter\00"
define i8* @Filter_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void pa(int a[], int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d ", a[i]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<pa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <pa+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <pa+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <pa+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <pa+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @pa(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @pa(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}
int is_buggy250(unsigned short device, unsigned int chiprev) {
  return device == 0x0250 && chiprev == 0x11;
}


x86 assembly (clang, -O0):
<is_buggy250>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    $0x250,%ecx
mov    %al,-0x9(%rbp)
jne    112d <is_buggy250+0x2d>
cmpl   $0x11,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_buggy250>:
cmp    $0x250,%edi
sete   %al
cmp    $0x11,%esi
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_buggy250(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = icmp eq i32 %6, 592
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 17
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ false, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_buggy250(i16 zeroext %0, i32 %1) {
%3 = icmp eq i16 %0, 592
%4 = icmp eq i32 %1, 17
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int main() {
  long long int l = -0x7fffffffffffffffLL - 1;
  unsigned int u;
  u = -l;
  asm volatile("" : "+r"(u));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i64 -9223372036854775808, i64* %2
%4 = load i64, i64* %2
%5 = sub nsw i64 0, %4
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %7)
store i32 %8, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
ret i32 0
}
int isnumeric_lead(char c) {
  if ('0' <= c && c <= '9')
    return 1;
  if ('.' == c)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isnumeric_lead>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1134 <isnumeric_lead+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1134 <isnumeric_lead+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1158 <isnumeric_lead+0x58>
movsbl -0x5(%rbp),%ecx
mov    $0x2e,%eax
cmp    %ecx,%eax
jne    1151 <isnumeric_lead+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1158 <isnumeric_lead+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumeric_lead>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
cmp    $0x2e,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isnumeric_lead(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 48, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %18
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 46, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %2
br label %18
17: ; preds = %12
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @isnumeric_lead(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = icmp eq i8 %0, 46
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int id;
  while (scanf("%d", &id) > 0) {
    printf("%d;", id);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
jle    115d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jle    117c <main+0x5c>
lea    0xebd(%rip),%r14
lea    0xeb3(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jg     1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d;\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d;\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
char *skipws(char *p) {
  for (;;) {
    char ch = *p;
    if (' ' == ch || '\t' == ch)
      ++p;
    else
      break;
  }
  return p;
}


x86 assembly (clang, -O0):
<skipws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
je     1133 <skipws+0x33>
movsbl -0x9(%rbp),%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
jne    1144 <skipws+0x44>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <skipws+0x49>
jmp    114e <skipws+0x4e>
jmp    1108 <skipws+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipws>:
mov    %rdi,%rax
jmp    1114 <skipws+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skipws+0x10>
cmp    $0x9,%cl
je     1110 <skipws+0x10>
ret

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

LLVM IR (-O2):
define i8* @skipws(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
char *copy_string(char *target, char *source) {
  while (0 != source[0]) {
    target[0] = source[0];
    target = target + 1;
    source = source + 1;
  }
  return target;
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1146 <copy_string+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <copy_string+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <copy_string+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <copy_string+0x10>
ret

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

LLVM IR (-O2):
define i8* @copy_string(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ regsets_store_inferior_registers();
void fbsd_store_registers(int regno) { regsets_store_inferior_registers(); }


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

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

LLVM IR (-O0):
define void @fbsd_store_registers(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @regsets_store_inferior_registers()
ret void
}

LLVM IR (-O2):
define void @fbsd_store_registers(i32 %0) {
%2 = tail call i32 (...) @regsets_store_inferior_registers()
ret void
}