xunge/DecIR huggingface dataset:
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int ask_user(void) {
  char c;
  while (getchar() != '\n')
    ;
  printf("Do you wish to perform another query? [y/n]:  ");
  scanf("%c", &c);
  if (c == 'y')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<ask_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1150 <ask_user+0x20>
jmp    1138 <ask_user+0x8>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x79,%eax
jne    1185 <ask_user+0x55>
movl   $0x1,-0x4(%rbp)
jmp    118c <ask_user+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_user>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1140 <ask_user+0x10>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpb   $0x79,0x7(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Do you wish to perform another query? [y/n]: \00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @ask_user() {
%1 = alloca i32
%2 = alloca i8
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 121
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 1, i32* %1
br label %16
15: ; preds = %8
store i32 0, i32* %1
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [47 x i8] c"Do you wish to perform another query? [y/n]: \00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @ask_user() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = load i8, i8* %1
%9 = icmp eq i8 %8, 121
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sysmips(int, int *, int *, int /*<<< orphan*/);
extern long int testandset(int *spinlock) {
  int ret;
  sysmips(2001, spinlock, &ret, 0);
  return ret;
}


x86 assembly (clang, -O0):
<testandset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x7d1,%edi
lea    -0xc(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <sysmips@plt>
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testandset>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdx
mov    $0x7d1,%edi
xor    %ecx,%ecx
call   1030 <sysmips@plt>
movslq 0x4(%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @testandset(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @sysmips(i32 2001, i32* %4, i32* %3, i32 0)
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @testandset(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sysmips(i32 2001, i32* %0, i32* %2, i32 0)
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getenv(char *);
int /*<<< orphan*/ stderr;
const char *pango_get_sysconf_subdirectory(void) {
  char *d;
  d = getenv("PANGO_SYSCONF_DIR");
  if (!d)
    d = "/etc/pango32";
  fprintf(stderr, "Pangohack: using sysconf dir %s\n", d);
  return d;
}


x86 assembly (clang, -O0):
<pango_get_sysconf_subdirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114e <pango_get_sysconf_subdirectory+0x2e>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pango_get_sysconf_subdirectory>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
lea    0xed8(%rip),%rax
cmove  %rax,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"PANGO_SYSCONF_DIR\00"
@.str.1 = [13 x i8] c"/etc/pango32\00"
@stderr = global i32 0
@.str.2 = [33 x i8] c"Pangohack: using sysconf dir %s\0A\00"
define i8* @pango_get_sysconf_subdirectory() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %0
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [18 x i8] c"PANGO_SYSCONF_DIR\00"
@.str.1 = [13 x i8] c"/etc/pango32\00"
@stderr = global i32 0
@.str.2 = [33 x i8] c"Pangohack: using sysconf dir %s\0A\00"
define i8* @pango_get_sysconf_subdirectory() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i8* %3
}
/* Variables and functions */
unsigned int alarm(unsigned int);
unsigned int csapp_alarm(unsigned int seconds) { return alarm(seconds); }


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

x86 assembly (clang, -O2):
<csapp_alarm>:
jmp    1030 <alarm@plt>

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

LLVM IR (-O2):
define i32 @csapp_alarm(i32 %0) {
%2 = tail call i32 @alarm(i32 %0)
ret i32 %2
}
long shl(long a, int b) { return a << b; }


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

x86 assembly (clang, -O2):
<shl>:
mov    %esi,%ecx
mov    %rdi,%rax
shl    %cl,%rax
ret

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

LLVM IR (-O2):
define i64 @shl(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl i64 %0, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
void *xmalloc(size_t);
void *xcalloc(size_t num, size_t size) {
  void *ptr_new = xmalloc(num * size);
  bzero(ptr_new, num * size);
  return ptr_new;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
call   1040 <bzero@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %rdi,%rbx
mov    %rbx,%rdi
call   1030 <xmalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <bzero@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @xmalloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @bzero(i8* %10, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @bzero(i8* %4, i64 %3)
ret i8* %4
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void sleep_ms(long ms) {
  struct timeval i;
  i.tv_sec = ms / 1000;
  i.tv_usec = (ms % 1000) * 1000;
  select(0, NULL, NULL, NULL, &i);
}


x86 assembly (clang, -O0):
<sleep_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0x3e8,%rdx,%rax
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_ms>:
sub    $0x18,%rsp
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,0x8(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0x3e8,%rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @sleep_ms(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timeval
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = srem i64 %7, 1000
%9 = mul nsw i64 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 %9, i64* %10
%11 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @sleep_ms(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = sdiv i64 %0, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = srem i64 %0, 1000
%7 = mul nsw i64 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void test(int result, char *text) {
  printf("\n%s: ", text);
  if (result) {
    printf("OK\n");
  } else {
    printf("FAIL\n");
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
je     114e <test+0x3e>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115c <test+0x4c>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
lea    0xecc(%rip),%rax
lea    0xeca(%rip),%rdi
cmove  %rax,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\0A%s: \00"
@.str.1 = [4 x i8] c"OK\0A\00"
@.str.2 = [6 x i8] c"FAIL\0A\00"
define void @test(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%s: \00"
@str = [5 x i8] c"FAIL\00"
@str.3 = [3 x i8] c"OK\00"
define void @test(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_CLR_GIO2_PIN();
void HUMIDITY_CLEAR_CLOCK() { TOSH_CLR_GIO2_PIN(); }


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_CLEAR_CLOCK() {
%1 = tail call i32 (...) @TOSH_CLR_GIO2_PIN()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lemon17() { printf("lemon17 likes fear for breakfast. \n"); }


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"lemon17 likes fear for breakfast. \00"
define void @lemon17() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
void gdk_events_pending() {}


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

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

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

LLVM IR (-O2):
define void @gdk_events_pending() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read16(uint8_t *buf) {
  uint32_t v = 0;
  for (int i = 0; i < 2; i++) {
    v <<= 8;
    v |= buf[i];
  }
  return v;
}


x86 assembly (clang, -O0):
<read16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1148 <read16+0x48>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read16+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy_fromio(void *, void *, unsigned int);
void lpfc_memcpy_from_slim(void *dest, void *src, unsigned int bytes) {
  memcpy_fromio(dest, src, bytes);
}


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

x86 assembly (clang, -O2):
<lpfc_memcpy_from_slim>:
jmp    1030 <memcpy_fromio@plt>

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

LLVM IR (-O2):
define void @lpfc_memcpy_from_slim(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy_fromio(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ absolutey();
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc16(int /*<<< orphan*/);
void sbcAbsy16(void) { sbc16(readmemw65816(absolutey())); }


x86 assembly (clang, -O0):
<sbcAbsy16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <absolutey@plt>
mov    %eax,%edi
call   1040 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <sbc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcAbsy16>:
push   %rax
xor    %eax,%eax
call   1030 <absolutey@plt>
mov    %eax,%edi
call   1040 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sbc16@plt>

LLVM IR (-O0):
define void @sbcAbsy16() {
%1 = call i32 (...) @absolutey()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @sbc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcAbsy16() {
%1 = tail call i32 (...) @absolutey()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @sbc16(i32 %2)
ret void
}
/* Variables and functions */
char *_PATH_LASTLOG;
char *lastlog_path(void) { return _PATH_LASTLOG; }


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

x86 assembly (clang, -O2):
<lastlog_path>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@_PATH_LASTLOG = global i8* null
define i8* @lastlog_path() {
%1 = load i8*, i8** @_PATH_LASTLOG
ret i8* %1
}

LLVM IR (-O2):
@_PATH_LASTLOG = global i8* null
define i8* @lastlog_path() {
%1 = load i8*, i8** @_PATH_LASTLOG
ret i8* %1
}
/* Variables and functions */
int itex2MML_do_html_filter(char const *, unsigned long, int);
int itex2MML_strict_html_filter(const char *buffer, unsigned long length) {
  return itex2MML_do_html_filter(buffer, length, 1);
}


x86 assembly (clang, -O0):
<itex2MML_strict_html_filter>:
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 <itex2MML_do_html_filter@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @itex2MML_strict_html_filter(i8* %0, i64 %1) {
%3 = tail call i32 @itex2MML_do_html_filter(i8* %0, i64 %1, i32 1)
ret i32 %3
}
void gtk_im_status_style_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_status_style_get_type() {
ret void
}
/* Variables and functions */
void *memset(void *, int /*<<< orphan*/, size_t);
void *proxy_aligned_alloc(void *, size_t, int, char const *, unsigned int);
void *proxy_calloc(void *data, size_t nbelmts, size_t size,
                   const char *filename, unsigned int fileline) {
  size_t allocation_size = nbelmts * size;
  void *mem = proxy_aligned_alloc(data, allocation_size, 8, filename, fileline);
  if (mem)
    mem = memset(mem, 0, allocation_size);
  return mem;
}


x86 assembly (clang, -O0):
<proxy_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    $0x8,%edx
call   1030 <proxy_aligned_alloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     118d <proxy_calloc+0x6d>
mov    -0x38(%rbp),%rdi
mov    %rdi,-0x40(%rbp)
mov    -0x30(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proxy_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %rdx,%rbx
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <proxy_aligned_alloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     114d <proxy_calloc+0x2d>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @proxy_calloc(i8* %0, i64 %1, i64 %2, i8* %3, i32 %4) {
%6 = mul i64 %2, %1
%7 = tail call i8* @proxy_aligned_alloc(i8* %0, i64 %6, i32 8, i8* %3, i32 %4)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %5
tail call void @llvm.memset.p0i8.i64(i8* align 1 %7, i8 0, i64 %6, i1 false)
br label %10
10: ; preds = %9, %5
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ access_int(void *, int);
void *alloc_int(int);
void nowarn_alloc_access_same_anti_range_int(int n) {
  if (n == 3)
    n = 4;
  void *p = alloc_int(n);
  access_int(p, n);
}


x86 assembly (clang, -O0):
<nowarn_alloc_access_same_anti_range_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    113c <nowarn_alloc_access_same_anti_range_int+0x1c>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_int@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <access_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nowarn_alloc_access_same_anti_range_int>:
push   %rbx
cmp    $0x3,%edi
mov    $0x4,%ebx
cmovne %edi,%ebx
mov    %ebx,%edi
call   1030 <alloc_int@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <access_int@plt>

LLVM IR (-O0):
define void @nowarn_alloc_access_same_anti_range_int(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 4, i32* %2
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = call i8* @alloc_int(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i32, i32* %2
%12 = call i32 @access_int(i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @nowarn_alloc_access_same_anti_range_int(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = select i1 %2, i32 4, i32 %0
%4 = tail call i8* @alloc_int(i32 %3)
%5 = tail call i32 @access_int(i8* %4, i32 %3)
ret void
}
/* Variables and functions */
int ASM(char *);
void putchr(char c) {
  while (ASM(" IN (IN_STATUS), RU") & 0x02)
    ;
  ASM(" MOVE 2(SP), RU");
  ASM(" OUT  R, (OUT_TX_DATA)");
}


x86 assembly (clang, -O0):
<putchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <ASM@plt>
and    $0x2,%eax
cmp    $0x0,%eax
je     113b <putchr+0x2b>
jmp    111e <putchr+0xe>
lea    0xed2(%rip),%rdi
call   1030 <ASM@plt>
lea    0xed6(%rip),%rdi
call   1030 <ASM@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchr>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <ASM@plt>
test   $0x2,%al
jne    1120 <putchr+0x10>
lea    0xee1(%rip),%rdi
call   1030 <ASM@plt>
lea    0xee5(%rip),%rdi
pop    %rbx
jmp    1030 <ASM@plt>

LLVM IR (-O0):
@.str = [20 x i8] c" IN (IN_STATUS), RU\00"
@.str.1 = [16 x i8] c" MOVE 2(SP), RU\00"
@.str.2 = [23 x i8] c" OUT R, (OUT_TX_DATA)\00"
define void @putchr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = call i32 @ASM(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = and i32 %4, 2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = call i32 @ASM(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @ASM(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c" IN (IN_STATUS), RU\00"
@.str.1 = [16 x i8] c" MOVE 2(SP), RU\00"
@.str.2 = [23 x i8] c" OUT R, (OUT_TX_DATA)\00"
define void @putchr(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @ASM(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = and i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @ASM(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @ASM(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void dump_field(void *field, int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%2.2X ", ((char *)field)[i]);
}


x86 assembly (clang, -O0):
<dump_field>:
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    1158 <dump_field+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_field+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_field>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <dump_field+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dump_field+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%2.2X \00"
define void @dump_field(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load 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
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%2.2X \00"
define void @dump_field(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int __ltptr(void *a, void *b) { return a < b; }


x86 assembly (clang, -O0):
<__ltptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltptr>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @__ltptr(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 = icmp ult i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__ltptr(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PlayTone(int, int);
void Beep() { PlayTone(600, 100); }


x86 assembly (clang, -O0):
<Beep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x258,%edi
mov    $0x64,%esi
call   1030 <PlayTone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Beep>:
mov    $0x258,%edi
mov    $0x64,%esi
jmp    1030 <PlayTone@plt>

LLVM IR (-O0):
define void @Beep() {
%1 = call i32 @PlayTone(i32 600, i32 100)
ret void
}

LLVM IR (-O2):
define void @Beep() {
%1 = tail call i32 @PlayTone(i32 600, i32 100)
ret void
}
int comparDep(const void *a, const void *b) {
  if ((long long int *)a < (long long int *)b)
    return -1;
  if ((long long int *)a == (long long int *)b)
    return 0;
  if ((long long int *)a > (long long int *)b)
    return 1;
}


x86 assembly (clang, -O0):
<comparDep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jae    1129 <comparDep+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <comparDep+0x5e>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jne    1146 <comparDep+0x46>
movl   $0x0,-0x4(%rbp)
jmp    115e <comparDep+0x5e>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jbe    115e <comparDep+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparDep>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comparDep(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i64*
%10 = icmp ult i64* %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %26
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i64*
%15 = load i8*, i8** %5
%16 = bitcast i8* %15 to i64*
%17 = icmp eq i64* %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 0, i32* %3
br label %26
19: ; preds = %12
%20 = load i8*, i8** %4
%21 = bitcast i8* %20 to i64*
%22 = load i8*, i8** %5
%23 = bitcast i8* %22 to i64*
%24 = icmp ugt i64* %21, %23
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 1, i32* %3
br label %26
26: ; preds = %11, %18, %25, %19
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @comparDep(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
double MIN(double a, double b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<MIN>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <MIN+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <MIN+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIN>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @MIN(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void check(unsigned int m) {
  if (m != (unsigned int)-1)
    abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112c <check+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
cmp    $0xffffffff,%edi
jne    1116 <check+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @check(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @check(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exit_sig(int sig) { exit(sig); }


x86 assembly (clang, -O0):
<exit_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_sig>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @exit_sig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @exit_sig(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ android_compiler_barrier();
extern __attribute__((always_)) void android_memory_barrier() {
  android_compiler_barrier();
}


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

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

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

LLVM IR (-O2):
define void @android_memory_barrier() {
%1 = tail call i32 (...) @android_compiler_barrier()
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint8_t min(uint32_t x, uint32_t y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int strcmp(char const *, char const *);
int c_strcmp(const char *arg0, const char *arg1) { return strcmp(arg0, arg1); }


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

x86 assembly (clang, -O2):
<c_strcmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @c_strcmp(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @c_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *s) { printf("Usage: %s\n", s); }


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Usage: %s\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *strcat(char *a, const char *b) {
  char *p = a;
  while (*p != 0)
    p++;
  while ((*p++ = *b++) != 0)
    ;
  return a;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <strcat+0x35>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    113a <strcat+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116d <strcat+0x6d>
jmp    113a <strcat+0x3a>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
unsigned int main(void) {
  unsigned int llvm_cbe_tmp__1;
  ;
  *(&llvm_cbe_tmp__1) = 0u;
  return 0u;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int main() {
  int arg1 = 5;
  int arg2 = 9;
  int or = 0;
  __asm__("orl %%ebx, %%eax;" : "=a"(or) : "a"(arg1), "b"(arg2));
  return or ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x9,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
or     %ebx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%eax
mov    $0x9,%ebx
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 9, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm "orl %ebx, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "orl %ebx, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 5, i32 9)
ret i32 %1
}
int bar(x)
int x;
{
  int t[3] = {3, 2, 1};
  int *ptrs[3];
  t[2] = x;
  ptrs[0] = &(t[0]);
  ptrs[1] = &t[1];
  ptrs[2] = &t[2];
  t[0] = 1024;
  output(*ptrs[0], *ptrs[1], *ptrs[2]);
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
lea    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
movl   $0x400,-0x10(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1030 <output@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    %edi,%edx
mov    $0x400,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <output@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.bar.t = [3 x i32] [i32 3, i32 2, i32 1]
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i32]
%4 = alloca [3 x i32*]
store i32 %0, i32* %2
%5 = bitcast [3 x i32]* %3 to i8*
%6 = load i32, i32* %2
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
store i32 %6, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%9 = getelementptr inbounds [3 x i32*], [3 x i32*]* %4, i64 0, i64 0
store i32* %8, i32** %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%11 = getelementptr inbounds [3 x i32*], [3 x i32*]* %4, i64 0, i64 1
store i32* %10, i32** %11
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%13 = getelementptr inbounds [3 x i32*], [3 x i32*]* %4, i64 0, i64 2
store i32* %12, i32** %13
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 1024, i32* %14
%15 = getelementptr inbounds [3 x i32*], [3 x i32*]* %4, i64 0, i64 0
%16 = load i32*, i32** %15
%17 = load i32, i32* %16
%18 = getelementptr inbounds [3 x i32*], [3 x i32*]* %4, i64 0, i64 1
%19 = load i32*, i32** %18
%20 = load i32, i32* %19
%21 = getelementptr inbounds [3 x i32*], [3 x i32*]* %4, i64 0, i64 2
%22 = load i32*, i32** %21
%23 = load i32, i32* %22
%24 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @output to i32 (i32, i32, i32, ...)*)(i32 %17, i32 %20, i32 %23)
ret i32 0
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @output to i32 (i32, i32, i32, ...)*)(i32 1024, i32 2, i32 %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ send(int, void const *, size_t, int);
ssize_t txc_libc_send(int s, const void *buf, size_t len, int flags) {
  return send(s, buf, len, flags);
}


x86 assembly (clang, -O0):
<txc_libc_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txc_libc_send>:
jmp    1030 <send@plt>

LLVM IR (-O0):
define i32 @txc_libc_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @send(i32 %9, i8* %10, i64 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @txc_libc_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 %3)
ret i32 %5
}