xunge/DecIR huggingface dataset:
int tc2_nop(struct tcds *t, struct event *e) { return (1); }


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

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

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

LLVM IR (-O2):
%struct.tcds = type opaque
%struct.event = type opaque
define i32 @tc2_nop(%struct.tcds* nocapture readnone %0, %struct.event* nocapture readnone %1) {
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int first_keycode;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmapping_first_keycode(void *_p, int _v) {
  ((XEvent *)_p)->xmapping.first_keycode = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xmapping_first_keycode>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xmapping_first_keycode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void foo068() {}


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

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

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

LLVM IR (-O2):
define void @foo068() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int a;
  printf("input the data\n");
  scanf("%d ", &a);
  printf("%d", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"input the data\0A\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [15 x i8] c"input the data\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
struct oringe {
  int dummy;
};

/* Variables and functions */
scalar_t__ error();
int /*<<< orphan*/ free_object(int, short *);
void free_oringe(struct oringe *rng) {
  free_object(50, (short *)rng);
  if (error())
    return;
}


x86 assembly (clang, -O0):
<free_oringe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x32,%edi
call   1030 <free_object@plt>
mov    $0x0,%al
call   1040 <error@plt>
cmp    $0x0,%rax
je     1150 <free_oringe+0x30>
jmp    1150 <free_oringe+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_oringe>:
push   %rax
mov    %rdi,%rsi
mov    $0x32,%edi
call   1030 <free_object@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <error@plt>

LLVM IR (-O0):
%struct.oringe = type { i32 }
define void @free_oringe(%struct.oringe* %0) {
%2 = alloca %struct.oringe*
store %struct.oringe* %0, %struct.oringe** %2
%3 = load %struct.oringe*, %struct.oringe** %2
%4 = bitcast %struct.oringe* %3 to i16*
%5 = call i32 @free_object(i32 50, i16* %4)
%6 = call i64 (...) @error()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.oringe = type { i32 }
define void @free_oringe(%struct.oringe* %0) {
%2 = bitcast %struct.oringe* %0 to i16*
%3 = tail call i32 @free_object(i32 50, i16* %2)
%4 = tail call i64 (...) @error()
ret void
}
void early_ioremap_init(void) {}


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

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

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

LLVM IR (-O2):
define void @early_ioremap_init() {
ret void
}
/* Variables and functions */
#define GLUT_KEY_DOWN 131
#define GLUT_KEY_LEFT 130
#define GLUT_KEY_RIGHT 129
#define GLUT_KEY_UP 128
void parsekey_special(int key, int x, int y) {
  switch (key) {
  case GLUT_KEY_UP:
    break;
  case GLUT_KEY_DOWN:
    break;
  case GLUT_KEY_RIGHT:
    break;
  case GLUT_KEY_LEFT:
    break;
  }
}


x86 assembly (clang, -O0):
<parsekey_special>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     114a <parsekey_special+0x4a>
mov    -0x18(%rbp),%rax
lea    0xed3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    114a <parsekey_special+0x4a>
jmp    114a <parsekey_special+0x4a>
jmp    114a <parsekey_special+0x4a>
jmp    114a <parsekey_special+0x4a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @parsekey_special(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %12 [
i32 128, label %8
i32 131, label %9
i32 129, label %10
i32 130, label %11
]
8: ; preds = %3
br label %12
9: ; preds = %3
br label %12
10: ; preds = %3
br label %12
11: ; preds = %3
br label %12
12: ; preds = %3, %11, %10, %9, %8
ret void
}

LLVM IR (-O2):
define void @parsekey_special(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _euc2shift(unsigned char *, unsigned char *);
char *_replace_buffer(unsigned char *);
unsigned char *_set_buffer(char *);
char *toStringSJIS(char *str) {
  unsigned char *buf;
  buf = _set_buffer(str);
  _euc2shift((unsigned char *)str, buf);
  return _replace_buffer(buf);
}


x86 assembly (clang, -O0):
<toStringSJIS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <_set_buffer@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_euc2shift@plt>
mov    -0x10(%rbp),%rdi
call   1040 <_replace_buffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toStringSJIS>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <_set_buffer@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <_euc2shift@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_replace_buffer@plt>

LLVM IR (-O0):
define i8* @toStringSJIS(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @_set_buffer(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @_euc2shift(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i8* @_replace_buffer(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @toStringSJIS(i8* %0) {
%2 = tail call i8* @_set_buffer(i8* %0)
%3 = tail call i32 @_euc2shift(i8* %0, i8* %2)
%4 = tail call i8* @_replace_buffer(i8* %2)
ret i8* %4
}
/* Variables and functions */
int voCore_gpioSetValueByIndex(int, int /*<<< orphan*/);
int DesactiverRelai(int index) { return voCore_gpioSetValueByIndex(index, 0); }


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

x86 assembly (clang, -O2):
<DesactiverRelai>:
xor    %esi,%esi
jmp    1030 <voCore_gpioSetValueByIndex@plt>

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

LLVM IR (-O2):
define i32 @DesactiverRelai(i32 %0) {
%2 = tail call i32 @voCore_gpioSetValueByIndex(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
decrc() { esc("8"); }


x86 assembly (clang, -O0):
<decrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <esc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"8\00"
define i32 @decrc() {
%1 = alloca i32
%2 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [2 x i8] c"8\00"
define i32 @decrc() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ malloc(int);
int /*<<< orphan*/ stdin;
size_t strcspn(char *, char *);
char *__readStringToPointer(int stringLength) {
  char *value = (char *)malloc(stringLength * sizeof(char));
  fgets(value, stringLength, stdin);
  value[strcspn(value, "\n")] = '\0';
  __fpurge(stdin);
  return value;
}


x86 assembly (clang, -O0):
<__readStringToPointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
call   1050 <fgets@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe7a(%rip),%rsi
call   1040 <strcspn@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readStringToPointer>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    0x2e93(%rip),%r14
mov    (%r14),%edx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <fgets@plt>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
mov    (%r14),%edi
call   1030 <__fpurge@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [2 x i8] c"\0A\00"
define i8* @__readStringToPointer(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i32, i32* %2
%12 = load i32, i32* @stdin
%13 = call i32 @fgets(i8* %10, i32 %11, i32 %12)
%14 = load i8*, i8** %3
%15 = load i8*, i8** %3
%16 = call i64 @strcspn(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
%18 = load i32, i32* @stdin
%19 = call i32 @__fpurge(i32 %18)
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [2 x i8] c"\0A\00"
define i8* @__readStringToPointer(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = load i32, i32* @stdin
%5 = tail call i32 @fgets(i8* %3, i32 %0, i32 %4)
%6 = tail call i64 @strcspn(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds i8, i8* %3, i64 %6
store i8 0, i8* %7
%8 = load i32, i32* @stdin
%9 = tail call i32 @__fpurge(i32 %8)
ret i8* %3
}
void x11_vm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @x11_vm_init() {
ret void
}
void free_argv(char **argv, int argc) {
  int i;
  for (i = 0; i < argc; ++i) {
    free(argv[i]);
  }
  free(argv);
}


x86 assembly (clang, -O0):
<free_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_argv+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_argv+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_argv>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_argv+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_argv+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_argv(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *ec_malloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL)
    fatal("in ec_malloc() on memory allocation");
  return ptr;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"in ec_malloc() on memory allocation\00"
define i8* @ec_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [36 x i8] c"in ec_malloc() on memory allocation\00"
define noalias i8* @ec_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int my_f() {
  unsigned int local;
  return 2;
}


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

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

LLVM IR (-O0):
define i32 @my_f() {
%1 = alloca i32
ret i32 2
}

LLVM IR (-O2):
define i32 @my_f() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ LCDPosition(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ LCDWrite(int, unsigned char);
unsigned char screenBuffer(size_t);
void PresentBuffer(void) {
  size_t idx = 0;
  unsigned char val = 0;
  LCDPosition(0, 0);
  for (idx = 0; idx < 84 * (48 / 8); ++idx) {
    val = screenBuffer(idx);
    LCDWrite(1, val);
  }
}


x86 assembly (clang, -O0):
<PresentBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <LCDPosition@plt>
movq   $0x0,-0x8(%rbp)
cmpq   $0x1f8,-0x8(%rbp)
jae    118e <PresentBuffer+0x5e>
mov    -0x8(%rbp),%rdi
call   1050 <screenBuffer@plt>
mov    %al,-0x9(%rbp)
mov    $0x1,%edi
movzbl -0x9(%rbp),%esi
call   1030 <LCDWrite@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <PresentBuffer+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PresentBuffer>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <LCDPosition@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <screenBuffer@plt>
movzbl %al,%esi
mov    $0x1,%edi
call   1030 <LCDWrite@plt>
add    $0x1,%rbx
cmp    $0x1f8,%rbx
jne    1140 <PresentBuffer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @PresentBuffer() {
%1 = alloca i64
%2 = alloca i8
store i64 0, i64* %1
store i8 0, i8* %2
%3 = call i32 @LCDPosition(i32 0, i32 0)
store i64 0, i64* %1
br label %4
4: ; preds = %12, %0
%5 = load i64, i64* %1
%6 = icmp ult i64 %5, 504
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i64, i64* %1
%9 = call zeroext i8 @screenBuffer(i64 %8)
store i8 %9, i8* %2
%10 = load i8, i8* %2
%11 = call i32 @LCDWrite(i32 1, i8 zeroext %10)
br label %12
12: ; preds = %7
%13 = load i64, i64* %1
%14 = add i64 %13, 1
store i64 %14, i64* %1
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @PresentBuffer() {
%1 = tail call i32 @LCDPosition(i32 0, i32 0)
br label %2
2: ; preds = %0, %2
%3 = phi i64 [ 0, %0 ], [ %6, %2 ]
%4 = tail call zeroext i8 @screenBuffer(i64 %3)
%5 = tail call i32 @LCDWrite(i32 1, i8 zeroext %4)
%6 = add nuw nsw i64 %3, 1
%7 = icmp eq i64 %6, 504
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
int init_log(const char *path, const char *mode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_log(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int __sync_blockdev(struct block_device *bdev, int wait) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.block_device = type opaque
define i32 @__sync_blockdev(%struct.block_device* nocapture readnone %0, i32 %1) {
ret i32 0
}
void gtk_spin_button_set_update_policy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_spin_button_set_update_policy() {
ret void
}
int op_eq(int a, int b) { return a == b; }


x86 assembly (clang, -O0):
<op_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_eq>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @op_eq(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ tv;
typedef int /*<<< orphan*/ time_t;
struct timeval {
  scalar_t__ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int, char *, int);
void setTimeout(int sock, time_t timeout, int opt) {
  struct timeval tv;
  tv.tv_sec = timeout;
  tv.tv_usec = 0;
  setsockopt(sock, SOL_SOCKET, opt, (char *)&tv, sizeof(tv));
}


x86 assembly (clang, -O0):
<setTimeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    -0x20(%rbp),%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setTimeout>:
sub    $0x18,%rsp
mov    %esi,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
@SOL_SOCKET = global i32 0
define void @setTimeout(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.timeval
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
store i32 %8, i32* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i64 0, i64* %10
%11 = load i32, i32* %4
%12 = load i32, i32* @SOL_SOCKET
%13 = load i32, i32* %6
%14 = bitcast %struct.timeval* %7 to i8*
%15 = call i32 @setsockopt(i32 %11, i32 %12, i32 %13, i8* %14, i32 16)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
@SOL_SOCKET = global i32 0
define void @setTimeout(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %4 to i8*
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
store i64 0, i64* %7
%8 = load i32, i32* @SOL_SOCKET
%9 = call i32 @setsockopt(i32 %0, i32 %8, i32 %2, i8* %5, i32 16)
ret void
}
unsigned xrop3_112_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_112_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_112_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %edi
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_112_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_112_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = xor i32 %3, -1
%7 = and i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handleListRequest() { printf("Function unimplemented!\n"); }


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"Function unimplemented!\00"
define void @handleListRequest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void g3_cb(void *arg) { puts("GPIO_3 triggered"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"GPIO_3 triggered\00"
define void @g3_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"GPIO_3 triggered\00"
define void @g3_cb(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_qpel_hv24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_hv24_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _resetStream(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void reset() { _resetStream(stdout); }


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <_resetStream@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_resetStream@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @reset() {
%1 = load i32, i32* @stdout
%2 = call i32 @_resetStream(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @reset() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @_resetStream(i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ uint16_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
uint16_t __hsail_sat_sub_u16(uint16_t a, uint16_t b) {
  int32_t c = (uint32_t)a - (uint32_t)b;
  if (c < 0)
    return 0;
  else
    return c;
}


x86 assembly (clang, -O0):
<__hsail_sat_sub_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1130 <__hsail_sat_sub_u16+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1138 <__hsail_sat_sub_u16+0x38>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_sat_sub_u16>:
xor    %eax,%eax
sub    %rsi,%rdi
cmovns %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @__hsail_sat_sub_u16(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = icmp sgt i64 %3, 0
%5 = select i1 %4, i64 %3, i64 0
ret i64 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank4(int);
void m65setParamsB004(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank4(val << 10);
}


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

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

LLVM IR (-O0):
define void @m65setParamsB004(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 10
%8 = call i32 @chr1setBank4(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m65setParamsB004(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank4(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Hello Wolrd!!\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello Wolrd!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void uDMAChannel0_7SelectDefault(unsigned long ulDefPeriphs) {
  (*((volatile unsigned long *)(0x400FF510))) &= ~ulDefPeriphs;
}


x86 assembly (clang, -O0):
<uDMAChannel0_7SelectDefault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400ff510,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400ff510,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannel0_7SelectDefault>:
not    %rdi
and    %rdi,0x400ff510
40
ret

LLVM IR (-O0):
define void @uDMAChannel0_7SelectDefault(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074787600 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074787600 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannel0_7SelectDefault(i64 %0) {
%2 = xor i64 %0, -1
%3 = load volatile i64, i64* inttoptr (i64 1074787600 to i64*)
%4 = and i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 1074787600 to i64*)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *strptime(const char *s, const char *f, struct tm *tm) { return NULL; }


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

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

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define noalias i8* @strptime(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.tm* nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
char *strdup(char *);
int /*<<< orphan*/ sysfatal(char *, char *);
char *estrdup(char *p) {
  p = strdup(p);
  if (p == 0)
    sysfatal("strdup(%.20s) fails", p);
  return p;
}


x86 assembly (clang, -O0):
<estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1154 <estrdup+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <sysfatal@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <estrdup+0x1c>
lea    0xecb(%rip),%rdi
xor    %esi,%esi
call   1030 <sysfatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"strdup(%.20s) fails\00"
define i8* @estrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strdup(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @sysfatal(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [20 x i8] c"strdup(%.20s) fails\00"
define noalias i8* @estrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @sysfatal(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* null)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  while (1) {
    int x = __VERIFIER_nondet_int();
    if (x == 0) {
      __VERIFIER_assert(x == 0);
    } else {
      __VERIFIER_assert(x != 0);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1159 <main+0x39>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    116a <main+0x4a>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %17
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @__VERIFIER_assert(i32 %10)
br label %17
12: ; preds = %3
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @__VERIFIER_assert(i32 %15)
br label %17
17: ; preds = %12, %7
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @__VERIFIER_assert(i32 1)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ newline;

/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
int puts(const char *str) {
  int fd = 1;
  const char *p;
  char newline = '\n';
  for (p = str; *p != '\0'; p++)
    write(fd, p, sizeof(*p));
  write(fd, &newline, sizeof(newline));
  return (42);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movb   $0xa,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1161 <puts+0x51>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112f <puts+0x1f>
mov    -0xc(%rbp),%edi
lea    -0x19(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x2a,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
sub    $0x10,%rsp
movb   $0xa,0xf(%rsp)
cmpb   $0x0,(%rdi)
je     114c <puts+0x3c>
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1130 <puts+0x20>
lea    0xf(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x2a,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = alloca i8
store i8 10, i8* %2
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %8, %5 ], [ %0, %1 ]
%7 = tail call i32 @write(i32 1, i8* %6, i32 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 %5
11: ; preds = %5, %1
%12 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 42
}
extern unsigned char _sbus_readb(unsigned long addr) {
  return *(volatile unsigned char *)addr;
}


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

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

LLVM IR (-O0):
define zeroext i8 @_sbus_readb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
%5 = load volatile i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @_sbus_readb(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = load volatile i8, i8* %2
ret i8 %3
}
double fx(double A, double B, double C, double x) { return -(A * x + C) / B; }


x86 assembly (clang, -O0):
<fx>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fx>:
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
xorpd  0xef0(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fx(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = load double, double* %7
%12 = call double @llvm.fmuladd.f64(double %9, double %10, double %11)
%13 = fneg double %12
%14 = load double, double* %6
%15 = fdiv double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @fx(double %0, double %1, double %2, double %3) {
%5 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %2)
%6 = fneg double %5
%7 = fdiv double %6, %1
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA2D_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @DMA2D_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  int length = 0;
  while (*s != '\0') {
    s++;
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlen+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @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 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
ret i64 %16
}

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = zext i32 %8 to i64
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 0, %1 ], [ %12, %11 ]
ret i64 %14
}
int is_prime(int num) {
  int i, res;
  if (num <= 1) {
    return -1;
  }
  i = num;
  i--;
  while (i != 1) {
    res = num % i;
    if (res == 0) {
      return 0;
    }
    i--;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     111d <is_prime+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <is_prime+0x6b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1164 <is_prime+0x64>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1156 <is_prime+0x56>
movl   $0x0,-0x4(%rbp)
jmp    116b <is_prime+0x6b>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <is_prime+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jl     1123 <is_prime+0x23>
lea    -0x1(%rdi),%ecx
nopl   (%rax)
cmp    $0x1,%ecx
je     1124 <is_prime+0x24>
mov    %edi,%eax
cltd
idiv   %ecx
add    $0xffffffff,%ecx
test   %edx,%edx
jne    1110 <is_prime+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %10, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %5, %7 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = icmp eq i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = srem i32 %0, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %7, %1
%11 = phi i32 [ -1, %1 ], [ 1, %3 ], [ 0, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int chown(const char *path, uid_t owner, gid_t grp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @chown(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}