xunge/DecIR huggingface dataset:
/* Type definitions */
struct catmc_atomic_long_long {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_long_long *);
void catmc_atomic_long_long_destroy(struct catmc_atomic_long_long *wrapper) {
  free(wrapper);
}


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

x86 assembly (clang, -O2):
<catmc_atomic_long_long_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.catmc_atomic_long_long = type { i32 }
define void @catmc_atomic_long_long_destroy(%struct.catmc_atomic_long_long* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_long_long* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ list_test1();
int /*<<< orphan*/ list_test2();
int /*<<< orphan*/ list_test3();
int /*<<< orphan*/ list_test4();
int main() {
  list_test1();
  list_test2();
  list_test3();
  list_test4();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <list_test1@plt>
mov    $0x0,%al
call   1030 <list_test2@plt>
mov    $0x0,%al
call   1060 <list_test3@plt>
mov    $0x0,%al
call   1040 <list_test4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <list_test1@plt>
xor    %eax,%eax
call   1030 <list_test2@plt>
xor    %eax,%eax
call   1060 <list_test3@plt>
xor    %eax,%eax
call   1040 <list_test4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @list_test1()
%3 = call i32 (...) @list_test2()
%4 = call i32 (...) @list_test3()
%5 = call i32 (...) @list_test4()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @list_test1()
%2 = tail call i32 (...) @list_test2()
%3 = tail call i32 (...) @list_test3()
%4 = tail call i32 (...) @list_test4()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ A7_GPS_GSM_Module_Power();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int powerONA7GSMModule() {
  printf("Power ON the A7 Module : ");
  A7_GPS_GSM_Module_Power();
  sleep(4);
}


x86 assembly (clang, -O0):
<powerONA7GSMModule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <A7_GPS_GSM_Module_Power@plt>
mov    $0x4,%edi
call   1050 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerONA7GSMModule>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <A7_GPS_GSM_Module_Power@plt>
mov    $0x4,%edi
pop    %rax
jmp    1050 <sleep@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Power ON the A7 Module : \00"
define i32 @powerONA7GSMModule() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @A7_GPS_GSM_Module_Power()
%4 = call i32 @sleep(i32 4)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [26 x i8] c"Power ON the A7 Module : \00"
define i32 @powerONA7GSMModule() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @A7_GPS_GSM_Module_Power()
%3 = tail call i32 @sleep(i32 4)
ret i32 undef
}
void Js_Exit(void) {}


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

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

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

LLVM IR (-O2):
define void @Js_Exit() {
ret void
}
char *units_select(void) { return "units"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"units\00"
define i8* @units_select() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void foo() {
  char *a = 0, *b = 0;
  strcpy(a, b);
}


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

x86 assembly (clang, -O2):
<foo>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @foo() {
%1 = alloca i8*
%2 = alloca i8*
store i8* null, i8** %1
store i8* null, i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcpy(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @strcpy(i8* null, i8* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gzFile;

/* Variables and functions */
scalar_t__ Z_OK;
scalar_t__ errno;
int /*<<< orphan*/ fatal_error_with_errno(char *, char const *);
scalar_t__ gzclose(int /*<<< orphan*/);
void xgzclose(void *_fp, const char *name) {
  gzFile gzf = (gzFile)_fp;
  errno = 0;
  if (gzclose(gzf) != Z_OK)
    fatal_error_with_errno("Error closing \"%s\"", name);
}


x86 assembly (clang, -O0):
<xgzclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    0x2e9a(%rip),%rax
movq   $0x0,(%rax)
mov    -0x14(%rbp),%edi
call   1030 <gzclose@plt>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
je     116d <xgzclose+0x4d>
mov    -0x10(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <fatal_error_with_errno@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgzclose>:
push   %rbx
mov    %rsi,%rbx
mov    0x2ead(%rip),%rax
movq   $0x0,(%rax)
call   1030 <gzclose@plt>
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%rax
jne    1145 <xgzclose+0x25>
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fatal_error_with_errno@plt>

LLVM IR (-O0):
@errno = global i64 0
@Z_OK = global i64 0
@.str = [19 x i8] c"Error closing \22%s\22\00"
define void @xgzclose(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %5
store i64 0, i64* @errno
%8 = load i32, i32* %5
%9 = call i64 @gzclose(i32 %8)
%10 = load i64, i64* @Z_OK
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@Z_OK = global i64 0
@.str = [19 x i8] c"Error closing \22%s\22\00"
define void @xgzclose(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
store i64 0, i64* @errno
%5 = tail call i64 @gzclose(i32 %4)
%6 = load i64, i64* @Z_OK
%7 = icmp eq i64 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %8, %2
ret void
}
double sqr(double r) {
  return r * r;
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<sqr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqr>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sqr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @sqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ idle();
int /*<<< orphan*/ uart_putchar(char);
int /*<<< orphan*/ uart_ready();
char uart_getchar(void) {
  volatile unsigned *recv_buffer_reg = (unsigned *)0x90020000;
  while (!uart_ready())
    idle();
  char tmp = *recv_buffer_reg;
  uart_putchar(tmp);
  return tmp;
}


x86 assembly (clang, -O0):
<uart_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x90020000,%eax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <uart_ready@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115d <uart_getchar+0x2d>
jmp    1169 <uart_getchar+0x39>
mov    $0x0,%al
call   1030 <idle@plt>
jmp    1141 <uart_getchar+0x11>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1040 <uart_putchar@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getchar>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <uart_ready@plt>
test   %eax,%eax
jne    1154 <uart_getchar+0x24>
xor    %eax,%eax
call   1030 <idle@plt>
jmp    1140 <uart_getchar+0x10>
mov    $0x90020000,%eax
mov    (%rax),%eax
movsbl %al,%ebx
mov    %ebx,%edi
call   1040 <uart_putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @uart_getchar() {
%1 = alloca i32*
%2 = alloca i8
store i32* inttoptr (i64 2416050176 to i32*), i32** %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @uart_ready()
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @idle()
br label %3
9: ; preds = %3
%10 = load i32*, i32** %1
%11 = load volatile i32, i32* %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = call i32 @uart_putchar(i8 signext %13)
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @uart_getchar() {
%1 = tail call i32 (...) @uart_ready()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @idle()
%5 = tail call i32 (...) @uart_ready()
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
%8 = load volatile i32, i32* inttoptr (i64 2416050176 to i32*)
%9 = trunc i32 %8 to i8
%10 = tail call i32 @uart_putchar(i8 signext %9)
ret i8 %9
}
int test_imm_99uint32_reg(unsigned int val) {
  return ((val) & (0x99 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_99uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x99,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_99uint32_reg(i32 %0) {
%2 = and i32 %0, 153
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int meizu_psh_run_calibration();
int do_calibrate(void) { return meizu_psh_run_calibration(); }


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

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

LLVM IR (-O0):
define i32 @do_calibrate() {
%1 = call i32 (...) @meizu_psh_run_calibration()
ret i32 %1
}

LLVM IR (-O2):
define i32 @do_calibrate() {
%1 = tail call i32 (...) @meizu_psh_run_calibration()
ret i32 %1
}
int str_find(char *str, char tok) {
  int i = 0;
  if (!str)
    return -1;
  while (*str) {
    if (*str == tok)
      return i;
    ++str;
    ++i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<str_find>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112c <str_find+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <str_find+0x7d>
jmp    1131 <str_find+0x31>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1176 <str_find+0x76>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    115c <str_find+0x5c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <str_find+0x7d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <str_find+0x31>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_find>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     1132 <str_find+0x32>
mov    (%rdi),%dl
test   %dl,%dl
je     1132 <str_find+0x32>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %sil,%dl
je     1133 <str_find+0x33>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <str_find+0x20>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @str_find(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4, %12
%8 = phi i8 [ %15, %12 ], [ %5, %4 ]
%9 = phi i32 [ %14, %12 ], [ 0, %4 ]
%10 = phi i8* [ %13, %12 ], [ %0, %4 ]
%11 = icmp eq i8 %8, %1
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = add nuw nsw i32 %9, 1
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %12, %4, %2
%18 = phi i32 [ -1, %2 ], [ -1, %4 ], [ %9, %7 ], [ -1, %12 ]
ret i32 %18
}
void XGetICValues() {}


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

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

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

LLVM IR (-O2):
define void @XGetICValues() {
ret void
}
void version_init_cmds_table(int db_id) { ((void)db_id); }


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

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

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

LLVM IR (-O2):
define void @version_init_cmds_table(i32 %0) {
ret void
}
__attribute__((weak)) void suiteSetUp(void) {}


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

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

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

LLVM IR (-O2):
define weak void @suiteSetUp() {
ret void
}
int test_imm_26int16_mem(short *val) {
  return ((*val) & (0x26 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_26int16_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, 38
%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_26int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 38
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct geometry_struct {
  int dummy;
};

/* Variables and functions */
int A_within_B(struct geometry_struct *, struct geometry_struct *, int);
int cone_within_sphere(struct geometry_struct *geometry_child,
                       struct geometry_struct *geometry_parent) {
  return A_within_B(geometry_child, geometry_parent, (int)300);
}


x86 assembly (clang, -O0):
<cone_within_sphere>:
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    $0x12c,%edx
call   1030 <A_within_B@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cone_within_sphere>:
mov    $0x12c,%edx
jmp    1030 <A_within_B@plt>

LLVM IR (-O0):
%struct.geometry_struct = type { i32 }
define i32 @cone_within_sphere(%struct.geometry_struct* %0, %struct.geometry_struct* %1) {
%3 = alloca %struct.geometry_struct*
%4 = alloca %struct.geometry_struct*
store %struct.geometry_struct* %0, %struct.geometry_struct** %3
store %struct.geometry_struct* %1, %struct.geometry_struct** %4
%5 = load %struct.geometry_struct*, %struct.geometry_struct** %3
%6 = load %struct.geometry_struct*, %struct.geometry_struct** %4
%7 = call i32 @A_within_B(%struct.geometry_struct* %5, %struct.geometry_struct* %6, i32 300)
ret i32 %7
}

LLVM IR (-O2):
%struct.geometry_struct = type { i32 }
define i32 @cone_within_sphere(%struct.geometry_struct* %0, %struct.geometry_struct* %1) {
%3 = tail call i32 @A_within_B(%struct.geometry_struct* %0, %struct.geometry_struct* %1, i32 300)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(int, char);
int /*<<< orphan*/ ft_putnbr_fd_rec(int, long);
void ft_putnbr_fd(int fd, long nbr) {
  if (nbr < 0) {
    ft_putchar_fd(fd, '-');
    ft_putnbr_fd_rec(fd, -nbr);
  } else
    ft_putnbr_fd_rec(fd, nbr);
}


x86 assembly (clang, -O0):
<ft_putnbr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    115c <ft_putnbr_fd+0x3c>
mov    -0x4(%rbp),%edi
mov    $0x2d,%esi
call   1030 <ft_putchar_fd@plt>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
sub    -0x10(%rbp),%rsi
call   1040 <ft_putnbr_fd_rec@plt>
jmp    1168 <ft_putnbr_fd+0x48>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <ft_putnbr_fd_rec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
test   %rsi,%rsi
jns    113c <ft_putnbr_fd+0x1c>
mov    %ebp,%edi
mov    $0x2d,%esi
call   1030 <ft_putchar_fd@plt>
neg    %rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ft_putnbr_fd_rec@plt>

LLVM IR (-O0):
define void @ft_putnbr_fd(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @ft_putchar_fd(i32 %8, i8 signext 45)
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = sub nsw i64 0, %11
%13 = call i32 @ft_putnbr_fd_rec(i32 %10, i64 %12)
br label %18
14: ; preds = %2
%15 = load i32, i32* %3
%16 = load i64, i64* %4
%17 = call i32 @ft_putnbr_fd_rec(i32 %15, i64 %16)
br label %18
18: ; preds = %14, %7
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_fd(i32 %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @ft_putchar_fd(i32 %0, i8 signext 45)
%6 = sub nsw i64 0, %1
br label %7
7: ; preds = %2, %4
%8 = phi i64 [ %6, %4 ], [ %1, %2 ]
%9 = tail call i32 @ft_putnbr_fd_rec(i32 %0, i64 %8)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ time_t;
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
void timespec_fromdouble(double interval, struct timespec *ts) {
  uint64_t nsec = ((uint64_t)(interval * 1000000000)) % 1000000000;
  ts->tv_sec = (time_t)interval;
  ts->tv_nsec = (long)nsec;
}


x86 assembly (clang, -O0):
<timespec_fromdouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cvttsd2si -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
movslq -0x14(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_fromdouble>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
cltq
imul   $0x44b82fa1,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x3c,%rcx
add    %edx,%ecx
imul   $0x3b9aca00,%ecx,%ecx
cvttsd2si %xmm0,%rdx
sub    %ecx,%eax
mov    %rdx,0x8(%rdi)
cltq
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @timespec_fromdouble(double %0, %struct.timespec* %1) {
%3 = alloca double
%4 = alloca %struct.timespec*
%5 = alloca i32
store double %0, double* %3
store %struct.timespec* %1, %struct.timespec** %4
%6 = load double, double* %3
%7 = fmul double %6, 1.000000e+09
%8 = fptosi double %7 to i32
%9 = srem i32 %8, 1000000000
store i32 %9, i32* %5
%10 = load double, double* %3
%11 = fptosi double %10 to i64
%12 = load %struct.timespec*, %struct.timespec** %4
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 1
store i64 %11, i64* %13
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = load %struct.timespec*, %struct.timespec** %4
%17 = getelementptr inbounds %struct.timespec, %struct.timespec* %16, i32 0, i32 0
store i64 %15, i64* %17
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @timespec_fromdouble(double %0, %struct.timespec* nocapture writeonly %1) {
%3 = fmul double %0, 1.000000e+09
%4 = fptosi double %3 to i32
%5 = srem i32 %4, 1000000000
%6 = fptosi double %0 to i64
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 %6, i64* %7
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i64 %8, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doWhileLoop(int);
int /*<<< orphan*/ forLoop();
int /*<<< orphan*/ whileLoop(int);
int main(void) {
  forLoop();
  whileLoop(1);
  doWhileLoop(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <forLoop@plt>
mov    $0x1,%edi
call   1040 <whileLoop@plt>
mov    $0x1,%edi
call   1030 <doWhileLoop@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @forLoop()
%2 = call i32 @whileLoop(i32 1)
%3 = call i32 @doWhileLoop(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @forLoop()
%2 = tail call i32 @whileLoop(i32 1)
%3 = tail call i32 @doWhileLoop(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ASL8(int /*<<< orphan*/);
int /*<<< orphan*/ Absolute(int);
void Op0EM1(void) { ASL8(Absolute(3)); }


x86 assembly (clang, -O0):
<Op0EM1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
call   1030 <ASL8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op0EM1>:
push   %rax
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ASL8@plt>

LLVM IR (-O0):
define void @Op0EM1() {
%1 = call i32 @Absolute(i32 3)
%2 = call i32 @ASL8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op0EM1() {
%1 = tail call i32 @Absolute(i32 3)
%2 = tail call i32 @ASL8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char foo[40] = "";
  itoa(829048, foo);
  printf("%s\n", foo);
  itoa(-4021, foo);
  printf("%s\n", foo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rsi
mov    $0xca678,%edi
call   1050 <itoa@plt>
lea    -0x30(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
mov    $0xfffff04b,%edi
call   1050 <itoa@plt>
lea    -0x30(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rsp,%rbx
mov    $0xca678,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xead(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0xfffff04b,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 829048, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @itoa(i32 -4021, i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int GLfloat;

/* Variables and functions */
GLfloat LINTERP(GLfloat t, GLfloat out, GLfloat in) {
  return out + t * (in - out);
}


x86 assembly (clang, -O0):
<LINTERP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
sub    -0x8(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LINTERP>:
sub    %esi,%edx
imul   %edi,%edx
lea    (%rdx,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @LINTERP(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = mul nsw i32 %4, %0
%6 = add nsw i32 %5, %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ GL_BLEND;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void bfunc(void) {
  static int state = 1;
  if (state ^= 1) {
    glEnable(GL_BLEND);
    glDisable(GL_DEPTH_TEST);
  } else {
    glDisable(GL_BLEND);
    glEnable(GL_DEPTH_TEST);
  }
}


x86 assembly (clang, -O0):
<bfunc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f06(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2efd(%rip)
cmp    $0x0,%eax
je     115d <bfunc+0x3d>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
jmp    1179 <bfunc+0x59>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfunc>:
push   %rax
xorl   $0x1,0x2f08(%rip)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
je     1147 <bfunc+0x27>
call   1030 <glEnable@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glDisable@plt>
call   1040 <glDisable@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glEnable@plt>

LLVM IR (-O0):
@bfunc.state = internal global i32 1
@GL_BLEND = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @bfunc() {
%1 = load i32, i32* @bfunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @bfunc.state
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = load i32, i32* @GL_BLEND
%6 = call i32 @glEnable(i32 %5)
%7 = load i32, i32* @GL_DEPTH_TEST
%8 = call i32 @glDisable(i32 %7)
br label %14
9: ; preds = %0
%10 = load i32, i32* @GL_BLEND
%11 = call i32 @glDisable(i32 %10)
%12 = load i32, i32* @GL_DEPTH_TEST
%13 = call i32 @glEnable(i32 %12)
br label %14
14: ; preds = %9, %4
ret void
}

LLVM IR (-O2):
@bfunc.state = internal unnamed_addr global i32 1
@GL_BLEND = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @bfunc() {
%1 = load i32, i32* @bfunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @bfunc.state
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @GL_BLEND
br i1 %3, label %9, label %5
5: ; preds = %0
%6 = tail call i32 @glEnable(i32 %4)
%7 = load i32, i32* @GL_DEPTH_TEST
%8 = tail call i32 @glDisable(i32 %7)
br label %13
9: ; preds = %0
%10 = tail call i32 @glDisable(i32 %4)
%11 = load i32, i32* @GL_DEPTH_TEST
%12 = tail call i32 @glEnable(i32 %11)
br label %13
13: ; preds = %9, %5
ret void
}
/* Variables and functions */
scalar_t__ pow(int, int);
int getVal(int srcVal, int digit) {
  return (srcVal / (int)pow(10, digit)) % 10;
}


x86 assembly (clang, -O0):
<getVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVal>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    %ebx,%eax
cltd
idiv   %ecx
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getVal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @pow(i32 10, i32 %6)
%8 = trunc i64 %7 to i32
%9 = sdiv i32 %5, %8
%10 = srem i32 %9, 10
ret i32 %10
}

LLVM IR (-O2):
define i32 @getVal(i32 %0, i32 %1) {
%3 = tail call i64 @pow(i32 10, i32 %1)
%4 = trunc i64 %3 to i32
%5 = sdiv i32 %0, %4
%6 = srem i32 %5, 10
ret i32 %6
}
/* Variables and functions */
double bp_sw_random_0_to_1();
int bp_sw_random_integer(int l) {
  double rand;
  rand = bp_sw_random_0_to_1();
  return (int)(l * rand);
}


x86 assembly (clang, -O0):
<bp_sw_random_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bp_sw_random_0_to_1@plt>
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bp_sw_random_integer>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <bp_sw_random_0_to_1@plt>
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bp_sw_random_integer(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = call double (...) @bp_sw_random_0_to_1()
store double %4, double* %3
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @bp_sw_random_integer(i32 %0) {
%2 = tail call double (...) @bp_sw_random_0_to_1()
%3 = sitofp i32 %0 to double
%4 = fmul double %2, %3
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t OS_init() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @OS_init() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t USBDevAddrGet(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  return ((*((volatile uint8_t *)(ui32Base + 0x00000000))));
}


x86 assembly (clang, -O0):
<USBDevAddrGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevAddrGet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @USBDevAddrGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 0
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @USBDevAddrGet(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}
void gtk_notebook_tab_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_tab_get_type() {
ret void
}
int test_imm_80uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x80 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_80uint64_midword_reg>:
test   $0x800000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_80uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8388608
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ADCIntClear(unsigned long ulBase, unsigned long ulIntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<ADCIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntClear>:
not    %rsi
and    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @ADCIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 0
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @ADCIntClear(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = inttoptr i64 %0 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, %3
store volatile i64 %6, i64* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
int /*<<< orphan*/ strtoll(char const *, char **, int);
intmax_t strtoimax(const char *restrict s, char **restrict p, int base) {
  return strtoll(s, p, base);
}


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

x86 assembly (clang, -O2):
<strtoimax>:
jmp    1030 <strtoll@plt>

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

LLVM IR (-O2):
define i32 @strtoimax(i8* noalias %0, i8** noalias nocapture %1, i32 %2) {
%4 = tail call i32 @strtoll(i8* %0, i8** %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ timeout(int /*<<< orphan*/);
void dcpu_runterm(void) {
  curs_set(0);
  timeout(0);
  noecho();
}


x86 assembly (clang, -O0):
<dcpu_runterm>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <curs_set@plt>
xor    %edi,%edi
call   1030 <timeout@plt>
mov    $0x0,%al
call   1040 <noecho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcpu_runterm>:
push   %rax
xor    %edi,%edi
call   1050 <curs_set@plt>
xor    %edi,%edi
call   1030 <timeout@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <noecho@plt>

LLVM IR (-O0):
define void @dcpu_runterm() {
%1 = call i32 @curs_set(i32 0)
%2 = call i32 @timeout(i32 0)
%3 = call i32 (...) @noecho()
ret void
}

LLVM IR (-O2):
define void @dcpu_runterm() {
%1 = tail call i32 @curs_set(i32 0)
%2 = tail call i32 @timeout(i32 0)
%3 = tail call i32 (...) @noecho()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_reductions_bool();
int /*<<< orphan*/ test_reductions_int();
int /*<<< orphan*/ test_reductions_minmax();
int main(void) {
  test_reductions_int();
  test_reductions_bool();
  test_reductions_minmax();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_reductions_int@plt>
mov    $0x0,%al
call   1050 <test_reductions_bool@plt>
mov    $0x0,%al
call   1040 <test_reductions_minmax@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_reductions_int@plt>
xor    %eax,%eax
call   1050 <test_reductions_bool@plt>
xor    %eax,%eax
call   1040 <test_reductions_minmax@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_reductions_int()
%3 = call i32 (...) @test_reductions_bool()
%4 = call i32 (...) @test_reductions_minmax()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_reductions_int()
%2 = tail call i32 (...) @test_reductions_bool()
%3 = tail call i32 (...) @test_reductions_minmax()
ret i32 0
}
int iwl_legacy_alloc_traffic_mem(struct iwl_priv *priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define i32 @iwl_legacy_alloc_traffic_mem(%struct.iwl_priv* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int fwrite(int /*<<< orphan*/ const *, int, size_t, void *);
int stream_write(void *priv, size_t len, const uint8_t *buf) {
  return fwrite(buf, 1, len, priv);
}


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

x86 assembly (clang, -O2):
<stream_write>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rcx
mov    %rax,%rdi
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define i32 @stream_write(i8* nocapture %0, i64 %1, i32* nocapture %2) {
%4 = tail call i32 @fwrite(i32* %2, i32 1, i64 %1, i8* %0)
ret i32 %4
}
int max(int x, int y) {
  if (x >= y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
char *expand_dollar_with_args(char const **, int /*<<< orphan*/,
                              int /*<<< orphan*/ *);
char *expand_dollar(const char **str) {
  return expand_dollar_with_args(str, 0, NULL);
}


x86 assembly (clang, -O0):
<expand_dollar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <expand_dollar_with_args@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_dollar>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <expand_dollar_with_args@plt>

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

LLVM IR (-O2):
define i8* @expand_dollar(i8** %0) {
%2 = tail call i8* @expand_dollar_with_args(i8** %0, i32 0, i32* null)
ret i8* %2
}
void ff_hevc_put_hevc_qpel_v8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v8_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_config_usage(void) {
  printf("\nUsage : sys_config [CONFIG_FILE]\n");
  printf("\nIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is "
         "performed.\n");
  printf("CONFIG_FILE is file contain all the Micro AP settings.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_config_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf40(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"\0AUsage : sys_config [CONFIG_FILE]\0A\00"
@.str.1 = [79 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\0A\00"
@.str.2 = [56 x i8] c"CONFIG_FILE is file contain all the Micro AP settings.\0A\00"
define void @print_sys_config_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"\0AUsage : sys_config [CONFIG_FILE]\00"
@str.3 = [78 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\00"
@str.4 = [55 x i8] c"CONFIG_FILE is file contain all the Micro AP settings.\00"
define void @print_sys_config_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.4, i64 0, i64 0))
ret void
}