xunge/DecIR huggingface dataset:
DISCRETE_STEP(dst_switch) {
  if (DISCRETE_INPUT(0)) {
    set_output(0, DISCRETE_INPUT(1) ? DISCRETE_INPUT(3) : DISCRETE_INPUT(2));
  } else {
    set_output(0, 0);
  }
}


x86 assembly (clang, -O0):
<DISCRETE_STEP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <DISCRETE_INPUT@plt>
cmp    $0x0,%eax
je     1186 <DISCRETE_STEP+0x66>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <DISCRETE_INPUT@plt>
cmp    $0x0,%eax
je     1166 <DISCRETE_STEP+0x46>
mov    $0x3,%edi
mov    $0x0,%al
call   1030 <DISCRETE_INPUT@plt>
mov    %eax,-0xc(%rbp)
jmp    1175 <DISCRETE_STEP+0x55>
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <DISCRETE_INPUT@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1040 <set_output@plt>
jmp    1191 <DISCRETE_STEP+0x71>
xor    %esi,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1040 <set_output@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DISCRETE_STEP>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <DISCRETE_INPUT@plt>
test   %eax,%eax
je     1150 <DISCRETE_STEP+0x30>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <DISCRETE_INPUT@plt>
cmp    $0x1,%eax
mov    $0x3,%edi
sbb    $0x0,%edi
xor    %eax,%eax
call   1030 <DISCRETE_INPUT@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <set_output@plt>

LLVM IR (-O0):
define i32 @DISCRETE_STEP(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @DISCRETE_INPUT to i32 (i32, ...)*)(i32 0)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = call i32 (i32, ...) bitcast (i32 (...)* @DISCRETE_INPUT to i32 (i32, ...)*)(i32 1)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (i32, ...) bitcast (i32 (...)* @DISCRETE_INPUT to i32 (i32, ...)*)(i32 3)
br label %13
11: ; preds = %6
%12 = call i32 (i32, ...) bitcast (i32 (...)* @DISCRETE_INPUT to i32 (i32, ...)*)(i32 2)
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output to i32 (i32, i32, ...)*)(i32 0, i32 %14)
br label %18
16: ; preds = %1
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output to i32 (i32, i32, ...)*)(i32 0, i32 0)
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @DISCRETE_STEP(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @DISCRETE_INPUT to i32 (i32, ...)*)(i32 0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @DISCRETE_INPUT to i32 (i32, ...)*)(i32 1)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 2, i32 3
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @DISCRETE_INPUT to i32 (i32, ...)*)(i32 %7)
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 0, %1 ]
%11 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output to i32 (i32, i32, ...)*)(i32 0, i32 %10)
ret i32 undef
}
/* Variables and functions */
unsigned int TIMER0_Elapse(unsigned int);
unsigned int TIMER0_GetValue();
void delay(unsigned int seconds) {
  unsigned int ini = TIMER0_GetValue();
  do {
  } while (TIMER0_Elapse(ini) < seconds);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <TIMER0_GetValue@plt>
mov    %eax,-0x8(%rbp)
jmp    113a <delay+0x1a>
mov    -0x8(%rbp),%edi
call   1030 <TIMER0_Elapse@plt>
cmp    -0x4(%rbp),%eax
jb     1135 <delay+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <TIMER0_GetValue@plt>
mov    %eax,%ebp
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <TIMER0_Elapse@plt>
cmp    %ebx,%eax
jb     1130 <delay+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @TIMER0_GetValue()
store i32 %4, i32* %3
br label %5
5: ; preds = %6, %1
br label %6
6: ; preds = %5
%7 = load i32, i32* %3
%8 = call i32 @TIMER0_Elapse(i32 %7)
%9 = load i32, i32* %2
%10 = icmp ult i32 %8, %9
br i1 %10, label %5, label %11
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = tail call i32 (...) @TIMER0_GetValue()
br label %3
3: ; preds = %3, %1
%4 = tail call i32 @TIMER0_Elapse(i32 %2)
%5 = icmp ult i32 %4, %0
br i1 %5, label %3, label %6
6: ; preds = %3
ret void
}
void get_tcp_info(int socket, int *mss) { *mss = -1; }


