xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_up_problem();
int /*<<< orphan*/ this_looks_bad(char *);
int main(int argc, char **argv) {
  set_up_problem();
  if (argc != 2) {
    printf("Correct Usage: ./overlow1 (string)\n");
    return 1;
  }
  this_looks_bad(argv[1]);
  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)
mov    $0x0,%al
call   1030 <set_up_problem@plt>
cmpl   $0x2,-0x8(%rbp)
je     116f <main+0x3f>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1183 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <this_looks_bad@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <set_up_problem@plt>
cmp    $0x2,%ebp
jne    1152 <main+0x22>
mov    0x8(%r14),%rdi
call   1050 <this_looks_bad@plt>
jmp    1163 <main+0x33>
lea    0xea7(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Correct Usage: ./overlow1 (string)\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 (...) @set_up_problem()
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @this_looks_bad(i8* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [35 x i8] c"Correct Usage: ./overlow1 (string)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @set_up_problem()
%4 = icmp eq i32 %0, 2
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @this_looks_bad(i8* %9)
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p434_msat(uintptr_t);
void fiat_p434_msat(uint64_t out1[8]) {
  internal_fiat_p434_msat((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p434_msat>:
jmp    1030 <internal_fiat_p434_msat@plt>

LLVM IR (-O0):
define void @fiat_p434_msat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p434_msat(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p434_msat(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p434_msat(i64 %2)
ret void
}
int try_inc_mod_count(struct module *mod) { return 1; }


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

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

LLVM IR (-O0):
%struct.module = type opaque
define i32 @try_inc_mod_count(%struct.module* %0) {
%2 = alloca %struct.module*
store %struct.module* %0, %struct.module** %2
ret i32 1
}

LLVM IR (-O2):
%struct.module = type opaque
define i32 @try_inc_mod_count(%struct.module* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ trace_printk(char *, unsigned int, unsigned int,
                                unsigned int, unsigned int);
void ms_dramc(unsigned long long timestamp, unsigned char cnt,
              unsigned int *value) {
  switch (cnt) {
  case 4:
    trace_printk("%x,%x,%x,%x\n", value[0], value[1], value[2], value[3]);
    break;
  }
}


x86 assembly (clang, -O0):
<ms_dramc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x9(%rbp),%al
sub    $0x4,%al
jne    115e <ms_dramc+0x4e>
jmp    1136 <ms_dramc+0x26>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%r8d
lea    0xea7(%rip),%rdi
call   1030 <trace_printk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_dramc>:
cmp    $0x4,%sil
jne    1130 <ms_dramc+0x20>
mov    (%rdx),%esi
mov    0x4(%rdx),%eax
mov    0x8(%rdx),%ecx
mov    0xc(%rdx),%r8d
lea    0xed7(%rip),%rdi
mov    %eax,%edx
jmp    1030 <trace_printk@plt>
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%x,%x,%x,%x\0A\00"
define void @ms_dramc(i64 %0, i8 zeroext %1, i32* %2) {
%4 = alloca i64
%5 = alloca i8
%6 = alloca i32*
store i64 %0, i64* %4
store i8 %1, i8* %5
store i32* %2, i32** %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
switch i32 %8, label %23 [
i32 4, label %9
]
9: ; preds = %3
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = call i32 @trace_printk(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15, i32 %18, i32 %21)
br label %23
23: ; preds = %3, %9
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%x,%x,%x,%x\0A\00"
define void @ms_dramc(i64 %0, i8 zeroext %1, i32* nocapture %2) {
%4 = icmp eq i8 %1, 4
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds i32, i32* %2, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %2, i64 2
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %2, i64 3
%12 = load i32, i32* %11
%13 = tail call i32 @trace_printk(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i32 %10, i32 %12)
br label %14
14: ; preds = %3, %5
ret void
}
int FSM_exit() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @FSM_exit() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t romsafe(uint32_t addr) { return addr & 0x10000 - 1; }


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

x86 assembly (clang, -O2):
<romsafe>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @romsafe(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
double fmax(double x, double y) {
  if (x > y)
    return (x);
  return (y);
}


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <fmax+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <fmax+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *keepTryingToOpen(char const *, char const *, int);
FILE *openOrDie(const char *path, const char *mode) {
  return keepTryingToOpen(path, mode, 1);
}


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

x86 assembly (clang, -O2):
<openOrDie>:
mov    $0x1,%edx
jmp    1030 <keepTryingToOpen@plt>

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

LLVM IR (-O2):
define i32* @openOrDie(i8* %0, i8* %1) {
%3 = tail call i32* @keepTryingToOpen(i8* %0, i8* %1, i32 1)
ret i32* %3
}
void notify_tween_thread(void *obj) {}


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

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

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

LLVM IR (-O2):
define void @notify_tween_thread(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *malloc(size_t);
char *strcpy(char *, char const *);
size_t strlen(char const *);
char *dupstr(const char *str) {
  char *dup;
  size_t len;
  if (!str)
    return NULL;
  len = strlen(str);
  dup = malloc(len + 1);
  if (!dup)
    return NULL;
  return strcpy(dup, str);
}


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <dupstr+0x24>
movq   $0x0,-0x8(%rbp)
jmp    119b <dupstr+0x6b>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118a <dupstr+0x5a>
movq   $0x0,-0x8(%rbp)
jmp    119b <dupstr+0x6b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <dupstr+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <dupstr+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <dupstr+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @dupstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i8* @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %3, %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ], [ null, %3 ]
ret i8* %11
}
int wh\U000000ff(void) { return 4; }


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

x86 assembly (clang, -O2):
<whÿ>:
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @"wh\C3\BF"() {
ret i32 4
}

LLVM IR (-O2):
define i32 @"wh\C3\BF"() {
ret i32 4
}
void mdp4_overlay_dtv_vsync_push(struct msm_fb_data_type *mfd,
                                 struct mdp4_overlay_pipe *pipe) {}


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

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

LLVM IR (-O0):
%struct.msm_fb_data_type = type opaque
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_overlay_dtv_vsync_push(%struct.msm_fb_data_type* %0, %struct.mdp4_overlay_pipe* %1) {
%3 = alloca %struct.msm_fb_data_type*
%4 = alloca %struct.mdp4_overlay_pipe*
store %struct.msm_fb_data_type* %0, %struct.msm_fb_data_type** %3
store %struct.mdp4_overlay_pipe* %1, %struct.mdp4_overlay_pipe** %4
ret void
}

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_overlay_dtv_vsync_push(%struct.msm_fb_data_type* nocapture %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetRelativeTime();
void InitTimer() { GetRelativeTime(); }


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

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

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

LLVM IR (-O2):
define void @InitTimer() {
%1 = tail call i32 (...) @GetRelativeTime()
ret void
}
/* Type definitions */
struct _PDCLIB_file_t {
  int dummy;
};

/* Variables and functions */
int fgetc(struct _PDCLIB_file_t *);
int getc(struct _PDCLIB_file_t *stream) { return fgetc(stream); }


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

x86 assembly (clang, -O2):
<getc>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
%struct._PDCLIB_file_t = type { i32 }
define i32 @getc(%struct._PDCLIB_file_t* nocapture %0) {
%2 = tail call i32 @fgetc(%struct._PDCLIB_file_t* %0)
ret i32 %2
}
void wifi_rsp_ethernet_close(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @wifi_rsp_ethernet_close(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 1;
  int result = 0;
  int target = 100;
start:
  if (i <= target) {
    result = result + i;
    i++;
    goto start;
  } else {
    goto end;
  }
end:
  printf("1+%d=%d\n", target, result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x64,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1157 <main+0x47>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
jmp    115c <main+0x4c>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"1+%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 1, i32* %2
store i32 0, i32* %3
store i32 100, i32* %4
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = add nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %5
15: ; preds = %5
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [9 x i8] c"1+%d=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 100, i32 5050)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bugerror(char *);
void badaddress() { bugerror("bad address"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"bad address\00"
define void @badaddress() {
%1 = call i32 @bugerror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"bad address\00"
define void @badaddress() {
%1 = tail call i32 @bugerror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mat4f_translate_new(float *, float const, float const,
                                       float const);
void mat4f_translateVec_new(float result[16], const float xyz[3]) {
  mat4f_translate_new(result, xyz[0], xyz[1], xyz[2]);
}


x86 assembly (clang, -O0):
<mat4f_translateVec_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
call   1030 <mat4f_translate_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4f_translateVec_new>:
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
movss  0x8(%rsi),%xmm2
jmp    1030 <mat4f_translate_new@plt>

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

LLVM IR (-O2):
define void @mat4f_translateVec_new(float* %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 2
%7 = load float, float* %6
%8 = tail call i32 @mat4f_translate_new(float* %0, float %3, float %5, float %7)
ret void
}
unsigned pigpiod_if_version(void) { return 15; }


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

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

LLVM IR (-O0):
define i32 @pigpiod_if_version() {
ret i32 15
}

LLVM IR (-O2):
define i32 @pigpiod_if_version() {
ret i32 15
}
/* Variables and functions */
int wrapper(int, char const *, char *const *, int /*<<< orphan*/ *);
int execv(const char *__path, char *const __argv[]) {
  return wrapper(1, __path, __argv, NULL);
}


x86 assembly (clang, -O0):
<execv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <wrapper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execv>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
xor    %ecx,%ecx
jmp    1030 <wrapper@plt>

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

LLVM IR (-O2):
define i32 @execv(i8* %0, i8** %1) {
%3 = tail call i32 @wrapper(i32 1, i8* %0, i8** %1, i32* null)
ret i32 %3
}
/* Variables and functions */
int strlen(char *s) {
  int n;
  for (n = 0; *s; ++n, ++s)
    ;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113b <strlen+0x3b>
jmp    1121 <strlen+0x21>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void help(char *s) {
  fprintf(stderr,
          "usage:\n\t"
          "%s cloud.ply plyextrema.txt\n",
          s);
}


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

x86 assembly (clang, -O2):
<help>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"usage:\0A\09%s cloud.ply plyextrema.txt\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage:\0A\09%s cloud.ply plyextrema.txt\0A\00"
define void @help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t data_oid_to_idx(uint64_t oid) { return oid & ((1ULL << 32) - 1); }


x86 assembly (clang, -O0):
<data_oid_to_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xffffffff,%rax
and    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_oid_to_idx>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i64 @data_oid_to_idx(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4294967295
ret i64 %4
}

LLVM IR (-O2):
define i64 @data_oid_to_idx(i64 %0) {
%2 = and i64 %0, 4294967295
ret i64 %2
}
void f1(const char *fmt) {
  __builtin_printf("%d\n", 1.2);
  __builtin_printf(fmt, 1.2);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xee5(%rip),%rdi
movsd  0xed5(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
movsd  0xec2(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbx
mov    %rdi,%rbx
lea    0xeed(%rip),%rdi
movsd  0xedd(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  0xecb(%rip),%xmm0
mov    $0x1,%al
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @f1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.200000e+00)
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* %4, double 1.200000e+00)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @f1(i8* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.200000e+00)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, double 1.200000e+00)
ret void
}
int check_prime(int num) {
  int j, r;
  for (j = 2; j < num; j++) {
    r = num % j;
    if (r == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114d <check_prime+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    113a <check_prime+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <check_prime+0x54>
jmp    113f <check_prime+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <check_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, sum;
  sum = 0;
  scanf("%d %d", &a, &b);
  sum = a + b;
  printf("%d\n", sum);
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
size_t ece_aesgcm_plaintext_max_length(size_t ciphertextLen) {
  return ciphertextLen;
}


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

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

LLVM IR (-O0):
define i64 @ece_aesgcm_plaintext_max_length(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @ece_aesgcm_plaintext_max_length(i64 returned %0) {
ret i64 %0
}
void xive_smp_disable_cpu(void) {}


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

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

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

LLVM IR (-O2):
define void @xive_smp_disable_cpu() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_store_ss(void *, int /*<<< orphan*/);
void test_store_ss(__m128 x, void *y) { _mm_store_ss(y, x); }


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

x86 assembly (clang, -O2):
<test_store_ss>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <_mm_store_ss@plt>

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

LLVM IR (-O2):
define void @test_store_ss(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_store_ss(i8* %1, i32 %0)
ret void
}
int foo(unsigned long long int x) {
  return (x & 0xff) | ((unsigned int)(x >> 12) & ~0xff);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    -0x8(%rbp),%rcx
shr    $0xc,%rcx
and    $0xffffff00,%ecx
mov    %ecx,%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movzbl %dil,%eax
shr    $0xc,%rdi
and    $0xffffff00,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 255
%5 = load i64, i64* %2
%6 = lshr i64 %5, 12
%7 = trunc i64 %6 to i32
%8 = and i32 %7, -256
%9 = zext i32 %8 to i64
%10 = or i64 %4, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i64 %0) {
%2 = and i64 %0, 255
%3 = lshr i64 %0, 12
%4 = and i64 %3, 4294967040
%5 = or i64 %4, %2
%6 = trunc i64 %5 to i32
ret i32 %6
}
void tset() { asm volatile("movq $0x1, (%%r11)\n\t" :::); }


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

x86 assembly (clang, -O2):
<tset>:
movq   $0x1,(%r11)
ret

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

LLVM IR (-O2):
define void @tset() {
tail call void asm sideeffect "movq $$0x1, (%r11)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int strcmp(char *const, char *const);
int string_cmp(const void *a, const void *b) {
  return strcmp(*(char *const *)a, *(char *const *)b);
}


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

x86 assembly (clang, -O2):
<string_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @string_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int GetProp(int, int /*<<< orphan*/, int, int /*<<< orphan*/);
char *GetWord(unsigned int);
char *Name(int obj) {
  int p;
  p = GetProp(obj, 0, 1, 0);
  if (p)
    return GetWord((unsigned int)p);
  else
    return 0;
}


x86 assembly (clang, -O0):
<Name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
xor    %ecx,%ecx
mov    $0x1,%edx
mov    %ecx,%esi
call   1040 <GetProp@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115a <Name+0x3a>
mov    -0x10(%rbp),%edi
call   1030 <GetWord@plt>
mov    %rax,-0x8(%rbp)
jmp    1162 <Name+0x42>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Name>:
push   %rax
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <GetProp@plt>
test   %eax,%eax
je     113b <Name+0x1b>
mov    %eax,%edi
pop    %rax
jmp    1030 <GetWord@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @Name(i32 %0) {
%2 = tail call i32 @GetProp(i32 %0, i32 0, i32 1, i32 0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @GetWord(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ Calc();
int main(int argc, char *argv[]) { Calc(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Calc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @Calc()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Calc()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
int interface_close_down(void) {
  refresh();
  endwin();
  return (0);
}


x86 assembly (clang, -O0):
<interface_close_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interface_close_down>:
push   %rax
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @interface_close_down() {
%1 = call i32 (...) @refresh()
%2 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @interface_close_down() {
%1 = tail call i32 (...) @refresh()
%2 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
int show_selection_a(void) {
  printf("%s%c\n", "Select menu item ", 'A');
  return (0);
}


x86 assembly (clang, -O0):
<show_selection_a>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
mov    $0x41,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"%s%c\0A\00"
@.str.1 = [18 x i8] c"Select menu item \00"
define i32 @show_selection_a() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8 signext 65)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s%c\0A\00"
@.str.1 = [18 x i8] c"Select menu item \00"
define i32 @show_selection_a() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8 signext 65)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
void pmu_prep_sar_ratio(void) {
  pmu_reg_write(33, ((1 << 0)));
  pmu_reg_write(7, ((0 << 0)));
  pmu_reg_write(6, ((0 << 0)));
  pmu_reg_write(58, ((0 << 0)));
}


x86 assembly (clang, -O0):
<pmu_prep_sar_ratio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x3a,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_prep_sar_ratio>:
push   %rax
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x3a,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_prep_sar_ratio() {
%1 = call i32 @pmu_reg_write(i32 33, i32 1)
%2 = call i32 @pmu_reg_write(i32 7, i32 0)
%3 = call i32 @pmu_reg_write(i32 6, i32 0)
%4 = call i32 @pmu_reg_write(i32 58, i32 0)
ret void
}

LLVM IR (-O2):
define void @pmu_prep_sar_ratio() {
%1 = tail call i32 @pmu_reg_write(i32 33, i32 1)
%2 = tail call i32 @pmu_reg_write(i32 7, i32 0)
%3 = tail call i32 @pmu_reg_write(i32 6, i32 0)
%4 = tail call i32 @pmu_reg_write(i32 58, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvaddstr(int, int, char *);
void printcolorline(int y, int x, int palette, char *string) {
  palette++;
  attron(COLOR_PAIR(palette));
  mvaddstr(y, x, string);
  attroff(COLOR_PAIR(palette));
}


x86 assembly (clang, -O0):
<printcolorline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1060 <mvaddstr@plt>
mov    -0xc(%rbp),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printcolorline>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %esi,%r15d
mov    %edi,%ebx
lea    0x1(%rdx),%ebp
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   1060 <mvaddstr@plt>
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <attroff@plt>

LLVM IR (-O0):
define void @printcolorline(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %7
%10 = add nsw i32 %9, 1
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @COLOR_PAIR(i32 %11)
%13 = call i32 @attron(i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = load i8*, i8** %8
%17 = call i32 @mvaddstr(i32 %14, i32 %15, i8* %16)
%18 = load i32, i32* %7
%19 = call i32 @COLOR_PAIR(i32 %18)
%20 = call i32 @attroff(i32 %19)
ret void
}

LLVM IR (-O2):
define void @printcolorline(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = add nsw i32 %2, 1
%6 = tail call i32 @COLOR_PAIR(i32 %5)
%7 = tail call i32 @attron(i32 %6)
%8 = tail call i32 @mvaddstr(i32 %0, i32 %1, i8* %3)
%9 = tail call i32 @COLOR_PAIR(i32 %5)
%10 = tail call i32 @attroff(i32 %9)
ret void
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ fabs(double);
double cosh(double x) {
  const double ebig = exp(fabs(x));
  return (ebig + 1.0 / ebig) / 2.0;
}


x86 assembly (clang, -O0):
<cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosh>:
push   %rax
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <exp@plt>
movsd  0xecb(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
mulsd  0xec3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cosh(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @fabs(double %4)
%6 = call double @exp(i32 %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fdiv double 1.000000e+00, %8
%10 = fadd double %7, %9
%11 = fdiv double %10, 2.000000e+00
ret double %11
}

LLVM IR (-O2):
define double @cosh(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = tail call double @exp(i32 %2)
%4 = fdiv double 1.000000e+00, %3
%5 = fadd double %3, %4
%6 = fmul double %5, 5.000000e-01
ret double %6
}
int dfaerror_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @dfaerror_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @dfaerror_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SPI_LEDS_EnableRxInt();
int /*<<< orphan*/ SPI_LEDS_EnableTxInt();
void SPI_LEDS_EnableInt(void) {
  SPI_LEDS_EnableRxInt();
  SPI_LEDS_EnableTxInt();
}


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

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

LLVM IR (-O0):
define void @SPI_LEDS_EnableInt() {
%1 = call i32 (...) @SPI_LEDS_EnableRxInt()
%2 = call i32 (...) @SPI_LEDS_EnableTxInt()
ret void
}

LLVM IR (-O2):
define void @SPI_LEDS_EnableInt() {
%1 = tail call i32 (...) @SPI_LEDS_EnableRxInt()
%2 = tail call i32 (...) @SPI_LEDS_EnableTxInt()
ret void
}
int test_logicalOr(int x, int y) { return x || y; }


x86 assembly (clang, -O0):
<test_logicalOr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <test_logicalOr+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_logicalOr>:
xor    %eax,%eax
or     %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test_logicalOr(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_logicalOr(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *message();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", message());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <message@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @message()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
void vmxoff(void) { __asm__ __volatile__("vmxoff"); }


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

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

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

LLVM IR (-O2):
define void @vmxoff() {
tail call void asm sideeffect "vmxoff", "~{dirflag},~{fpsr},~{flags}"()
ret void
}