xunge/DecIR huggingface dataset:
char *strchr(char *str, int character) {
  while (1) {
    if (*str == character)
      return str;
    if (*str == '\0')
      return (void *)0;
    str++;
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1128 <strchr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <strchr+0x56>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1145 <strchr+0x45>
movq   $0x0,-0x8(%rbp)
jmp    1156 <strchr+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl (%rdi),%ecx
cmp    %esi,%ecx
je     1120 <strchr+0x20>
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, %1
br i1 %5, label %15, label %6
6: ; preds = %2, %10
%7 = phi i8 [ %12, %10 ], [ %3, %2 ]
%8 = phi i8* [ %11, %10 ], [ %0, %2 ]
%9 = icmp eq i8 %7, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %6
15: ; preds = %10, %6, %2
%16 = phi i8* [ %0, %2 ], [ null, %6 ], [ %11, %10 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ Strobe_RestoreConfig();
void Strobe_Wakeup(void) { Strobe_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @Strobe_Wakeup() {
%1 = tail call i32 (...) @Strobe_RestoreConfig()
ret void
}
/* Variables and functions */
char *energymon_strencpy(char *, char *, size_t);
char *energymon_get_source_odroid_ioctl(char *buffer, size_t n) {
  return energymon_strencpy(buffer, "ODROID INA231 Power Sensors via ioctl", n);
}


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

x86 assembly (clang, -O2):
<energymon_get_source_odroid_ioctl>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <energymon_strencpy@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"ODROID INA231 Power Sensors via ioctl\00"
define i8* @energymon_get_source_odroid_ioctl(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 i8* @energymon_strencpy(i8* %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [38 x i8] c"ODROID INA231 Power Sensors via ioctl\00"
define i8* @energymon_get_source_odroid_ioctl(i8* %0, i64 %1) {
%3 = tail call i8* @energymon_strencpy(i8* %0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i8* %3
}
int _testfunc_callback_i_if(int value, int (*func)(int)) {
  int sum = 0;
  while (value != 0) {
    sum += func(value);
    value /= 2;
  }
  return sum;
}


x86 assembly (clang, -O0):
<_testfunc_callback_i_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <_testfunc_callback_i_if+0x42>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
call   *%rax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1116 <_testfunc_callback_i_if+0x16>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_testfunc_callback_i_if>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113b <_testfunc_callback_i_if+0x3b>
mov    %rsi,%r14
mov    %edi,%ebp
xor    %r15d,%r15d
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
call   *%r14
add    %eax,%r15d
shr    $0x1f,%ebx
add    %ebp,%ebx
sar    %ebx
add    $0x1,%ebp
cmp    $0x2,%ebp
mov    %ebx,%ebp
ja     1120 <_testfunc_callback_i_if+0x20>
jmp    113e <_testfunc_callback_i_if+0x3e>
xor    %r15d,%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @_testfunc_callback_i_if(i32 %0, i32 (i32)* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = tail call i32 %1(i32 %6)
%8 = add nsw i32 %7, %5
%9 = sdiv i32 %6, 2
%10 = add i32 %6, 1
%11 = icmp ult i32 %10, 3
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %13
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ unix_error(char *);
void csapp_close(int fd) {
  int rc;
  if ((rc = close(fd)) < 0)
    unix_error("close error");
}


x86 assembly (clang, -O0):
<csapp_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    114b <csapp_close+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csapp_close>:
push   %rax
call   1030 <close@plt>
test   %eax,%eax
js     112c <csapp_close+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"close error\00"
define void @csapp_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ish_about() {
  printf("Michiru Operating System\n");
  printf("Based on the Riku Kernel.\n");
  printf("\t(c)MrXedac, 2016-2019. All Rights Reserved.\n");
  printf("\nIn development stage.\n");
}


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

x86 assembly (clang, -O2):
<ish_about>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Michiru Operating System\0A\00"
@.str.1 = [27 x i8] c"Based on the Riku Kernel.\0A\00"
@.str.2 = [46 x i8] c"\09(c)MrXedac, 2016-2019. All Rights Reserved.\0A\00"
@.str.3 = [24 x i8] c"\0AIn development stage.\0A\00"
define void @ish_about() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Michiru Operating System\00"
@str.4 = [26 x i8] c"Based on the Riku Kernel.\00"
@str.5 = [45 x i8] c"\09(c)MrXedac, 2016-2019. All Rights Reserved.\00"
@str.6 = [23 x i8] c"\0AIn development stage.\00"
define void @ish_about() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *check_oom(void *ptr) {
  if (!ptr) {
    fprintf(stderr, "Out of memory\n");
    fflush(stderr);
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<check_oom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1171 <check_oom+0x41>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_oom>:
test   %rdi,%rdi
je     1139 <check_oom+0x9>
mov    %rdi,%rax
ret
push   %rbx
mov    0x2e9f(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @check_oom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @check_oom(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ glmRadians3f(float *, float const *);
int /*<<< orphan*/ glmSin3f(float *, float *);
void glmSinD3f(float out[3], const float angle[3]) {
  glmRadians3f(out, angle);
  glmSin3f(out, out);
}


x86 assembly (clang, -O0):
<glmSinD3f>:
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 <glmRadians3f@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <glmSin3f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmSinD3f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <glmRadians3f@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <glmSin3f@plt>

LLVM IR (-O0):
define void @glmSinD3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @glmRadians3f(float* %5, float* %6)
%8 = load float*, float** %3
%9 = load float*, float** %3
%10 = call i32 @glmSin3f(float* %8, float* %9)
ret void
}

LLVM IR (-O2):
define void @glmSinD3f(float* %0, float* %1) {
%3 = tail call i32 @glmRadians3f(float* %0, float* %1)
%4 = tail call i32 @glmSin3f(float* %0, float* %0)
ret void
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t inbyte(uint16_t port) {
  uint8_t value;
  __asm__ __volatile__("inb %w1, %b0" : "=a"(value) : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inbyte>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @inbyte(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inbyte(i32 %0) {
%2 = tail call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_matlab_false_line_comment() {
  test_parser_verify_parse(test_parser_sourcefile("matlab", " %{block%} code"),
                           "matlab", "%{block%} code", "", 0);
}


x86 assembly (clang, -O0):
<test_matlab_false_line_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_matlab_false_line_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xeca(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"matlab\00"
@.str.1 = [16 x i8] c" %{block%} code\00"
@.str.2 = [15 x i8] c"%{block%} code\00"
@.str.3 = [1 x i8] zeroinitializer
define void @test_matlab_false_line_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"matlab\00"
@.str.1 = [16 x i8] c" %{block%} code\00"
@.str.2 = [15 x i8] c"%{block%} code\00"
@.str.3 = [1 x i8] zeroinitializer
define void @test_matlab_false_line_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
void foo56() {}


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

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

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

LLVM IR (-O2):
define void @foo56() {
ret void
}
/* Variables and functions */
int setconf(char const *, char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, long);
int setconf_long(const char *configfile, const char *key, long lvalue) {
  char svalue[512];
  int result;
  sprintf(svalue, "%ld", lvalue);
  if ((result = setconf(configfile, key, svalue)))
    return result;
  else
    return 0;
}


x86 assembly (clang, -O0):
<setconf_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x220(%rbp),%rdx
call   1030 <setconf@plt>
mov    %eax,-0x224(%rbp)
cmp    $0x0,%eax
je     117f <setconf_long+0x5f>
mov    -0x224(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <setconf_long+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setconf_long>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec7(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <setconf@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i32 @setconf_long(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca [512 x i8]
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%11 = load i64, i64* %7
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%16 = call i32 @setconf(i8* %13, i8* %14, i8* %15)
store i32 %16, i32* %9
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %3
%19 = load i32, i32* %9
store i32 %19, i32* %4
br label %21
20: ; preds = %3
store i32 0, i32* %4
br label %21
21: ; preds = %20, %18
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @setconf_long(i8* %0, i8* %1, i64 %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %2)
%7 = call i32 @setconf(i8* %0, i8* %1, i8* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int getarray(int a[]) {
  int i = 0, count;
  scanf("%d", &count);
  for (; i < count; i++)
    scanf("%d", &a[i]);
  return count;
}


x86 assembly (clang, -O0):
<getarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1168 <getarray+0x58>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1030 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <getarray+0x23>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getarray>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r15
lea    0xedd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    115d <getarray+0x4d>
xor    %ebx,%ebx
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1140 <getarray+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @getarray(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1, %7
%8 = phi i64 [ %11, %7 ], [ 0, %1 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %1
%16 = phi i32 [ %5, %1 ], [ %12, %7 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *, int *);
int main() {
  long int a;
  int b;
  scanf("%ld %d", &a, &b);
  printf("%d", a / b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
movslq 0xc(%rsp),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1157 <main+0x37>
cqto
idiv   %rcx
jmp    115b <main+0x3b>
xor    %edx,%edx
div    %ecx
lea    0xea2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%ld %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i32
%3 = bitcast i64* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64* %1, i32* %2)
%6 = load i64, i64* %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = sdiv i64 %6, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void trs_print_nl(int num) {
  int i;
  if (num < 0)
    return;
  else
    for (i = 0; i < num; i++)
      fprintf(stdout, "\n");
}


x86 assembly (clang, -O0):
<trs_print_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <trs_print_nl+0x1a>
jmp    1165 <trs_print_nl+0x55>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1160 <trs_print_nl+0x50>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <trs_print_nl+0x21>
jmp    1165 <trs_print_nl+0x55>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trs_print_nl>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <trs_print_nl+0x30>
mov    %edi,%ebx
mov    0x2ebe(%rip),%r15
lea    0xed7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%edi
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0xffffffff,%ebx
jne    1130 <trs_print_nl+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @trs_print_nl(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x, y, z[2];
  int *p = &x;
  ++p;
  assert(p == &y);
  p = &z[-1];
  assert(p == &y);
  p = &z[y];
  assert(p == &z[y]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
cmp    %rax,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x14(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
cmp    %rax,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0xc(%rbp),%rcx
lea    -0x14(%rbp),%rax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rdx
lea    -0x14(%rbp),%rcx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca i32*
store i32 0, i32* %1
store i32* %2, i32** %5
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp eq i32* %8, %3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 -1
store i32* %12, i32** %5
%13 = load i32*, i32** %5
%14 = icmp eq i32* %13, %3
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 %18
store i32* %19, i32** %5
%20 = load i32*, i32** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 %22
%24 = icmp eq i32* %20, %23
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
%2 = tail call i32 @assert(i32 0)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void message_exit(char *type) {
  printf("error occurred when allocating %s image memory - aborting\n", type);
  exit(-1);
}


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

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

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

LLVM IR (-O2):
@.str = [59 x i8] c"error occurred when allocating %s image memory - aborting\0A\00"
define void @message_exit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [format] [number]\n", name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s [format] [number]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s [format] [number]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void serialFlush(int fd) { tcflush(fd, TCIOFLUSH); }


x86 assembly (clang, -O0):
<serialFlush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialFlush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define void @serialFlush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIOFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define void @serialFlush(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
unsigned int f(void *, unsigned int);
unsigned int get_glyph_index(void *font, unsigned int glyph) {
  return f(font, glyph);
}


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

x86 assembly (clang, -O2):
<get_glyph_index>:
jmp    1030 <f@plt>

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

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

/* Variables and functions */
int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared) {
  (void)attr;
  (void)pshared;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @pthread_condattr_setpshared(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
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_condattr_setpshared(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void init_array() {}


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

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

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

LLVM IR (-O2):
define void @init_array() {
ret void
}
int test_imm_D4int16_mem(short *val) {
  return ((*val) & (0xD4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D4int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xd4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D4int16_mem>:
testb  $0xd4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D4int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 212
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_D4int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 212
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ call(char *);
gt() { call("ccgt"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"ccgt\00"
define i32 @gt() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: [env TZ=...] date2epoch [-q] YYYY-MM-DD [HH[:MM[:SS]]]\n",
        stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Usage: [env TZ=...] date2epoch [-q] YYYY-MM-DD [HH[:MM[:SS]]]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [63 x i8] c"Usage: [env TZ=...] date2epoch [-q] YYYY-MM-DD [HH[:MM[:SS]]]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int nop_slide_size(int fat_size) { return fat_size - (fat_size & ~3U); }


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

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

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

LLVM IR (-O2):
define i32 @nop_slide_size(i32 %0) {
%2 = and i32 %0, 3
ret i32 %2
}
int bitmapGet(char *bitmap, int idx) {
  int bit_mask[8] = {128, 64, 32, 16, 8, 4, 2, 1};
  if (bitmap[idx / 8] & bit_mask[idx % 8]) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<bitmapGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee5(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x44(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x44(%rbp),%eax
movslq %edx,%rcx
and    -0x40(%rbp,%rcx,4),%eax
cmp    $0x0,%eax
je     1184 <bitmapGet+0x84>
movl   $0x1,-0x4(%rbp)
jmp    118b <bitmapGet+0x8b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmapGet>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rdi,%rcx,1),%ecx
and    $0xfffffff8,%eax
sub    %eax,%esi
movslq %esi,%rdx
lea    0xedd(%rip),%rsi
xor    %eax,%eax
test   %ecx,(%rsi,%rdx,4)
setne  %al
ret

LLVM IR (-O0):
@__const.bitmapGet.bit_mask = [8 x i32] [i32 128, i32 64, i32 32, i32 16, i32 8, i32 4, i32 2, i32 1]
define i32 @bitmapGet(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [8 x i32]
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = bitcast [8 x i32]* %6 to i8*
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sdiv i32 %9, 8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i32, i32* %5
%16 = srem i32 %15, 8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = and i32 %14, %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %2
store i32 1, i32* %3
br label %24
23: ; preds = %2
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@__const.bitmapGet.bit_mask = [8 x i32] [i32 128, i32 64, i32 32, i32 16, i32 8, i32 4, i32 2, i32 1]
define i32 @bitmapGet(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = srem i32 %1, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [8 x i32], [8 x i32]* @__const.bitmapGet.bit_mask, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = and i32 %11, %7
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}
int clear_bit(int n, unsigned char pos) {
  int mask = 1 << (pos - 1);
  return n & ~mask;
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %edi,%eax
add    $0xff,%sil
btr    %esi,%eax
ret

LLVM IR (-O0):
define i32 @clear_bit(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = xor i32 %11, -1
%13 = and i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @clear_bit(i32 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = add nsw i32 %3, -1
%5 = shl nuw i32 1, %4
%6 = xor i32 %5, -1
%7 = and i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ data_bss_init();
int /*<<< orphan*/ exram_init();
int /*<<< orphan*/ hw_preinit();
int /*<<< orphan*/ wind_os_launch();
void wind_os_prelaunch(void) {
  hw_preinit();
  exram_init();
  data_bss_init();
  wind_os_launch();
}


x86 assembly (clang, -O0):
<wind_os_prelaunch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <hw_preinit@plt>
mov    $0x0,%al
call   1030 <exram_init@plt>
mov    $0x0,%al
call   1060 <data_bss_init@plt>
mov    $0x0,%al
call   1040 <wind_os_launch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wind_os_prelaunch>:
push   %rax
xor    %eax,%eax
call   1050 <hw_preinit@plt>
xor    %eax,%eax
call   1030 <exram_init@plt>
xor    %eax,%eax
call   1060 <data_bss_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <wind_os_launch@plt>

LLVM IR (-O0):
define void @wind_os_prelaunch() {
%1 = call i32 (...) @hw_preinit()
%2 = call i32 (...) @exram_init()
%3 = call i32 (...) @data_bss_init()
%4 = call i32 (...) @wind_os_launch()
ret void
}

LLVM IR (-O2):
define void @wind_os_prelaunch() {
%1 = tail call i32 (...) @hw_preinit()
%2 = tail call i32 (...) @exram_init()
%3 = tail call i32 (...) @data_bss_init()
%4 = tail call i32 (...) @wind_os_launch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_help();
int check_args_validation(int argc, char **args) {
  int i = 0;
  if (argc != 2) {
    show_help();
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_args_validation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1143 <check_args_validation+0x33>
mov    $0x0,%al
call   1030 <show_help@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <check_args_validation+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_args_validation>:
xor    %eax,%eax
cmp    $0x2,%edi
je     1128 <check_args_validation+0x18>
push   %rax
xor    %eax,%eax
call   1030 <show_help@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @check_args_validation(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @show_help()
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ -1, %4 ], [ 0, %2 ]
ret i32 %7
}
int test_imm_CAuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xCA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CAuint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xca,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CAuint64_lowword_reg>:
test   $0xca,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CAuint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 202
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_CAuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 202
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}