x86 assembly (clang, -O0):
<get_tcp_info>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tcp_info>:
movl   $0xffffffff,(%rsi)
ret

LLVM IR (-O0):
define void @get_tcp_info(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 -1, i32* %5
ret void
}

LLVM IR (-O2):
define void @get_tcp_info(i32 %0, i32* nocapture writeonly %1) {
store i32 -1, i32* %1
ret void
}
int init_termios(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_termios() {
ret i32 0
}
/* Type definitions */
struct zdap_ioctl {
  int dummy;
};
struct ifreq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_ioctl(int, struct ifreq *);
int read_reg(int sock, struct ifreq *req) {
  struct zdap_ioctl *zdreq = 0;
  if (!set_ioctl(sock, req))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<read_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <set_ioctl@plt>
cmp    $0x0,%eax
jne    1148 <read_reg+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <read_reg+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_reg>:
push   %rax
call   1030 <set_ioctl@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.ifreq = type { i32 }
%struct.zdap_ioctl = type { i32 }
define i32 @read_reg(i32 %0, %struct.ifreq* %1) {
%3 = tail call i32 @set_ioctl(i32 %0, %struct.ifreq* %1)
%4 = icmp eq i32 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
void assert(int x) {
  if (!x) {
    extern void abort(void);
    abort();
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <assert+0x1a>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
push   %rax
call   1030 <abort@plt>

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

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


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @halt() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @halt() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char A[][30], int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%s\n", A[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <print+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
imul   $0x1e,%rax,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <print+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1e,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <print+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print([30 x i8]* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %0, i64 %7, i64 0
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a;
  a = 400;
  printf("%d\n", a);
  a = 200 * 300 * 400 * 500;
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x190,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movl   $0xcb417800,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x190,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xcb417800,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 400)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -884901888)
ret void
}
void foo064(int p) {}


x86 assembly (clang, -O0):
<foo064>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo064(i32 %0) {
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL= "
         "REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed Jan 21 "
         "12:04:13 CET 2015 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 "
         "USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 "
         "KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [427 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed Jan 21 12:04:13 CET 2015 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [427 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed Jan 21 12:04:13 CET 2015 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Certo.\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 = [8 x i8] c"Certo.\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 ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Certo.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned char char_width(unsigned char ch) {
  unsigned char mask = 0x80;
  unsigned char n = 0;
  while (ch & mask) {
    n++;
    mask >>= 1;
  }
  if (n == 0)
    return 1;
  return n;
}


x86 assembly (clang, -O0):
<char_width>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movb   $0x80,-0x3(%rbp)
movb   $0x0,-0x4(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     113c <char_width+0x3c>
mov    -0x4(%rbp),%al
add    $0x1,%al
mov    %al,-0x4(%rbp)
movzbl -0x3(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x3(%rbp)
jmp    1112 <char_width+0x12>
movzbl -0x4(%rbp),%eax
cmp    $0x0,%eax
jne    1152 <char_width+0x52>
movb   $0x1,-0x1(%rbp)
jmp    1158 <char_width+0x58>
mov    -0x4(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_width>:
test   $0x80,%dil
je     111f <char_width+0x1f>
mov    $0x80,%ecx
xor    %eax,%eax
nopl   (%rax)
shr    %ecx
add    $0xff,%al
test   %edi,%ecx
jne    1110 <char_width+0x10>
test   %al,%al
je     111f <char_width+0x1f>
neg    %al
ret
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @char_width(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %8, %5 ], [ 0, %1 ]
%7 = phi i32 [ %9, %5 ], [ 128, %1 ]
%8 = add i8 %6, 1
%9 = lshr i32 %7, 1
%10 = and i32 %9, %2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = icmp eq i8 %8, 0
br i1 %13, label %14, label %15
14: ; preds = %1, %12
br label %15
15: ; preds = %12, %14
%16 = phi i8 [ 1, %14 ], [ %8, %12 ]
ret i8 %16
}
int unsigned_cmp(const void *a, const void *b) {
  unsigned aval = *(const unsigned *)a;
  unsigned bval = *(const unsigned *)b;
  return aval < bval ? -1 : aval > bval;
}


x86 assembly (clang, -O0):
<unsigned_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1137 <unsigned_cmp+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1148 <unsigned_cmp+0x48>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unsigned_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = icmp ugt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Este es un fichero de prueba para git.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [40 x i8] c"Este es un fichero de prueba para git.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"Este es un fichero de prueba para git.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct plugin {
  int dummy;
};
struct command {
  int dummy;
};

/* Variables and functions */
int disconnect_all(char const *, int, char **);
int disconnect_all_cmd(int argc, char **argv, struct command *command,
                       struct plugin *plugin) {
  const char *desc = "Disconnect from all connected NVMeoF subsystems";
  return disconnect_all(desc, argc, argv);
}


x86 assembly (clang, -O0):
<disconnect_all_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <disconnect_all@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disconnect_all_cmd>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <disconnect_all@plt>

LLVM IR (-O0):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
@.str = [48 x i8] c"Disconnect from all connected NVMeoF subsystems\00"
define i32 @disconnect_all_cmd(i32 %0, i8** %1, %struct.command* %2, %struct.plugin* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.command*
%8 = alloca %struct.plugin*
%9 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.command* %2, %struct.command** %7
store %struct.plugin* %3, %struct.plugin** %8
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = load i8*, i8** %9
%11 = load i32, i32* %5
%12 = load i8**, i8*** %6
%13 = call i32 @disconnect_all(i8* %10, i32 %11, i8** %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
@.str = [48 x i8] c"Disconnect from all connected NVMeoF subsystems\00"
define i32 @disconnect_all_cmd(i32 %0, i8** %1, %struct.command* nocapture readnone %2, %struct.plugin* nocapture readnone %3) {
%5 = tail call i32 @disconnect_all(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int logi2(uint64_t p) {
  int r;
  r = 0;
  while (p > 0) {
    p >>= 1;
    ++r;
  }
  return r;
}


x86 assembly (clang, -O0):
<logi2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <logi2+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <logi2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logi2>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <logi2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <logi2+0x10>
ret

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

LLVM IR (-O2):
define i32 @logi2(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 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_error_message(char *error) { printf("http error: %s\n", error); }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"http error: %s\0A\00"
define void @show_error_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ seL4_Signal();
void _emit_(void) { seL4_Signal(); }


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

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

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

LLVM IR (-O2):
define void @_emit_() {
%1 = tail call i32 (...) @seL4_Signal()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void __attribute__((regparm(3))) memcpy_23(void *dest, void *src) {
  memcpy(dest, src, 23);
}


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

x86 assembly (clang, -O2):
<memcpy_23>:
mov    $0x17,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @memcpy_23(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 23)
ret void
}
void rotr(int *a, int *b, int *c) {
  int x;
  x = *c;
  *c = *b;
  *b = *a;
  *a = x;
}


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

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

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

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %0
store i32 %6, i32* %1
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double, ...);
char *dtostrf(double val, signed char width, unsigned char prec, char *sout) {
  asm(".global _printf_float");
  char fmt[20];
  sprintf(fmt, "%%%d.%df", width, prec);
  sprintf(sout, fmt, val);
  return sout;
}


x86 assembly (clang, -O0):
<dtostrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %dil,%cl
movsd  %xmm0,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
movsbl -0x9(%rbp),%eax
cvtsi2sd %eax,%xmm0
movzbl -0xa(%rbp),%edx
lea    0xebc(%rip),%rsi
mov    $0x1,%al
call   1030 <sprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtostrf>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rbx
mov    %esi,%edx
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
lea    0xed0(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%al
call   1030 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <sprintf@plt>
mov    %rbx,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%%%d.%df\00"
define i8* @dtostrf(double %0, i8 signext %1, i8 zeroext %2, i8* %3) {
%5 = alloca double
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8*
%9 = alloca [20 x i8]
store double %0, double* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%11 = load i8, i8* %6
%12 = sitofp i8 %11 to double
%13 = load i8, i8* %7
%14 = zext i8 %13 to i32
%15 = call i32 (i8*, i8*, double, ...) @sprintf(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %12, i32 %14)
%16 = load i8*, i8** %8
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%18 = load double, double* %5
%19 = call i32 (i8*, i8*, double, ...) @sprintf(i8* %16, i8* %17, double %18)
%20 = load i8*, i8** %8
ret i8* %20
}

LLVM IR (-O2):
@.str = [9 x i8] c"%%%d.%df\00"
define i8* @dtostrf(double %0, i8 signext %1, i8 zeroext %2, i8* returned writeonly %3) {
%5 = alloca [20 x i8]
tail call void asm sideeffect ".global _printf_float", "~{dirflag},~{fpsr},~{flags}"()
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = sitofp i8 %1 to double
%8 = zext i8 %2 to i32
%9 = call i32 (i8*, i8*, double, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %7, i32 %8)
%10 = call i32 (i8*, i8*, double, ...) @sprintf(i8* dereferenceable(1) %3, i8* %6, double %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void die(char *s) {
  write(2, s, strlen(s));
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int fun786() { return 786; }


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

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

LLVM IR (-O0):
define i32 @fun786() {
ret i32 786
}

LLVM IR (-O2):
define i32 @fun786() {
ret i32 786
}
int negalucas(int n) {
  if (n == 0) {
    return 2;
  }
  if (n == -1) {
    return -1;
  }
  return negalucas(n + 2) - negalucas(n + 1);
}


x86 assembly (clang, -O0):
<negalucas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <negalucas+0x21>
movl   $0x2,-0x4(%rbp)
jmp    116a <negalucas+0x5a>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1147 <negalucas+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <negalucas+0x5a>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
call   1030 <negalucas@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <negalucas@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<negalucas>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1125 <negalucas+0x15>
mov    %edi,%ebx
cmp    $0xffffffff,%edi
jne    112c <negalucas+0x1c>
mov    $0xffffffff,%ebp
jmp    1142 <negalucas+0x32>
mov    $0x2,%ebp
jmp    1142 <negalucas+0x32>
lea    0x2(%rbx),%edi
call   1030 <negalucas@plt>
mov    %eax,%ebp
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <negalucas@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @negalucas(i32 %0) {
switch i32 %0, label %5 [
i32 0, label %3
i32 -1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %2, %1, %5
%4 = phi i32 [ %10, %5 ], [ -1, %2 ], [ 2, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, 2
%7 = tail call i32 @negalucas(i32 %6)
%8 = add nuw nsw i32 %0, 1
%9 = tail call i32 @negalucas(i32 %8)
%10 = sub nsw i32 %7, %9
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void explain(void) {
  fprintf(stderr, "Usage: dsmark indices INDICES [ default_index "
                  "DEFAULT_INDEX ] [ set_tc_index ]\n");
}


x86 assembly (clang, -O0):
<explain>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<explain>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [80 x i8] c"Usage: dsmark indices INDICES [ default_index DEFAULT_INDEX ] [ set_tc_index ]\0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [80 x i8] c"Usage: dsmark indices INDICES [ default_index DEFAULT_INDEX ] [ set_tc_index ]\0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}
void math_triangulation_init() {}


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

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

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

LLVM IR (-O2):
define void @math_triangulation_init() {
ret void
}
void umocktypes_free_longdouble(long double *value) { (void)value; }


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

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

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

LLVM IR (-O2):
define void @umocktypes_free_longdouble(x86_fp80* nocapture %0) {
ret void
}
int UTF8_char_len(unsigned char c) {
  if (c < 0x80)
    return 1;
  if (c < 0xc0)
    return 0;
  if (c < 0xe0)
    return 2;
  if (c < 0xf0)
    return 3;
  if (c < 0xf8)
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<UTF8_char_len>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x80,%eax
jge    1125 <UTF8_char_len+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1198 <UTF8_char_len+0x98>
movzbl -0x5(%rbp),%eax
cmp    $0xc0,%eax
jge    1140 <UTF8_char_len+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1198 <UTF8_char_len+0x98>
movzbl -0x5(%rbp),%eax
cmp    $0xe0,%eax
jge    115b <UTF8_char_len+0x5b>
movl   $0x2,-0x4(%rbp)
jmp    1198 <UTF8_char_len+0x98>
movzbl -0x5(%rbp),%eax
cmp    $0xf0,%eax
jge    1176 <UTF8_char_len+0x76>
movl   $0x3,-0x4(%rbp)
jmp    1198 <UTF8_char_len+0x98>
movzbl -0x5(%rbp),%eax
cmp    $0xf8,%eax
jge    1191 <UTF8_char_len+0x91>
movl   $0x4,-0x4(%rbp)
jmp    1198 <UTF8_char_len+0x98>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTF8_char_len>:
mov    $0x1,%eax
test   %dil,%dil
js     110b <UTF8_char_len+0xb>
ret
xor    %eax,%eax
cmp    $0xc0,%dil
jb     110a <UTF8_char_len+0xa>
mov    $0x2,%eax
cmp    $0xe0,%dil
jb     110a <UTF8_char_len+0xa>
mov    $0x3,%eax
cmp    $0xf0,%dil
jb     110a <UTF8_char_len+0xa>
xor    %eax,%eax
cmp    $0xf8,%dil
setb   %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @UTF8_char_len(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 128
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %29
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 192
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %29
13: ; preds = %8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = icmp slt i32 %15, 224
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 2, i32* %2
br label %29
18: ; preds = %13
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = icmp slt i32 %20, 240
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 3, i32* %2
br label %29
23: ; preds = %18
%24 = load i8, i8* %3
%25 = zext i8 %24 to i32
%26 = icmp slt i32 %25, 248
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 4, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27, %22, %17, %12, %7
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @UTF8_char_len(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ult i8 %0, -64
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i8 %0, -32
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i8 %0, -16
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i8 %0, -8
%11 = select i1 %10, i32 4, i32 0
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 2, %5 ], [ 3, %7 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ __CrestInit();
void __globinit_cfg_test(void) {
  { __CrestInit(); }
}


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

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

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

LLVM IR (-O2):
define void @__globinit_cfg_test() {
%1 = tail call i32 (...) @__CrestInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ new_int(int);
int pop_int();
int /*<<< orphan*/ push(int /*<<< orphan*/);
void builtin_add() {
  int b = pop_int();
  int a = pop_int();
  push(new_int(a + b));
}


x86 assembly (clang, -O0):
<builtin_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pop_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
add    -0x4(%rbp),%edi
call   1040 <new_int@plt>
mov    %eax,%edi
call   1050 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_add>:
push   %rbx
xor    %eax,%eax
call   1030 <pop_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <pop_int@plt>
add    %eax,%ebx
mov    %ebx,%edi
call   1040 <new_int@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <push@plt>

LLVM IR (-O0):
define void @builtin_add() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @pop_int()
store i32 %3, i32* %1
%4 = call i32 (...) @pop_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = add nsw i32 %5, %6
%8 = call i32 @new_int(i32 %7)
%9 = call i32 @push(i32 %8)
ret void
}

LLVM IR (-O2):
define void @builtin_add() {
%1 = tail call i32 (...) @pop_int()
%2 = tail call i32 (...) @pop_int()
%3 = add nsw i32 %2, %1
%4 = tail call i32 @new_int(i32 %3)
%5 = tail call i32 @push(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
long readlong(FILE *fp) {
  unsigned char c[4];
  fread((char *)c, 1, sizeof c, fp);
  return (long)((c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3]);
}


x86 assembly (clang, -O0):
<readlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
movzbl -0xc(%rbp),%eax
shl    $0x18,%eax
movzbl -0xb(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlong>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
movzbl 0x4(%rsp),%eax
shl    $0x18,%eax
movzbl 0x5(%rsp),%ecx
shl    $0x10,%rcx
cltq
or     %rcx,%rax
movzbl 0x6(%rsp),%ecx
shl    $0x8,%rcx
or     %rax,%rcx
movzbl 0x7(%rsp),%eax
or     %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @readlong(i32* nocapture %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @fread(i8* %3, i32 1, i32 4, i32* %0)
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl nuw i32 %6, 24
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl nuw nsw i32 %10, 16
%12 = or i32 %11, %7
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl nuw nsw i32 %15, 8
%17 = or i32 %12, %16
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %17, %20
%22 = sext i32 %21 to i64
ret i64 %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printInt(void *i) {
  int *temp = (int *)i;
  printf("%d", *temp);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printInt(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal_error(char *error_message) {
  fprintf(stderr, "Error: %s\n", error_message);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal_error>:
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    $0x1,%edi
call   1040 <exit@plt>

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

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

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