xunge/DecIR huggingface dataset:
void print_char_console(const char my_char) {
  while (*((volatile unsigned char *)(0x98010000 + 4)) == ((unsigned char)0))
    ;
  *((volatile unsigned char *)(0x98010000 + 3)) = my_char;
  *((volatile unsigned char *)(0x98010000 + 5)) = ((unsigned char)1);
}


x86 assembly (clang, -O0):
<print_char_console>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x98010004,%eax
mov    (%rax),%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    1122 <print_char_console+0x22>
jmp    110a <print_char_console+0xa>
mov    -0x1(%rbp),%cl
mov    $0x98010003,%eax
mov    %cl,(%rax)
mov    $0x98010005,%eax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char_console>:
mov    $0x98010003,%eax
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,0x1(%rax)
je     1110 <print_char_console+0x10>
mov    %dil,(%rax)
movb   $0x1,0x2(%rax)
ret

LLVM IR (-O0):
define void @print_char_console(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i8, i8* inttoptr (i64 2550202372 to i8*)
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 2550202371 to i8*)
store volatile i8 1, i8* inttoptr (i64 2550202373 to i8*)
ret void
}

LLVM IR (-O2):
define void @print_char_console(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 2550202372 to i8*)
%4 = icmp eq i8 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 2550202371 to i8*)
store volatile i8 1, i8* inttoptr (i64 2550202373 to i8*)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ext2_bit_is_set(const uint32_t *btbl, uint32_t bit_num) {
  int byte = (bit_num >> 5);
  int bit = (bit_num & 0x1F);
  return btbl[byte] & (1 << bit);
}


x86 assembly (clang, -O0):
<ext2_bit_is_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2_bit_is_set>:
mov    %esi,%ecx
mov    %esi,%edx
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x5,%edx
movslq %edx,%rcx
and    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @ext2_bit_is_set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 5
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 31
store i32 %10, i32* %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = load i32, i32* %6
%17 = shl i32 1, %16
%18 = and i32 %15, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @ext2_bit_is_set(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = and i32 %1, 31
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = shl nuw i32 1, %4
%9 = and i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void errhalt(char *str) {
  printf("Error: %s\n", str);
  exit(-1);
}


x86 assembly (clang, -O0):
<errhalt>:
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):
<errhalt>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @errhalt(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)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @errhalt(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void XShrinkRegion() {}


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

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

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

LLVM IR (-O2):
define void @XShrinkRegion() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *showParameters_il() {
  static char text[200];
  sprintf(text, " lenBitmapDiv=%d", 8);
  return text;
}


x86 assembly (clang, -O0):
<showParameters_il>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x8,%edx
call   1030 <sprintf@plt>
lea    0x2f0d(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<showParameters_il>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@showParameters_il.text = internal global [200 x i8] zeroinitializer
@.str = [17 x i8] c" lenBitmapDiv=%d\00"
define i8* @showParameters_il() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 8)
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0)
}

LLVM IR (-O2):
@showParameters_il.text = internal global [200 x i8] zeroinitializer
@.str = [17 x i8] c" lenBitmapDiv=%d\00"
define i8* @showParameters_il() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 8)
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void show_n_char(char ch, int num) {
  int counter;
  for (counter = 0; counter < num; counter++)
    putchar(ch);
}


