xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int dir_exists(const char *path) {
  struct stat st;
  return stat(path, &st) == 0 && S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<dir_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <dir_exists+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_exists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <dir_exists+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @dir_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dir_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int accurate_approxlib(int, int, int, int /*<<< orphan*/ *);
int offset(int /*<<< orphan*/, int, int, int);
int autohelperowl_attackpat156(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int a;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(0, 1, move, transformation);
  return accurate_approxlib(a, (1 + 2 - (color)), 20, NULL) == 2;
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat156>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x3,%esi
sub    -0x14(%rbp),%esi
mov    $0x14,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <accurate_approxlib@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat156>:
push   %rbx
mov    %ecx,%ebx
mov    %esi,%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <offset@plt>
mov    $0x3,%esi
sub    %ebx,%esi
mov    %eax,%edi
mov    $0x14,%edx
xor    %ecx,%ecx
call   1040 <accurate_approxlib@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat156(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 0, i32 1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = load i32, i32* %9
%20 = sub nsw i32 3, %19
%21 = call i32 @accurate_approxlib(i32 %18, i32 %20, i32 20, i32* null)
%22 = icmp eq i32 %21, 2
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat156(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 0, i32 1, i32 %2, i32 %1)
%7 = sub nsw i32 3, %3
%8 = tail call i32 @accurate_approxlib(i32 %6, i32 %7, i32 20, i32* null)
%9 = icmp eq i32 %8, 2
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ notifyEvent(char *, int, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void sesc_release(int vaddr) { notifyEvent("sesc_release", vaddr, 0, 0); }


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

x86 assembly (clang, -O2):
<sesc_release>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <notifyEvent@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"sesc_release\00"
define void @sesc_release(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @notifyEvent(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"sesc_release\00"
define void @sesc_release(i32 %0) {
%2 = tail call i32 @notifyEvent(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}
vbdev(dev) char dev[];
{}


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

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

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

LLVM IR (-O2):
define i32 @vbdev(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
void usb_init(void) {}


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

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

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

LLVM IR (-O2):
define void @usb_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DS1302(int, int);
void Idle_1302(void) {
  DS1302(2, 0);
  DS1302(4, 1);
  DS1302(1, 1);
  return;
}


x86 assembly (clang, -O0):
<Idle_1302>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <DS1302@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <DS1302@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <DS1302@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Idle_1302>:
push   %rax
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <DS1302@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <DS1302@plt>
mov    $0x1,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <DS1302@plt>

LLVM IR (-O0):
define void @Idle_1302() {
%1 = call i32 @DS1302(i32 2, i32 0)
%2 = call i32 @DS1302(i32 4, i32 1)
%3 = call i32 @DS1302(i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @Idle_1302() {
%1 = tail call i32 @DS1302(i32 2, i32 0)
%2 = tail call i32 @DS1302(i32 4, i32 1)
%3 = tail call i32 @DS1302(i32 1, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct prime_thread_ctx {
  int dummy;
};

/* Variables and functions */
int shuffle_skip_to(struct prime_thread_ctx *__attribute__((unused)) pctx,
                    uint64_t __attribute__((unused)) target_num,
                    void *__attribute__((unused)) ctx) {
  return 0;
}


x86 assembly (clang, -O0):
<shuffle_skip_to>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.prime_thread_ctx = type { i32 }
define i32 @shuffle_skip_to(%struct.prime_thread_ctx* %0, i32 %1, i8* %2) {
%4 = alloca %struct.prime_thread_ctx*
%5 = alloca i32
%6 = alloca i8*
store %struct.prime_thread_ctx* %0, %struct.prime_thread_ctx** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.prime_thread_ctx = type { i32 }
define i32 @shuffle_skip_to(%struct.prime_thread_ctx* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
char *langRomTypeMegaFlashRomScc() { return "Mega Flash Rom SCC"; }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Mega Flash Rom SCC\00"
define i8* @langRomTypeMegaFlashRomScc() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"Mega Flash Rom SCC\00"
define i8* @langRomTypeMegaFlashRomScc() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
int get1w(fd)
int fd;
{
  int i;
  if (read(fd, &i, (sizeof(int))) == (sizeof(int)))
    return (i);
  return (-1);
}


x86 assembly (clang, -O0):
<get1w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <read@plt>
cltq
cmp    $0x4,%rax
jne    1145 <get1w+0x35>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <get1w+0x3c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get1w>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <read@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x4,%ecx
jne    1132 <get1w+0x22>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get1w(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i32, i32*, i64, ...) bitcast (i32 (...)* @read to i32 (i32, i32*, i64, ...)*)(i32 %5, i32* %4, i64 4)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 4
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @get1w(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i32, i32*, i64, ...) bitcast (i32 (...)* @read to i32 (i32, i32*, i64, ...)*)(i32 %0, i32* %2, i64 4)
%5 = icmp eq i32 %4, 4
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Type definitions */
struct tokenizer {
  int dummy;
};

/* Variables and functions */
char *get_token(struct tokenizer *);
int /*<<< orphan*/ tok_err(struct tokenizer *, char *);
void get_nl(struct tokenizer *t) {
  char *tok = get_token(t);
  if (tok && *tok)
    tok_err(t, "Expected end of line");
}


x86 assembly (clang, -O0):
<get_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_token@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <get_nl+0x44>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <get_nl+0x44>
mov    -0x8(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1030 <tok_err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nl>:
push   %rbx
mov    %rdi,%rbx
call   1040 <get_token@plt>
test   %rax,%rax
je     1143 <get_nl+0x23>
cmpb   $0x0,(%rax)
je     1143 <get_nl+0x23>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <tok_err@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.tokenizer = type { i32 }
@.str = [21 x i8] c"Expected end of line\00"
define void @get_nl(%struct.tokenizer* %0) {
%2 = alloca %struct.tokenizer*
%3 = alloca i8*
store %struct.tokenizer* %0, %struct.tokenizer** %2
%4 = load %struct.tokenizer*, %struct.tokenizer** %2
%5 = call i8* @get_token(%struct.tokenizer* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load %struct.tokenizer*, %struct.tokenizer** %2
%15 = call i32 @tok_err(%struct.tokenizer* %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13, %8, %1
ret void
}

LLVM IR (-O2):
%struct.tokenizer = type { i32 }
@.str = [21 x i8] c"Expected end of line\00"
define void @get_nl(%struct.tokenizer* %0) {
%2 = tail call i8* @get_token(%struct.tokenizer* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @tok_err(%struct.tokenizer* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4, %1
ret void
}
unsigned long long rdtsc(void) {
  unsigned long low, high;
  asm volatile("rdtsc" : "=a"(low), "=d"(high));
  return ((low) | (high) << 32);
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = shl i64 %7, 32
%9 = or i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = or i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void err_quit(const char *mesg) {
  printf("%s\n", mesg);
  exit(1);
}


x86 assembly (clang, -O0):
<err_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_quit>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @err_quit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int atoi(char *);
int Atoi(char *string) {
  if (string != NULL && *string != '\0') {
    return (atoi(string));
  }
  return (-1);
}


x86 assembly (clang, -O0):
<Atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <Atoi+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <Atoi+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    114f <Atoi+0x3f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Atoi>:
test   %rdi,%rdi
je     111f <Atoi+0xf>
cmpb   $0x0,(%rdi)
je     111f <Atoi+0xf>
jmp    1030 <atoi@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @Atoi(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %0)
br label %8
8: ; preds = %1, %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ], [ -1, %1 ]
ret i32 %9
}
void tegra_fb_unregister(struct tegra_fb_info *fb_info) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_fb_info = type opaque
define void @tegra_fb_unregister(%struct.tegra_fb_info* nocapture %0) {
ret void
}
int my_isspace(int c) { return (c >= '\t' && c <= '\r') || (c == ' '); }


x86 assembly (clang, -O0):
<my_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jl     1120 <my_isspace+0x20>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <my_isspace+0x2a>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isspace>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @my_isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int afora(int a) { return 7; }


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

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

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

LLVM IR (-O2):
define i32 @afora(i32 %0) {
ret i32 7
}
int d_bun_rr2(double a1, double a2) { return !(__builtin_isunordered(a1, a2)); }


x86 assembly (clang, -O0):
<d_bun_rr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bun_rr2>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @d_bun_rr2(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 uno double %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_bun_rr2(double %0, double %1) {
%3 = fcmp ord double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *realloc(void *, size_t);
void *yajl_internal_realloc(void *ctx, void *previous, size_t sz) {
  (void)ctx;
  return realloc(previous, sz);
}


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

x86 assembly (clang, -O2):
<yajl_internal_realloc>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @yajl_internal_realloc(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @realloc(i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @yajl_internal_realloc(i8* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %1, i64 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void get_time_string(char *buffer) {
  time_t rawtime;
  struct tm *info;
  time(&rawtime);
  info = localtime(&rawtime);
  strftime(buffer, 80, "%Y%m%d%H%M%s", info);
}


x86 assembly (clang, -O0):
<get_time_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x50,%esi
lea    0xe9a(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [13 x i8] c"%Y%m%d%H%M%s\00"
define void @get_time_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 80, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [13 x i8] c"%Y%m%d%H%M%s\00"
define void @get_time_string(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 80, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a = 2;
  int *x = &a;
  printf("Contenuto di a: %d \nIndirizzo di a: %p\n\n", a, &a);
  printf("Contenuto di x: %p \nIndirizzo di x: %p\n\n", x, &x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecf(%rip),%rdi
lea    -0x4(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rbx
mov    %rbx,0x8(%rsp)
lea    0xed2(%rip),%rdi
mov    $0x2,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Contenuto di a: %d \0AIndirizzo di a: %p\0A\0A\00"
@.str.1 = [41 x i8] c"Contenuto di x: %p \0AIndirizzo di x: %p\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 2, i32* %1
store i32* %1, i32** %2
%3 = load i32, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3, i32* %1)
%5 = load i32*, i32** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32** %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"Contenuto di a: %d \0AIndirizzo di a: %p\0A\0A\00"
@.str.1 = [41 x i8] c"Contenuto di x: %p \0AIndirizzo di x: %p\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%4 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 2, i32* %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32** %2)
ret i32 0
}
__attribute__((always_patch_for_instrumentation)) int foo() { return 3; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 3
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t, size_t, char *);
int /*<<< orphan*/ stderr;
void fatal(char *msg, size_t lineno, size_t offsetno) {
  fprintf(stderr, "ERROR: line: %lu: offset: %lu: %s\n", lineno, offsetno, msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"ERROR: line: %lu: offset: %lu: %s\0A\00"
define void @fatal(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32, i32* @stderr
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %8, i64 %9, i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"ERROR: line: %lu: offset: %lu: %s\0A\00"
define void @fatal(i8* %0, i64 %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %1, i64 %2, i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ console_startup();
int /*<<< orphan*/ console_title(char *);
int /*<<< orphan*/ startup_layout();
void startup(void) {
  console_startup();
  console_title("Rainbow Forth");
  startup_layout();
}


x86 assembly (clang, -O0):
<startup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <console_startup@plt>
lea    0xebe(%rip),%rdi
call   1030 <console_title@plt>
mov    $0x0,%al
call   1050 <startup_layout@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startup>:
push   %rax
xor    %eax,%eax
call   1040 <console_startup@plt>
lea    0xec1(%rip),%rdi
call   1030 <console_title@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <startup_layout@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Rainbow Forth\00"
define void @startup() {
%1 = call i32 (...) @console_startup()
%2 = call i32 @console_title(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @startup_layout()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Rainbow Forth\00"
define void @startup() {
%1 = tail call i32 (...) @console_startup()
%2 = tail call i32 @console_title(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @startup_layout()
ret void
}
/* Type definitions */
struct generator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ check_free(struct generator *);
extern void close_generator_java(struct generator *g) { check_free(g); }


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

x86 assembly (clang, -O2):
<close_generator_java>:
jmp    1030 <check_free@plt>

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

LLVM IR (-O2):
%struct.generator = type { i32 }
define void @close_generator_java(%struct.generator* %0) {
%2 = tail call i32 @check_free(%struct.generator* %0)
ret void
}
int fun1187() { return 1187; }


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

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

LLVM IR (-O0):
define i32 @fun1187() {
ret i32 1187
}

LLVM IR (-O2):
define i32 @fun1187() {
ret i32 1187
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void Usage() {
  printf("usage: <main.c> -f <filename.sml> \n");
  exit(1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"usage: <main.c> -f <filename.sml> \0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [35 x i8] c"usage: <main.c> -f <filename.sml> \00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void XkbResizeKeyType() {}


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

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

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

LLVM IR (-O2):
define void @XkbResizeKeyType() {
ret void
}
int scamper_dl_open(const int ifindex) {
  int fd;
  if ((fd = scamper_privsep_open_datalink(ifindex)) == -1) {
    scamper_debug(__func__, "could not open ifindex %d", ifindex);
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<scamper_dl_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <scamper_privsep_open_datalink@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1165 <scamper_dl_open+0x45>
mov    -0x8(%rbp),%edx
lea    0xeb5(%rip),%rdi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1040 <scamper_debug@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <scamper_dl_open+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scamper_dl_open>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <scamper_privsep_open_datalink@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    114a <scamper_dl_open+0x2a>
lea    0xec6(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <scamper_debug@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__func__.scamper_dl_open = [16 x i8] c"scamper_dl_open\00"
@.str = [26 x i8] c"could not open ifindex %d\00"
define i32 @scamper_dl_open(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @scamper_privsep_open_datalink to i32 (i32, ...)*)(i32 %5)
store i32 %6, i32* %4
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @scamper_debug to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.scamper_dl_open, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 -1, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@__func__.scamper_dl_open = [16 x i8] c"scamper_dl_open\00"
@.str = [26 x i8] c"could not open ifindex %d\00"
define i32 @scamper_dl_open(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @scamper_privsep_open_datalink to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @scamper_debug to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.scamper_dl_open, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %4
ret i32 %2
}
void call2e(int i, float f2, long l, double d2, char c, float f1, short s,
            double d1) {
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2e>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %dl,%cl
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %cl,-0x19(%rbp)
movss  %xmm2,-0x20(%rbp)
mov    %ax,-0x22(%rbp)
movsd  %xmm3,-0x30(%rbp)
movb   $0x61,-0x19(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movw   $0x5,-0x22(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x6,-0x4(%rbp)
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movq   $0x7,-0x10(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call2e(i32 %0, float %1, i64 %2, double %3, i8 signext %4, float %5, i16 signext %6, double %7) {
%9 = alloca i32
%10 = alloca float
%11 = alloca i64
%12 = alloca double
%13 = alloca i8
%14 = alloca float
%15 = alloca i16
%16 = alloca double
store i32 %0, i32* %9
store float %1, float* %10
store i64 %2, i64* %11
store double %3, double* %12
store i8 %4, i8* %13
store float %5, float* %14
store i16 %6, i16* %15
store double %7, double* %16
store i8 97, i8* %13
store float 0.000000e+00, float* %14
store i16 5, i16* %15
store double 0.000000e+00, double* %16
store i32 6, i32* %9
store float 0x3FB99999A0000000, float* %10
store i64 7, i64* %11
store double 2.000000e-01, double* %12
ret void
}

LLVM IR (-O2):
define void @call2e(i32 %0, float %1, i64 %2, double %3, i8 signext %4, float %5, i16 signext %6, double %7) {
ret void
}
int eb_d1b_to_int(unsigned char src, int *tgt) {
  if ((src & 0x80) == 0x80) {
    *tgt = (int)(-(((unsigned char)(~src)) + 1));
    if (*tgt == -0x80)
      return 0;
    else
      return -1;
  } else {
    *tgt = (int)(src);
    return 1;
  }
}


x86 assembly (clang, -O0):
<eb_d1b_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    115e <eb_d1b_to_int+0x5e>
movzbl -0x5(%rbp),%eax
xor    $0xffffffff,%eax
movzbl %al,%eax
add    $0x1,%eax
xor    %ecx,%ecx
sub    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0xffffff80,(%rax)
jne    1152 <eb_d1b_to_int+0x52>
movl   $0x0,-0x4(%rbp)
jmp    116f <eb_d1b_to_int+0x6f>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <eb_d1b_to_int+0x6f>
movzbl -0x5(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb_d1b_to_int>:
test   $0x80,%dil
jne    110e <eb_d1b_to_int+0xe>
mov    %edi,(%rsi)
mov    $0x1,%eax
ret
or     $0xffffff00,%edi
mov    %edi,(%rsi)
xor    %eax,%eax
cmp    $0xffffff80,%edi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @eb_d1b_to_int(i8 zeroext %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32*
store i8 %0, i8* %4
store i32* %1, i32** %5
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = and i32 %7, 128
%9 = icmp eq i32 %8, 128
br i1 %9, label %10, label %24
10: ; preds = %2
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
%15 = zext i8 %14 to i32
%16 = add nsw i32 %15, 1
%17 = sub nsw i32 0, %16
%18 = load i32*, i32** %5
store i32 %17, i32* %18
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, -128
br i1 %21, label %22, label %23
22: ; preds = %10
store i32 0, i32* %3
br label %28
23: ; preds = %10
store i32 -1, i32* %3
br label %28
24: ; preds = %2
%25 = load i8, i8* %4
%26 = zext i8 %25 to i32
%27 = load i32*, i32** %5
store i32 %26, i32* %27
store i32 1, i32* %3
br label %28
28: ; preds = %24, %23, %22
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @eb_d1b_to_int(i8 zeroext %0, i32* nocapture writeonly %1) {
%3 = zext i8 %0 to i32
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = or i32 %3, -256
store i32 %7, i32* %1
%8 = icmp ne i32 %7, -128
%9 = sext i1 %8 to i32
br label %11
10: ; preds = %2
store i32 %3, i32* %1
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ 1, %10 ], [ %9, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned int, size_t);
int sdu_send_opportunity(void *arg, unsigned time_in_ms, void *buffer,
                         size_t size) {
  printf("%s[ms=%04d]: %zd byte send opportunity\n", (char *)arg,
         time_in_ms % 10000, size);
  return -1;
}


x86 assembly (clang, -O0):
<sdu_send_opportunity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x20(%rbp),%rcx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdu_send_opportunity>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %edx,%eax
mov    $0xd1b71759,%edi
imul   %rax,%rdi
shr    $0x2d,%rdi
imul   $0x2710,%edi,%eax
sub    %eax,%edx
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"%s[ms=%04d]: %zd byte send opportunity\0A\00"
define i32 @sdu_send_opportunity(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = urem i32 %10, 10000
%12 = load i64, i64* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11, i64 %12)
ret i32 -1
}

LLVM IR (-O2):
@.str = [40 x i8] c"%s[ms=%04d]: %zd byte send opportunity\0A\00"
define i32 @sdu_send_opportunity(i8* %0, i32 %1, i8* nocapture readnone %2, i64 %3) {
%5 = urem i32 %1, 10000
%6 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %5, i64 %3)
ret i32 -1
}
unsigned int f(unsigned int b, unsigned int c) {
  unsigned int a = (unsigned short)b * (unsigned short)c;
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
mov    -0xc(%rbp),%ecx
movzwl %cx,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1132 <f+0x32>
movl   $0xa,-0x4(%rbp)
jmp    1138 <f+0x38>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movzwl %di,%eax
movzwl %si,%ecx
imul   %eax,%ecx
test   %ecx,%ecx
mov    $0xa,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i16
%9 = zext i16 %8 to i32
%10 = load i32, i32* %5
%11 = trunc i32 %10 to i16
%12 = zext i16 %11 to i32
%13 = mul nsw i32 %9, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %2
store i32 10, i32* %3
br label %19
17: ; preds = %2
%18 = load i32, i32* %6
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %16
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = and i32 %1, 65535
%5 = mul nuw nsw i32 %4, %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 10, i32 %5
ret i32 %7
}
one() { return (1); }


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

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

LLVM IR (-O0):
define i32 @one() {
ret i32 1
}

LLVM IR (-O2):
define i32 @one() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fvec_mul_by(float *, long, int);
void fvec_div_by(float *v, long n, double scal) {
  fvec_mul_by(v, n, 1. / scal);
}


x86 assembly (clang, -O0):
<fvec_div_by>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  0xecb(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edx
call   1030 <fvec_mul_by@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvec_div_by>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
jmp    1030 <fvec_mul_by@plt>

LLVM IR (-O0):
define void @fvec_div_by(float* %0, i64 %1, double %2) {
%4 = alloca float*
%5 = alloca i64
%6 = alloca double
store float* %0, float** %4
store i64 %1, i64* %5
store double %2, double* %6
%7 = load float*, float** %4
%8 = load i64, i64* %5
%9 = load double, double* %6
%10 = fdiv double 1.000000e+00, %9
%11 = fptosi double %10 to i32
%12 = call i32 @fvec_mul_by(float* %7, i64 %8, i32 %11)
ret void
}

LLVM IR (-O2):
define void @fvec_div_by(float* %0, i64 %1, double %2) {
%4 = fdiv double 1.000000e+00, %2
%5 = fptosi double %4 to i32
%6 = tail call i32 @fvec_mul_by(float* %0, i64 %1, i32 %5)
ret void
}
/* Variables and functions */
int window_size_seq(char *buf, size_t bufsz) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @window_size_seq(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ bottom;
  scalar_t__ top;
};
typedef TYPE_1__ ERR_STATE;

/* Variables and functions */
TYPE_1__ *ERR_get_state();
void ERR_clear_error(void) {
  ERR_STATE *es;
  es = ERR_get_state();
  es->top = es->bottom = 0;
}


x86 assembly (clang, -O0):
<ERR_clear_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ERR_get_state@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_clear_error>:
push   %rax
xor    %eax,%eax
call   1030 <ERR_get_state@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define void @ERR_clear_error() {
%1 = alloca %struct.TYPE_3__*
%2 = call %struct.TYPE_3__* (...) @ERR_get_state()
store %struct.TYPE_3__* %2, %struct.TYPE_3__** %1
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %1
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 0, i64* %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %1
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 1
store i64 0, i64* %6
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i64 }
define void @ERR_clear_error() {
%1 = tail call %struct.TYPE_3__* (...) @ERR_get_state()
%2 = bitcast %struct.TYPE_3__* %1 to i8*
ret void
}
/* Variables and functions */
void *fail_on_null(int /*<<< orphan*/);
int /*<<< orphan*/ zalloc(size_t);
void *xzalloc(size_t s) { return fail_on_null(zalloc(s)); }


x86 assembly (clang, -O0):
<xzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <zalloc@plt>
mov    %eax,%edi
call   1040 <fail_on_null@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xzalloc>:
push   %rax
call   1030 <zalloc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <fail_on_null@plt>

LLVM IR (-O0):
define i8* @xzalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @zalloc(i64 %3)
%5 = call i8* @fail_on_null(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @xzalloc(i64 %0) {
%2 = tail call i32 @zalloc(i64 %0)
%3 = tail call i8* @fail_on_null(i32 %2)
ret i8* %3
}
/* Variables and functions */
unsigned long kvm_arch_para_features();
int kvm_para_has_feature(unsigned int feature) {
  return !!(kvm_arch_para_features() & (1UL << feature));
}


x86 assembly (clang, -O0):
<kvm_para_has_feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <kvm_arch_para_features@plt>
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_para_has_feature>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <kvm_arch_para_features@plt>
xor    %ecx,%ecx
bt     %rbx,%rax
setb   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @kvm_para_has_feature(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @kvm_arch_para_features()
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = shl i64 1, %5
%7 = and i64 %3, %6
%8 = icmp ne i64 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @kvm_para_has_feature(i32 %0) {
%2 = tail call i64 (...) @kvm_arch_para_features()
%3 = zext i32 %0 to i64
%4 = shl nuw i64 1, %3
%5 = and i64 %2, %4
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int cmd_exit() {
  fwrite("Shutdown...\n", sizeof(char), 12, stdout);
  return 1;
}


x86 assembly (clang, -O0):
<cmd_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
lea    0xedc(%rip),%rdi
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fwrite@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_exit>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
lea    0xedf(%rip),%rdi
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fwrite@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Shutdown...\0A\00"
@stdout = global i32 0
define i32 @cmd_exit() {
%1 = load i32, i32* @stdout
%2 = call i32 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1, i32 12, i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"Shutdown...\0A\00"
@stdout = global i32 0
define i32 @cmd_exit() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1, i32 12, i32 %1)
ret i32 1
}