xunge/DecIR huggingface dataset:
__attribute__((always_)) int
__test_and_clear_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  asm volatile("btr %2,%1\n\t"
               "sbb %0,%0"
               : "=r"(oldbit), "+m"(*(volatile long *)(addr))
               : "Ir"(nr));
  return oldbit;
}


x86 assembly (clang, -O0):
<__test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btr    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_clear_bit>:
btr    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "btr $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test_and_clear_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btr $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_window_ask_refresh(int);
void config_change_read_marker(void *data, struct t_config_option *option) {
  (void)data;
  (void)option;
  gui_window_ask_refresh(1);
}


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

x86 assembly (clang, -O2):
<config_change_read_marker>:
mov    $0x1,%edi
jmp    1030 <gui_window_ask_refresh@plt>

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @config_change_read_marker(i8* %0, %struct.t_config_option* %1) {
%3 = alloca i8*
%4 = alloca %struct.t_config_option*
store i8* %0, i8** %3
store %struct.t_config_option* %1, %struct.t_config_option** %4
%5 = load i8*, i8** %3
%6 = load %struct.t_config_option*, %struct.t_config_option** %4
%7 = call i32 @gui_window_ask_refresh(i32 1)
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_change_read_marker(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1) {
%3 = tail call i32 @gui_window_ask_refresh(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void __pca9685_set_pwm(int fd, uint8_t l, float pulse) {}


x86 assembly (clang, -O0):
<__pca9685_set_pwm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__pca9685_set_pwm(i32 %0, i32 %1, float %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debugPrint(char *);
int /*<<< orphan*/ next_glPopName();
int /*<<< orphan*/ printGLError();
void glPopName() {
  next_glPopName();
  printGLError();
  debugPrint("glPopName()\n");
}


x86 assembly (clang, -O0):
<glPopName>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <next_glPopName@plt>
mov    $0x0,%al
call   1040 <printGLError@plt>
lea    0xeb7(%rip),%rdi
call   1050 <debugPrint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glPopName>:
push   %rax
xor    %eax,%eax
call   1030 <next_glPopName@plt>
xor    %eax,%eax
call   1040 <printGLError@plt>
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1050 <debugPrint@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"glPopName()\0A\00"
define void @glPopName() {
%1 = call i32 (...) @next_glPopName()
%2 = call i32 (...) @printGLError()
%3 = call i32 @debugPrint(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"glPopName()\0A\00"
define void @glPopName() {
%1 = tail call i32 (...) @next_glPopName()
%2 = tail call i32 (...) @printGLError()
%3 = tail call i32 @debugPrint(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ char_left_gc(char *, int /*<<< orphan*/);
size_t char_right_gc(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *trim_whitespace_in_place(char *buffer) {
  buffer += char_left_gc(buffer, strlen(buffer));
  buffer[char_right_gc(buffer, strlen(buffer))] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<trim_whitespace_in_place>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1050 <char_left_gc@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <char_right_gc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_whitespace_in_place>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <char_left_gc@plt>
movslq %eax,%rbx
add    %r14,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <char_right_gc@plt>
movb   $0x0,(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @trim_whitespace_in_place(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 @char_left_gc(i8* %3, i32 %5)
%7 = load i8*, i8** %2
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %2
%10 = load i8*, i8** %2
%11 = load i8*, i8** %2
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = call i64 @char_right_gc(i8* %11, i32 %13)
%15 = getelementptr inbounds i8, i8* %10, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @trim_whitespace_in_place(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @char_left_gc(i8* %0, i32 %2)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strlen(i8* %5)
%7 = tail call i64 @char_right_gc(i8* %5, i32 %6)
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
/* Variables and functions */
float __infer_nondet_float();
float logf(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<logf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @logf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @logf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
unsigned gz_intmax() {
  unsigned p, q;
  p = 1;
  do {
    q = p;
    p <<= 1;
    p++;
  } while (p > q);
  return q >> 1;
}


x86 assembly (clang, -O0):
<gz_intmax>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     110b <gz_intmax+0xb>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gz_intmax() {
ret i32 2147483647
}
/* Variables and functions */
int /*<<< orphan*/ Log(char *);
int CloseNetwork() { Log("CloseNetwork: Closing network"); }


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

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

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

LLVM IR (-O2):
@.str = [30 x i8] c"CloseNetwork: Closing network\00"
define i32 @CloseNetwork() {
%1 = tail call i32 @Log(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void BootAbort(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<BootAbort>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <BootAbort+0x9>
jmp    1109 <BootAbort+0x9>

x86 assembly (clang, -O2):
<BootAbort>:
jmp    1100 <BootAbort>

LLVM IR (-O0):
define void @BootAbort() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @BootAbort() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, char *, char *, char *, long);
main() {
  print("hello", "hi", "greetings", "hola", 0L);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed9(%rip),%rsi
lea    0xed5(%rip),%rdx
lea    0xed8(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xee3(%rip),%rdx
lea    0xee6(%rip),%rcx
xor    %r8d,%r8d
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [3 x i8] c"hi\00"
@.str.2 = [10 x i8] c"greetings\00"
@.str.3 = [5 x i8] c"hola\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [3 x i8] c"hi\00"
@.str.2 = [10 x i8] c"greetings\00"
@.str.3 = [5 x i8] c"hola\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_char_vector(char *vector, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d ", vector[i]);
  }
}


x86 assembly (clang, -O0):
<print_char_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <print_char_vector+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_char_vector+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @nouveau_register_dsm_handler() {
ret void
}
void ff_hevc_pred_init_mips() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_pred_init_mips() {
ret void
}
int bitcount(unsigned x) {
  int b;
  for (b = 0; x; b++)
    x &= (x - 1);
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
void svg_stroke(void) {}


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

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

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

LLVM IR (-O2):
define void @svg_stroke() {
ret void
}
int is_empty(char *s) {
  while (*s) {
    if (*s != ' ')
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <is_empty+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1131 <is_empty+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1149 <is_empty+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <is_empty+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
movzbl (%rdi),%eax
cmp    $0x20,%al
jne    110d <is_empty+0xd>
add    $0x1,%rdi
jmp    1100 <is_empty>
test   %al,%al
jne    1117 <is_empty+0x17>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_empty(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %8
i8 32, label %5
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
int test_imm_A4int16_mem(short *val) {
  return ((*val) & (0xA4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A4int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 164
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ff_hevc_h_loop_filter_luma_12_sse2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_h_loop_filter_luma_12_sse2() {
ret void
}
long Long_from_MINUS_int(int a) { return (long)a; }


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

x86 assembly (clang, -O2):
<Long_from_MINUS_int>:
movslq %edi,%rax
ret

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

LLVM IR (-O2):
define i64 @Long_from_MINUS_int(i32 %0) {
%2 = sext i32 %0 to i64
ret i64 %2
}
/* Variables and functions */
void pwc_dec23_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @pwc_dec23_exit() {
ret void
}
/* Type definitions */
struct sockaddr_un {
  int dummy;
};

/* Variables and functions */
int send_fds(int, struct sockaddr_un *, int, int *, int, int /*<<< orphan*/ *,
             int /*<<< orphan*/);
int send_fd(int sock, struct sockaddr_un *saddr, int saddr_len, int fd) {
  return send_fds(sock, saddr, saddr_len, &fd, 1, NULL, 0);
}


x86 assembly (clang, -O0):
<send_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x18(%rbp),%rcx
mov    $0x1,%r8d
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <send_fds@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_fd>:
sub    $0x18,%rsp
mov    %ecx,0x14(%rsp)
movl   $0x0,(%rsp)
lea    0x14(%rsp),%rcx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <send_fds@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32 }
define i32 @send_fd(i32 %0, %struct.sockaddr_un* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.sockaddr_un*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.sockaddr_un* %1, %struct.sockaddr_un** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.sockaddr_un*, %struct.sockaddr_un** %6
%11 = load i32, i32* %7
%12 = call i32 @send_fds(i32 %9, %struct.sockaddr_un* %10, i32 %11, i32* %8, i32 1, i32* null, i32 0)
ret i32 %12
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32 }
define i32 @send_fd(i32 %0, %struct.sockaddr_un* %1, i32 %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = call i32 @send_fds(i32 %0, %struct.sockaddr_un* %1, i32 %2, i32* %5, i32 1, i32* null, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *program) {
  printf("Usage:\n%s [-i interface [null/eth0/eth1...]] [-p listenport] [-h "
         "help] \n",
         program);
  printf("example:\n");
  printf("\t%s -i eth0 -p 6000 \n", program);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf23(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"Usage:\0A%s [-i interface [null/eth0/eth1...]] [-p listenport] [-h help] \0A\00"
@.str.1 = [10 x i8] c"example:\0A\00"
@.str.2 = [22 x i8] c"\09%s -i eth0 -p 6000 \0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c"Usage:\0A%s [-i interface [null/eth0/eth1...]] [-p listenport] [-h help] \0A\00"
@.str.2 = [22 x i8] c"\09%s -i eth0 -p 6000 \0A\00"
@str = [9 x i8] c"example:\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_dobldobl_polyhedral_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(465, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_dobldobl_polyhedral_homotopy>:
mov    $0x1d1,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @celcon_dobldobl_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_c2phc(i32 465, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_dobldobl_polyhedral_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 465, i32* undef, i32* undef, double* undef)
ret i32 %1
}
int normCoord(int val, int size) {
  while (val < 0) {
    val += size;
  }
  while (val >= size) {
    val -= size;
  }
  return val;
}


x86 assembly (clang, -O0):
<normCoord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1122 <normCoord+0x22>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <normCoord+0xa>
jmp    1127 <normCoord+0x27>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1143 <normCoord+0x43>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <normCoord+0x27>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<normCoord>:
mov    %edi,%eax
mov    %esi,%ecx
neg    %ecx
cs nopw 0x0(%rax,%rax,1)
add    %esi,%eax
mov    %ecx,%edx
add    %eax,%edx
js     1110 <normCoord+0x10>
nopl   0x0(%rax,%rax,1)
sub    %esi,%eax
cmp    %esi,%eax
jge    1120 <normCoord+0x20>
ret

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

LLVM IR (-O2):
define i32 @normCoord(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp slt i32 %4, 0
%6 = add nsw i32 %4, %1
br i1 %5, label %3, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ %4, %3 ]
%9 = icmp slt i32 %8, %1
%10 = sub nsw i32 %8, %1
br i1 %9, label %11, label %7
11: ; preds = %7
ret i32 %8
}
int adreno_debugfs_init(struct kgsl_device *device) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kgsl_device = type opaque
define i32 @adreno_debugfs_init(%struct.kgsl_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func1(int);
void func(int x) { func1(x); }


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

x86 assembly (clang, -O2):
<func>:
jmp    1030 <func1@plt>

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

LLVM IR (-O2):
define void @func(i32 %0) {
%2 = tail call i32 @func1(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void move_down(void) {
  putchar(0x1b);
  putchar(0x5b);
  putchar(0x42);
}


x86 assembly (clang, -O0):
<move_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <putchar@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_down>:
push   %rax
mov    $0x1b,%edi
call   1030 <putchar@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @move_down() {
%1 = call i32 @putchar(i32 27)
%2 = call i32 @putchar(i32 91)
%3 = call i32 @putchar(i32 66)
ret void
}

LLVM IR (-O2):
define void @move_down() {
%1 = tail call i32 @putchar(i32 27)
%2 = tail call i32 @putchar(i32 91)
%3 = tail call i32 @putchar(i32 66)
ret void
}
int main(ac, av)
char **av;
{
  execv("/usr/local/pf/bin/pfcmd.pl", av);
  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)
mov    -0x10(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <execv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"/usr/local/pf/bin/pfcmd.pl\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 = load i8**, i8*** %5
%7 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execv to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"/usr/local/pf/bin/pfcmd.pl\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execv to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 0
}
void atomic_init() {}


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

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

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

LLVM IR (-O2):
define void @atomic_init() {
ret void
}
/* Variables and functions */
char *realpath(char const *, char *);
char *get_realpath(const char *path) {
  static char buf[1024];
  return realpath(path, buf);
}


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

x86 assembly (clang, -O2):
<get_realpath>:
lea    0x2f29(%rip),%rsi
jmp    1030 <realpath@plt>

LLVM IR (-O0):
@get_realpath.buf = internal global [1024 x i8] zeroinitializer
define i8* @get_realpath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @realpath(i8* %3, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_realpath.buf, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@get_realpath.buf = internal global [1024 x i8] zeroinitializer
define i8* @get_realpath(i8* nocapture %0) {
%2 = tail call i8* @realpath(i8* %0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_realpath.buf, i64 0, i64 0))
ret i8* %2
}
void nop(void) { __asm volatile("nop" ::); }


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

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

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

LLVM IR (-O2):
define void @nop() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int INT64_MIN;
void minus_minimum_Good() {
  int64_t x = -1;
  int64_t y = x - INT64_MIN;
}


x86 assembly (clang, -O0):
<minus_minimum_Good>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@INT64_MIN = global i32 0
define void @minus_minimum_Good() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @INT64_MIN
%5 = sub nsw i32 %3, %4
store i32 %5, i32* %2
ret void
}

LLVM IR (-O2):
@INT64_MIN = global i32 0
define void @minus_minimum_Good() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t forwardf64_t(uint64_t number) {
  if (number >> 63)
    return number ^ 0xffffffffffffffff;
  return number ^ 0x8000000000000000;
}


x86 assembly (clang, -O0):
<forwardf64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
cmp    $0x0,%eax
je     112a <forwardf64_t+0x2a>
movslq -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %eax,-0x4(%rbp)
jmp    113e <forwardf64_t+0x3e>
movslq -0x8(%rbp),%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<forwardf64_t>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @forwardf64_t(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 63
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = xor i64 %9, -1
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
br label %17
12: ; preds = %1
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = xor i64 %14, -9223372036854775808
%16 = trunc i64 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %12, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @forwardf64_t(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
long double asinl(long double);
long double sqrtl(long double);
long double atanl(long double x) { return asinl(x / sqrtl(x * x + 1)); }


x86 assembly (clang, -O0):
<atanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fstpt  -0x1c(%rbp)
fmul   %st,%st(0)
fld1
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sqrtl@plt>
fldt   -0x1c(%rbp)
fdivp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <asinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fmul   %st,%st(0)
fld1
faddp  %st,%st(1)
fstpt  (%rsp)
call   1030 <sqrtl@plt>
fldt   0x1c(%rsp)
fdivp  %st,%st(1)
fstpt  (%rsp)
call   1040 <asinl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %4, x86_fp80 %5, x86_fp80 0xK3FFF8000000000000000)
%7 = call x86_fp80 @sqrtl(x86_fp80 %6)
%8 = fdiv x86_fp80 %3, %7
%9 = call x86_fp80 @asinl(x86_fp80 %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %0, x86_fp80 0xK3FFF8000000000000000)
%3 = tail call x86_fp80 @sqrtl(x86_fp80 %2)
%4 = fdiv x86_fp80 %0, %3
%5 = tail call x86_fp80 @asinl(x86_fp80 %4)
ret x86_fp80 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
uint32_t copy_uint32_t(const uint32_t _val) { return _val; }


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

x86 assembly (clang, -O2):
<copy_uint32_t>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @copy_uint32_t(i32 returned %0) {
ret i32 %0
}
int simpleloop(int x, int y) {
  while (x < y) {
    if (x < 3)
      x++;
    else
      x += 2;
  }
  return x;
}


x86 assembly (clang, -O0):
<simpleloop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113c <simpleloop+0x3c>
cmpl   $0x3,-0x4(%rbp)
jge    112e <simpleloop+0x2e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <simpleloop+0x37>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    110a <simpleloop+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpleloop>:
mov    %edi,%eax
cmp    %esi,%edi
jge    1121 <simpleloop+0x21>
cs nopw 0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0x3,%eax
setge  %cl
add    %ecx,%eax
add    $0x1,%eax
cmp    %esi,%eax
jl     1110 <simpleloop+0x10>
ret

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

LLVM IR (-O2):
define i32 @simpleloop(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = icmp sgt i32 %5, 2
%7 = select i1 %6, i32 2, i32 1
%8 = add nsw i32 %7, %5
%9 = icmp slt i32 %8, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i32 [ %0, %2 ], [ %8, %4 ]
ret i32 %11
}
char *getdrivername(void) { return "X11"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"X11\00"
define i8* @getdrivername() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"X11\00"
define i8* @getdrivername() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double floor(double);
double double_modulus(double a, double b) { return a - floor(a / b) * b; }


x86 assembly (clang, -O0):
<double_modulus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_modulus>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @double_modulus(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %1, double %0)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibLzma/"
             "src/xz/.libs/lt-xz.c",
             311, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x137,%esi
lea    0xf3f(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf5a(%rip),%rdx
mov    $0x137,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibLzma/src/xz/.libs/lt-xz.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibLzma/src/xz/.libs/lt-xz.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
int take_c(int ii, char cc) {
  printf("%s -- start\n", __func__);
  printf("%s -- end\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<take_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<take_c>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeee(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.take_c = [7 x i8] c"take_c\00"
@.str.1 = [11 x i8] c"%s -- end\0A\00"
define i32 @take_c(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_c, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_c, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.take_c = [7 x i8] c"take_c\00"
@.str.1 = [11 x i8] c"%s -- end\0A\00"
define i32 @take_c(i32 %0, i8 signext %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_c, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_c, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int printf(char *);
int main() {
  return printf("Hello"
                ","
                " world\n");
}


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>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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