x86 assembly (clang, -O0):
<show_n_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <show_n_char+0x3b>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <show_n_char+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_n_char>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <show_n_char+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <show_n_char+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @show_n_char(i8 signext %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 = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @show_n_char(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
void close() {}


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

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

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

LLVM IR (-O2):
define void @close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void show_usage() {
  printf("Usage: ./initwrapper service start|stop|restart|status\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"Usage: ./initwrapper service start|stop|restart|status\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [55 x i8] c"Usage: ./initwrapper service start|stop|restart|status\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int selle(int x, int y, int z) { return x <= 0 ? y : z; }


x86 assembly (clang, -O0):
<selle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1122 <selle+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <selle+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<selle>:
mov    %esi,%eax
test   %edi,%edi
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @selle(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 1
%5 = select i1 %4, i32 %1, i32 %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ psp_sound_exit();
int /*<<< orphan*/ sceKernelExitGame();
int exit_callback(int arg1, int arg2, void *common) {
  psp_sound_exit();
  sceKernelExitGame();
}


x86 assembly (clang, -O0):
<exit_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <psp_sound_exit@plt>
mov    $0x0,%al
call   1040 <sceKernelExitGame@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @exit_callback(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @psp_sound_exit()
%5 = tail call i32 (...) @sceKernelExitGame()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ bzero(void *, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t size) {
  void *value = malloc(size);
  if (value == NULL) {
    perror("malloc");
    exit(EXIT_FAILURE);
  };
  bzero(value, size);
  return value;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117e <xmalloc+0x3e>
lea    0xe95(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
test   %rax,%rax
je     116a <xmalloc+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe8f(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = load i64, i64* %2
%15 = call i32 @bzero(i8* %13, i64 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = tail call i32 @bzero(i8* %2, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ i2c_er_handler();
void I2C1_ER_IRQHandler(void) { i2c_er_handler(); }


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

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

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

LLVM IR (-O2):
define void @I2C1_ER_IRQHandler() {
%1 = tail call i32 (...) @i2c_er_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_nngetaspectd(int, int, double *, int *);
void nngetaspectd_(int *row, int *col, double *aspect, int *ier) {
  c_nngetaspectd(*row - 1, *col - 1, aspect, ier);
}


x86 assembly (clang, -O0):
<nngetaspectd_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <c_nngetaspectd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nngetaspectd_>:
mov    (%rdi),%edi
add    $0xffffffff,%edi
mov    (%rsi),%esi
add    $0xffffffff,%esi
jmp    1030 <c_nngetaspectd@plt>

LLVM IR (-O0):
define void @nngetaspectd_(i32* %0, i32* %1, double* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca double*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store double* %2, double** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = sub nsw i32 %13, 1
%15 = load double*, double** %7
%16 = load i32*, i32** %8
%17 = call i32 @c_nngetaspectd(i32 %11, i32 %14, double* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @nngetaspectd_(i32* nocapture %0, i32* nocapture %1, double* %2, i32* %3) {
%5 = load i32, i32* %0
%6 = add nsw i32 %5, -1
%7 = load i32, i32* %1
%8 = add nsw i32 %7, -1
%9 = tail call i32 @c_nngetaspectd(i32 %6, i32 %8, double* %2, i32* %3)
ret void
}
__attribute__((always_)) void
unregister_cpu_notifier(struct notifier_block *nb) {}


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define void @unregister_cpu_notifier(%struct.notifier_block* nocapture %0) {
ret void
}
/* Variables and functions */
int f83(int *);
int f84(int *p) { return f83(p); }


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

x86 assembly (clang, -O2):
<f84>:
jmp    1030 <f83@plt>

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

LLVM IR (-O2):
define i32 @f84(i32* %0) {
%2 = tail call i32 @f83(i32* %0)
ret i32 %2
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buildgraph(struct graph *);
int /*<<< orphan*/ dfs(struct graph **, int);
int /*<<< orphan*/ displayGraph(struct graph *);
int /*<<< orphan*/ initGraph(struct graph **, int);
int main() {
  struct graph *grp = NULL;
  initGraph(&grp, 6);
  buildgraph(grp);
  displayGraph(grp);
  dfs(&grp, 3);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1040 <initGraph@plt>
mov    -0x10(%rbp),%rdi
call   1030 <buildgraph@plt>
mov    -0x10(%rbp),%rdi
call   1050 <displayGraph@plt>
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1060 <dfs@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <initGraph@plt>
mov    0x8(%rsp),%rdi
call   1030 <buildgraph@plt>
mov    0x8(%rsp),%rdi
call   1050 <displayGraph@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <dfs@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.graph = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.graph*
store i32 0, i32* %1
store %struct.graph* null, %struct.graph** %2
%3 = call i32 @initGraph(%struct.graph** %2, i32 6)
%4 = load %struct.graph*, %struct.graph** %2
%5 = call i32 @buildgraph(%struct.graph* %4)
%6 = load %struct.graph*, %struct.graph** %2
%7 = call i32 @displayGraph(%struct.graph* %6)
%8 = call i32 @dfs(%struct.graph** %2, i32 3)
ret i32 1
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define i32 @main() {
%1 = alloca %struct.graph*
%2 = bitcast %struct.graph** %1 to i8*
store %struct.graph* null, %struct.graph** %1
%3 = call i32 @initGraph(%struct.graph** %1, i32 6)
%4 = load %struct.graph*, %struct.graph** %1
%5 = call i32 @buildgraph(%struct.graph* %4)
%6 = load %struct.graph*, %struct.graph** %1
%7 = call i32 @displayGraph(%struct.graph* %6)
%8 = call i32 @dfs(%struct.graph** %1, i32 3)
ret i32 1
}
/* Type definitions */
typedef int u_int64_t;

/* Variables and functions */
u_int64_t bswap64(u_int64_t x) {
  return ((x << 56) & 0xff00000000000000UL) |
         ((x << 40) & 0x00ff000000000000UL) |
         ((x << 24) & 0x0000ff0000000000UL) |
         ((x << 8) & 0x000000ff00000000UL) | ((x >> 8) & 0x00000000ff000000UL) |
         ((x >> 24) & 0x0000000000ff0000UL) |
         ((x >> 40) & 0x000000000000ff00UL) |
         ((x >> 56) & 0x00000000000000ffUL);
}


x86 assembly (clang, -O0):
<bswap64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
shl    %cl,%eax
cltq
movabs $0xff00000000000000,%rcx
and    %rcx,%rax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
movslq %ecx,%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
movslq %ecx,%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
movslq %ecx,%rcx
and    $0xff0000,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    $0xff00,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%edx
mov    $0x38,%ecx
sar    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    $0xff,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 56
%5 = sext i32 %4 to i64
%6 = and i64 %5, -72057594037927936
%7 = load i32, i32* %2
%8 = shl i32 %7, 40
%9 = sext i32 %8 to i64
%10 = and i64 %9, 71776119061217280
%11 = or i64 %6, %10
%12 = load i32, i32* %2
%13 = shl i32 %12, 24
%14 = sext i32 %13 to i64
%15 = and i64 %14, 280375465082880
%16 = or i64 %11, %15
%17 = load i32, i32* %2
%18 = shl i32 %17, 8
%19 = sext i32 %18 to i64
%20 = and i64 %19, 1095216660480
%21 = or i64 %16, %20
%22 = load i32, i32* %2
%23 = ashr i32 %22, 8
%24 = sext i32 %23 to i64
%25 = and i64 %24, 4278190080
%26 = or i64 %21, %25
%27 = load i32, i32* %2
%28 = ashr i32 %27, 24
%29 = sext i32 %28 to i64
%30 = and i64 %29, 16711680
%31 = or i64 %26, %30
%32 = load i32, i32* %2
%33 = ashr i32 %32, 40
%34 = sext i32 %33 to i64
%35 = and i64 %34, 65280
%36 = or i64 %31, %35
%37 = load i32, i32* %2
%38 = ashr i32 %37, 56
%39 = sext i32 %38 to i64
%40 = and i64 %39, 255
%41 = or i64 %36, %40
%42 = trunc i64 %41 to i32
ret i32 %42
}

LLVM IR (-O2):
define i32 @bswap64(i32 %0) {
ret i32 poison
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_seq_msgid(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_seq_msgid>:
jmp    1030 <mock@plt>

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

LLVM IR (-O2):
define i8* @cf_s_seq_msgid(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_standard_polyhedral_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(101, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_standard_polyhedral_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x65,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_standard_polyhedral_homotopy>:
mov    $0x65,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_standard_polyhedral_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 101, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_standard_polyhedral_homotopy() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 101, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct screen_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ play_init(struct screen_t *);
void game_init(struct screen_t *scr) { play_init(scr); }


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

x86 assembly (clang, -O2):
<game_init>:
jmp    1030 <play_init@plt>

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

LLVM IR (-O2):
%struct.screen_t = type { i32 }
define void @game_init(%struct.screen_t* %0) {
%2 = tail call i32 @play_init(%struct.screen_t* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int translate_S(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void do_parse(FILE *src, FILE *out) {
  rewind(src);
  while (1) {
    if (translate_S(src, out) == -1) {
      return;
    }
  }
}


x86 assembly (clang, -O0):
<do_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <translate_S@plt>
cmp    $0xffffffff,%eax
jne    1155 <do_parse+0x35>
add    $0x10,%rsp
pop    %rbp
ret
jmp    1139 <do_parse+0x19>

x86 assembly (clang, -O2):
<do_parse>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <rewind@plt>
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <translate_S@plt>
cmp    $0xffffffff,%eax
jne    1130 <do_parse+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @do_parse(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 = call i32 @rewind(i32* %5)
br label %7
7: ; preds = %2, %13
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @translate_S(i32* %8, i32* %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %7
ret void
13: ; preds = %7
br label %7
}

LLVM IR (-O2):
define void @do_parse(i32* %0, i32* %1) {
%3 = tail call i32 @rewind(i32* %0)
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @translate_S(i32* %0, i32* %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %4
7: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ stdout;
int system(char *);
int create_map(char *name, char *polyfile) {
  char buf[1024];
  sprintf(buf, "r.in.poly rows=512 i=\"%s\" o=\"%s\"", polyfile, name);
  fprintf(stdout, "Creating raster map %s\n", name);
  return system(buf);
}


x86 assembly (clang, -O0):
<create_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xea7(%rip),%rsi
call   1050 <sprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1040 <fprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_map>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xeb9(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rcx
call   1050 <sprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %r14,%rdi
call   1030 <system@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"r.in.poly rows=512 i=\22%s\22 o=\22%s\22\00"
@stdout = global i32 0
@.str.1 = [24 x i8] c"Creating raster map %s\0A\00"
define i32 @create_map(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i32, i32* @stdout
%11 = load i8*, i8** %3
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%14 = call i32 @system(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [33 x i8] c"r.in.poly rows=512 i=\22%s\22 o=\22%s\22\00"
@stdout = global i32 0
@.str.1 = [24 x i8] c"Creating raster map %s\0A\00"
define i32 @create_map(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = call i32 @system(i8* %4)
ret i32 %8
}
/* Variables and functions */
int divide(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int x = 5, y = 2;
  printf("hello world!");
  int z = divide(4, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <divide@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <divide@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @divide(i32 4, i32 0)
ret i32 0
}
void sdram_first_normal_reference(void) { return; }


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

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

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

LLVM IR (-O2):
define void @sdram_first_normal_reference() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int back_wash(__attribute__((__unused__)) int argc,
              __attribute__((__unused__)) char **argv) {
  fprintf(stderr, "[BACK] "
                  "error"
                  ": "
                  "subcommand 'wash' not yet implemented"
                  "\n");
  return -1;
}


x86 assembly (clang, -O0):
<back_wash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_wash>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"[BACK] error: subcommand 'wash' not yet implemented\0A\00"
define i32 @back_wash(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"[BACK] error: subcommand 'wash' not yet implemented\0A\00"
define i32 @back_wash(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, short, unsigned char, unsigned short);
void cast1(char a, short b, unsigned char c, unsigned short d) {
  printf("%d %d %d %d\n", a, b, c, d);
}


x86 assembly (clang, -O0):
<cast1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dl,%cl
mov    %si,%dx
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x4(%rbp),%cx
mov    -0x5(%rbp),%al
lea    0xebd(%rip),%rdi
movsbl %dl,%esi
movswl %cx,%edx
movzbl %al,%ecx
movzwl -0x8(%rbp),%r8d
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast1>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define void @cast1(i8 signext %0, i16 signext %1, i8 zeroext %2, i16 zeroext %3) {
%5 = alloca i8
%6 = alloca i16
%7 = alloca i8
%8 = alloca i16
store i8 %0, i8* %5
store i16 %1, i16* %6
store i8 %2, i8* %7
store i16 %3, i16* %8
%9 = load i8, i8* %5
%10 = load i16, i16* %6
%11 = load i8, i8* %7
%12 = load i16, i16* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %9, i16 signext %10, i8 zeroext %11, i16 zeroext %12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define void @cast1(i8 signext %0, i16 signext %1, i8 zeroext %2, i16 zeroext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %0, i16 signext %1, i8 zeroext %2, i16 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char str[20] = "shivek";
  printf("%s", str);
  reverse(str);
  printf("\n%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x20(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xed6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [20 x i8] c"shivek\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = bitcast [20 x i8]* %2 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @reverse(i8* %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [20 x i8] c"shivek\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
trace(fmt, a1, a2, a3, a4, a5, a6, a7, a8) char *fmt;
{}


x86 assembly (clang, -O0):
<trace>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @trace(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i8* %0, i8** %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
%20 = load i32, i32* %10
ret i32 %20
}

LLVM IR (-O2):
define i32 @trace(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
ret i32 undef
}
int to_sign_int(__float128 a) { return (int)a; }


x86 assembly (clang, -O0):
<to_sign_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
call   1120 <__fixtfsi>
add    $0x10,%rsp
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<to_sign_int>:
push   %rax
call   1110 <__fixtfsi>
pop    %rcx
ret
nopl   0x0(%rax,%rax,1)

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

LLVM IR (-O2):
define i32 @to_sign_int(fp128 %0) {
%2 = fptosi fp128 %0 to i32
ret i32 %2
}
/* Variables and functions */
double what_angle(double, int);
double func(double wave, double angle, int var) {
  return what_angle(wave, var) - angle;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <what_angle@plt>
subsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <what_angle@plt>
subsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @func(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = load i32, i32* %6
%9 = call double @what_angle(double %7, i32 %8)
%10 = load double, double* %5
%11 = fsub double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @func(double %0, double %1, i32 %2) {
%4 = tail call double @what_angle(double %0, i32 %2)
%5 = fsub double %4, %1
ret double %5
}
/* Variables and functions */
int cpuid_vendor(char *);
int op_is_cpu_vendor(char *vendor) { return cpuid_vendor(vendor); }


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

x86 assembly (clang, -O2):
<op_is_cpu_vendor>:
jmp    1030 <cpuid_vendor@plt>

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

LLVM IR (-O2):
define i32 @op_is_cpu_vendor(i8* %0) {
%2 = tail call i32 @cpuid_vendor(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
char *luaL_check_lstr(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pushresult(int /*<<< orphan*/);
int /*<<< orphan*/ setreturn(int /*<<< orphan*/ *, char *);
void io_appendto(void) {
  char *s = (luaL_check_lstr((3), NULL));
  FILE *fp = fopen(s, "a");
  if (fp != NULL)
    setreturn(fp, "_OUTPUT");
  else
    pushresult(0);
}


x86 assembly (clang, -O0):
<io_appendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <luaL_check_lstr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118e <io_appendto+0x4e>
mov    -0x10(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <setreturn@plt>
jmp    1195 <io_appendto+0x55>
xor    %edi,%edi
call   1030 <pushresult@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_appendto>:
push   %rax
mov    $0x3,%edi
xor    %esi,%esi
call   1060 <luaL_check_lstr@plt>
lea    0xeac(%rip),%rsi
mov    %rax,%rdi
call   1050 <fopen@plt>
test   %rax,%rax
je     1171 <io_appendto+0x31>
lea    0xe9a(%rip),%rsi
mov    %rax,%rdi
pop    %rax
jmp    1040 <setreturn@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <pushresult@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [8 x i8] c"_OUTPUT\00"
define void @io_appendto() {
%1 = alloca i8*
%2 = alloca i32*
%3 = call i8* @luaL_check_lstr(i32 3, i32* null)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32*, i32** %2
%10 = call i32 @setreturn(i32* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @pushresult(i32 0)
br label %13
13: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [8 x i8] c"_OUTPUT\00"
define void @io_appendto() {
%1 = tail call i8* @luaL_check_lstr(i32 3, i32* null)
%2 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @setreturn(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = tail call i32 @pushresult(i32 0)
br label %8
8: ; preds = %6, %4
ret void
}
float multiply(float a, float b) { return a * b; }


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @multiply(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 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @multiply(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void signal_handler_func(int signal_num) {
  printf("catch signal: %d\n", signal_num);
}


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

x86 assembly (clang, -O2):
<signal_handler_func>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"catch signal: %d\0A\00"
define void @signal_handler_func(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t ReadLE64(const unsigned char *ptr) { return *((uint64_t *)ptr); }


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

x86 assembly (clang, -O2):
<ReadLE64>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ReadLE64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void add(int *x, int *y, int *result) { *result = *x + *y; }


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

x86 assembly (clang, -O2):
<add>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @add(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @add(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
store i32 %6, i32* %2
ret void
}
int xtensa_simm12(v)
int v;
{ return v >= -2048 && v <= 2047; }


x86 assembly (clang, -O0):
<xtensa_simm12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xfffff800,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xtensa_simm12+0x26>
cmpl   $0x7ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_simm12>:
add    $0x800,%edi
xor    %eax,%eax
cmp    $0x1000,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xtensa_simm12(i32 %0) {
%2 = add i32 %0, 2048
%3 = icmp ult i32 %2, 4096
%4 = zext i1 %3 to i32
ret i32 %4
}