xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ addressOfi;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  float i = 12.01;
  float *addressOfi = &i;
  printf("i is %f, and is %zu bytes\n", i, sizeof(i));
  printf("The addressOfI is %p, and is %zu bytes\n", addressOfi,
         sizeof(addressOfi));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb9(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x414028f6,0x4(%rsp)
41
lea    0xee8(%rip),%rdi
movsd  0xed8(%rip),%xmm0
mov    $0x4,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"i is %f, and is %zu bytes\0A\00"
@.str.1 = [40 x i8] c"The addressOfI is %p, and is %zu bytes\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x4028051EC0000000, float* %6
store float* %6, float** %7
%8 = load float, float* %6
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %9, i64 4)
%11 = load float*, float** %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), float* %11, i64 8)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@.str = [27 x i8] c"i is %f, and is %zu bytes\0A\00"
@.str.1 = [40 x i8] c"The addressOfI is %p, and is %zu bytes\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
store float 0x4028051EC0000000, float* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double 0x4028051EC0000000, i64 4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), float* %3, i64 8)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ test2();
int main() { test2(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xfc() {
  Assert_real((isalnum(252) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              1265, ("isalnum should be 0 for 0xfc"));
}


x86 assembly (clang, -O0):
<t_isalnum_0xfc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfc,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4f1,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0xfc>:
push   %rax
mov    $0xfc,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4f1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xfc\00"
define void @t_isalnum_0xfc() {
%1 = call i64 @isalnum(i32 252)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1265, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xfc\00"
define void @t_isalnum_0xfc() {
%1 = tail call i64 @isalnum(i32 252)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1265, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void UARTIntClear(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000044))) = ulIntFlags;
}


x86 assembly (clang, -O0):
<UARTIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x44(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntClear>:
mov    %rsi,0x44(%rdi)
ret

LLVM IR (-O0):
define void @UARTIntClear(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 = load i64, i64* %3
%7 = add i64 %6, 68
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTIntClear(i64 %0, i64 %1) {
%3 = add i64 %0, 68
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_gwk_cipher_usage(void) {
  printf("\nUsage : sys_cfg_gwk_cipher [GROUP_CIPHER]\n");
  printf("\n         GROUP_CIPHER :");
  printf("\n                       4 - TKIP");
  printf("\n                       8 - AES CCMP");
  printf("\n         empty - Get current group cipher settings\n");
  return;
}


x86 assembly (clang, -O0):
<print_sys_cfg_gwk_cipher_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
call   1030 <printf@plt>
lea    0xf40(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sys_cfg_gwk_cipher_usage>:
push   %rax
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
lea    0xeee(%rip),%rdi
call   1040 <printf@plt>
lea    0xf32(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\0AUsage : sys_cfg_gwk_cipher [GROUP_CIPHER]\0A\00"
@.str.1 = [25 x i8] c"\0A GROUP_CIPHER :\00"
@.str.2 = [33 x i8] c"\0A 4 - TKIP\00"
@.str.3 = [37 x i8] c"\0A 8 - AES CCMP\00"
@.str.4 = [53 x i8] c"\0A empty - Get current group cipher settings\0A\00"
define void @print_sys_cfg_gwk_cipher_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"\0A GROUP_CIPHER :\00"
@.str.2 = [33 x i8] c"\0A 4 - TKIP\00"
@.str.3 = [37 x i8] c"\0A 8 - AES CCMP\00"
@str = [43 x i8] c"\0AUsage : sys_cfg_gwk_cipher [GROUP_CIPHER]\00"
@str.5 = [52 x i8] c"\0A empty - Get current group cipher settings\00"
define void @print_sys_cfg_gwk_cipher_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.5, i64 0, i64 0))
ret void
}
int test_imm_04int8_mem(signed char *val) {
  return ((*val) & (0x04 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_04int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 4
%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_04int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 4
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Standard targets: DROP, ACCEPT, RETURN or CONTINUE;\n"
         "The target can also be a user defined chain.\n");
}


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

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

LLVM IR (-O0):
@.str = [98 x i8] c"Standard targets: DROP, ACCEPT, RETURN or CONTINUE;\0AThe target can also be a user defined chain.\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [97 x i8] c"Standard targets: DROP, ACCEPT, RETURN or CONTINUE;\0AThe target can also be a user defined chain.\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
void test() {
  void *leak;
  int i;
  for (i = 0; i < 1000; i++)
    leak = (void *)malloc(1);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1148 <test+0x38>
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <test+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <malloc@plt>
add    $0xffffffff,%ebx
jne    1120 <test+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i8*
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i64 @malloc(i32 1)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %1
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @test() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i64 @malloc(i32 1)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ serv_touch_idle();
int /*<<< orphan*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *);
void serv_chat_send(int id, char *message) {
  char buf[2048];
  snprintf(buf, sizeof(buf), "toc_chat_send %d \"%s\"", id, message);
  sflap_send(buf, -1, 2);
  serv_touch_idle();
}


x86 assembly (clang, -O0):
<serv_chat_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x800,%esi
lea    0xea4(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x810(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
mov    $0x0,%al
call   1040 <serv_touch_idle@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_chat_send>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xebc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x800,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
xor    %eax,%eax
call   1040 <serv_touch_idle@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"toc_chat_send %d \22%s\22\00"
define void @serv_chat_send(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 2048, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 @sflap_send(i8* %10, i32 -1, i32 2)
%12 = call i32 (...) @serv_touch_idle()
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"toc_chat_send %d \22%s\22\00"
define void @serv_chat_send(i32 %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 2048, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = call i32 @sflap_send(i8* %4, i32 -1, i32 2)
%7 = call i32 (...) @serv_touch_idle()
ret void
}
unsigned long long unsigned_poly(unsigned long long sum, unsigned long x) {
  sum += (unsigned long long)(unsigned long)sum * (unsigned long long)x;
  return sum;
}


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

x86 assembly (clang, -O2):
<unsigned_poly>:
imul   %rdi,%rsi
lea    (%rsi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @unsigned_poly(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul i64 %5, %6
%8 = load i64, i64* %3
%9 = add i64 %8, %7
store i64 %9, i64* %3
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
define i64 @unsigned_poly(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = add i64 %3, %0
ret i64 %4
}
void atmc_add64(volatile unsigned long long *address,
                unsigned long long value) {
  __asm__ __volatile__("lock ; "
                       "addq %1,%0"
                       : "=m"(*address)
                       : "ir"(value), "m"(*address));
}


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

x86 assembly (clang, -O2):
<atmc_add64>:
lock add %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @atmc_add64(i64* %0, i64 %1) {
tail call void asm sideeffect "lock ; addq $1,$0", "=*m,ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %1, i64* elementtype(i64) %0)
ret void
}
int permute_char_comp(const void *a, const void *b) {
  return (*(char *)a - *(char *)b);
}


x86 assembly (clang, -O0):
<permute_char_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<permute_char_comp>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @permute_char_comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @permute_char_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void RTAvlrooGCPtrGetBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrooGCPtrGetBestFit() {
ret void
}
__attribute__((no)) long long foo(int x, int y) { return x / y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
cltd
idiv   %esi
cltq
ret

LLVM IR (-O0):
define i64 @foo(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 = sdiv i32 %5, %6
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @foo(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ read_blk(int, int, void *);
int cstart() {
  static volatile void *buf1 = (void *)02000;
  static volatile void *buf2 = (void *)03000;
  read_blk(0, 1, (void *)buf1);
  read_blk(1, 0, (void *)buf2);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<cstart>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0d(%rip),%rdx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <read_blk@plt>
mov    0x2f02(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <read_blk@plt>
jmp    113a <cstart+0x2a>

x86 assembly (clang, -O2):
<cstart>:
push   %rax
mov    $0x400,%edx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <read_blk@plt>
mov    $0x600,%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <read_blk@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1140 <cstart+0x30>

LLVM IR (-O0):
@cstart.buf1 = internal global i8* inttoptr (i64 1024 to i8*)
@cstart.buf2 = internal global i8* inttoptr (i64 1536 to i8*)
define i32 @cstart() {
%1 = load i8*, i8** @cstart.buf1
%2 = call i32 @read_blk(i32 0, i32 1, i8* %1)
%3 = load i8*, i8** @cstart.buf2
%4 = call i32 @read_blk(i32 1, i32 0, i8* %3)
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
define i32 @cstart() {
%1 = tail call i32 @read_blk(i32 0, i32 1, i8* inttoptr (i64 1024 to i8*))
%2 = tail call i32 @read_blk(i32 1, i32 0, i8* inttoptr (i64 1536 to i8*))
br label %3
3: ; preds = %0, %3
br label %3
}
int x23_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x23_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ static_incr_bad();
void call_set_bad() { static_incr_bad(); }


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

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

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

LLVM IR (-O2):
define void @call_set_bad() {
%1 = tail call i32 (...) @static_incr_bad()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEC_();
int /*<<< orphan*/ c64_memZero();
void DEC_zp(void) {
  c64_memZero();
  DEC_();
}


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

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

LLVM IR (-O0):
define void @DEC_zp() {
%1 = call i32 (...) @c64_memZero()
%2 = call i32 (...) @DEC_()
ret void
}

LLVM IR (-O2):
define void @DEC_zp() {
%1 = tail call i32 (...) @c64_memZero()
%2 = tail call i32 (...) @DEC_()
ret void
}
/* Type definitions */
struct MEMMAN {
  int dummy;
};

/* Variables and functions */
int memman_free(struct MEMMAN *, unsigned int, unsigned int);
int memman_free_4k(struct MEMMAN *man, unsigned int addr, unsigned int size) {
  int i;
  size = (size + 0xfff) & 0xfffff000;
  i = memman_free(man, addr, size);
  return i;
}


x86 assembly (clang, -O0):
<memman_free_4k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0xfff,%eax
and    $0xfffff000,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <memman_free@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memman_free_4k>:
add    $0xfff,%edx
and    $0xfffff000,%edx
jmp    1030 <memman_free@plt>

LLVM IR (-O0):
%struct.MEMMAN = type { i32 }
define i32 @memman_free_4k(%struct.MEMMAN* %0, i32 %1, i32 %2) {
%4 = alloca %struct.MEMMAN*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.MEMMAN* %0, %struct.MEMMAN** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = add i32 %8, 4095
%10 = and i32 %9, -4096
store i32 %10, i32* %6
%11 = load %struct.MEMMAN*, %struct.MEMMAN** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @memman_free(%struct.MEMMAN* %11, i32 %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
%struct.MEMMAN = type { i32 }
define i32 @memman_free_4k(%struct.MEMMAN* %0, i32 %1, i32 %2) {
%4 = add i32 %2, 4095
%5 = and i32 %4, -4096
%6 = tail call i32 @memman_free(%struct.MEMMAN* %0, i32 %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int _flush_cache(char *addr, const int nbytes, const int op) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<_flush_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_flush_cache>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @_flush_cache(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @_flush_cache(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
double combination(int, int);
double probability(int k, int h, int i, int N) {
  if (k + i > N) {
    return (0.0);
  } else {
    return (combination(k, h - i) * combination(N - k, i));
  }
}


x86 assembly (clang, -O0):
<probability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1140 <probability+0x30>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <probability+0x62>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
sub    -0x14(%rbp),%esi
call   1030 <combination@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <combination@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<probability>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %edi,%r15d
lea    (%r14,%r15,1),%eax
xorpd  %xmm0,%xmm0
cmp    %ecx,%eax
jg     1151 <probability+0x41>
mov    %ecx,%ebx
sub    %r14d,%esi
mov    %r15d,%edi
call   1030 <combination@plt>
movsd  %xmm0,0x8(%rsp)
sub    %r15d,%ebx
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <combination@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @probability(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %9
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %4
store double 0.000000e+00, double* %5
br label %28
16: ; preds = %4
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = sub nsw i32 %18, %19
%21 = call double @combination(i32 %17, i32 %20)
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = sub nsw i32 %22, %23
%25 = load i32, i32* %8
%26 = call double @combination(i32 %24, i32 %25)
%27 = fmul double %21, %26
store double %27, double* %5
br label %28
28: ; preds = %16, %15
%29 = load double, double* %5
ret double %29
}

LLVM IR (-O2):
define double @probability(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, %0
%6 = icmp sgt i32 %5, %3
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = sub nsw i32 %1, %2
%9 = tail call double @combination(i32 %0, i32 %8)
%10 = sub nsw i32 %3, %0
%11 = tail call double @combination(i32 %10, i32 %2)
%12 = fmul double %9, %11
br label %13
13: ; preds = %4, %7
%14 = phi double [ %12, %7 ], [ 0.000000e+00, %4 ]
ret double %14
}
void abc(int *a, int **b) { printf("%d %d %d %d %d\n", a, &a, *b, b, &b); }


x86 assembly (clang, -O0):
<abc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%r8
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%r9
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abc>:
sub    $0x18,%rsp
mov    %rsi,%r8
mov    %rdi,%rsi
mov    %rdi,0x10(%rsp)
mov    %r8,0x8(%rsp)
mov    (%r8),%rcx
lea    0xed2(%rip),%rdi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%r9
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%d %d %d %d %d\0A\00"
define void @abc(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 = load i32*, i32** %6
%8 = load i32**, i32*** %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %5, i32** %3, i32* %7, i32** %8, i32*** %4)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d %d %d %d %d\0A\00"
define void @abc(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = load i32*, i32** %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %0, i32** %3, i32* %5, i32** %1, i32*** %4)
ret void
}
int test_imm_C8uint32_mem(unsigned int *val) {
  return ((*val) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 200
%6 = icmp ne i32 %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_C8uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 200
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int is_asm_enabled() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_asm_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TaskletC__Tasklet__schedule();
void RFA1DriverLayerP__Tasklet__schedule(void) {
  TaskletC__Tasklet__schedule();
}


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

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

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

LLVM IR (-O2):
define void @RFA1DriverLayerP__Tasklet__schedule() {
%1 = tail call i32 (...) @TaskletC__Tasklet__schedule()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CX4_immediate_reg(int);
void CX4_op64(void) { CX4_immediate_reg(9); }


x86 assembly (clang, -O0):
<CX4_op64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
call   1030 <CX4_immediate_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CX4_op64>:
mov    $0x9,%edi
jmp    1030 <CX4_immediate_reg@plt>

LLVM IR (-O0):
define void @CX4_op64() {
%1 = call i32 @CX4_immediate_reg(i32 9)
ret void
}

LLVM IR (-O2):
define void @CX4_op64() {
%1 = tail call i32 @CX4_immediate_reg(i32 9)
ret void
}
/* Variables and functions */
scalar_t__ PopOldest(int /*<<< orphan*/ *);
void RTSystemMessageQueue_Empty() {
  while (PopOldest(NULL))
    ;
}


x86 assembly (clang, -O0):
<RTSystemMessageQueue_Empty>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <RTSystemMessageQueue_Empty+0x9>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <PopOldest@plt>
cmp    $0x0,%rax
je     1131 <RTSystemMessageQueue_Empty+0x21>
jmp    1119 <RTSystemMessageQueue_Empty+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTSystemMessageQueue_Empty>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <PopOldest@plt>
test   %rax,%rax
jne    1120 <RTSystemMessageQueue_Empty+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @RTSystemMessageQueue_Empty() {
br label %1
1: ; preds = %4, %0
%2 = call i64 @PopOldest(i32* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @RTSystemMessageQueue_Empty() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @PopOldest(i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_pressure(int, char **);
int main(int argc, char *argv[]) { test_pressure(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_pressure(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
void decsed(int pn1) { do_csi("?%dJ", pn1); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"?%dJ\00"
define void @decsed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"?%dJ\00"
define void @decsed(i32 %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ getgid();
int /*<<< orphan*/ xwrite_id_map(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
void xwrite_gid_map(pid_t pid, gid_t container, gid_t executor) {
  xwrite_id_map(pid, "/usr/bin/newgidmap", getgid(), container, executor);
}


x86 assembly (clang, -O0):
<xwrite_gid_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getgid@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xeaf(%rip),%rsi
call   1040 <xwrite_id_map@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xwrite_gid_map>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getgid@plt>
lea    0xec7(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <xwrite_id_map@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"/usr/bin/newgidmap\00"
define void @xwrite_gid_map(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 (...) @getgid()
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @xwrite_id_map(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"/usr/bin/newgidmap\00"
define void @xwrite_gid_map(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @getgid()
%5 = tail call i32 @xwrite_id_map(i32 %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1, i32 %2)
ret void
}
int test_imm_A4uint8_reg(unsigned char val) {
  return ((val) & (0xA4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A4uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%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_A4uint8_reg>:
test   $0xa4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A4uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 164
%6 = icmp ne i32 %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_A4uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -92
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ after_fork();
int /*<<< orphan*/ call_fork();
int main(int argc, char **argv) {
  call_fork();
  after_fork();
  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    $0x0,%al
call   1030 <call_fork@plt>
mov    $0x0,%al
call   1040 <after_fork@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @call_fork()
%4 = tail call i32 (...) @after_fork()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int RepFclose(FILE *F) {
  if (!F)
    return (0);
  return (fclose(F));
}


x86 assembly (clang, -O0):
<RepFclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <RepFclose+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <RepFclose+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RepFclose>:
test   %rdi,%rdi
je     111a <RepFclose+0xa>
jmp    1030 <fclose@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @RepFclose(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fclose(i32* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int main() {
  int a;
  int b = 1;
  int c = 2;
  int d = 3;
  a = 10 / 2;
  c = (b + 3) * 4 - 5;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3,%eax
shl    $0x2,%eax
sub    $0x5,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _mm_clzero(void *);
void foo(void *k) { _mm_clzero(k); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <_mm_clzero@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
__m128i __attribute__((no, unused)) test15(__m128i s1) {
  return _mm_slli_epi32(s1, 15);
}


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

x86 assembly (clang, -O2):
<test15>:
mov    $0xf,%esi
jmp    1030 <_mm_slli_epi32@plt>

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

LLVM IR (-O2):
define i32 @test15(i32 %0) {
%2 = tail call i32 @_mm_slli_epi32(i32 %0, i32 15)
ret i32 %2
}
void gameTimeUpdate(int *time) { *time += 1; }


x86 assembly (clang, -O0):
<gameTimeUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gameTimeUpdate>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @gameTimeUpdate(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3(float *, float, float, float);
__attribute__((always_)) struct vec3 *psvec3(struct vec3 *result, float x,
                                             float y, float z) {
  vec3((float *)result, x, y, z);
  return result;
}


x86 assembly (clang, -O0):
<psvec3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <vec3@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3(%struct.vec3* %0, float %1, float %2, float %3) {
%5 = alloca %struct.vec3*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store %struct.vec3* %0, %struct.vec3** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load %struct.vec3*, %struct.vec3** %5
%10 = bitcast %struct.vec3* %9 to float*
%11 = load float, float* %6
%12 = load float, float* %7
%13 = load float, float* %8
%14 = call i32 @vec3(float* %10, float %11, float %12, float %13)
%15 = load %struct.vec3*, %struct.vec3** %5
ret %struct.vec3* %15
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3(%struct.vec3* returned %0, float %1, float %2, float %3) {
%5 = bitcast %struct.vec3* %0 to float*
%6 = tail call i32 @vec3(float* %5, float %1, float %2, float %3)
ret %struct.vec3* %0
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int decode_readlink(struct tcb *, int /*<<< orphan*/);
int sys_readlink(struct tcb *tcp) { return decode_readlink(tcp, 0); }


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

x86 assembly (clang, -O2):
<sys_readlink>:
xor    %esi,%esi
jmp    1030 <decode_readlink@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_readlink(%struct.tcb* %0) {
%2 = tail call i32 @decode_readlink(%struct.tcb* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void error(const char *msg, int line) {
  fprintf(stderr, "ERROR [line: %d] %s\n", line, msg);
  printf("pth_str02:  Test Failed\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rcx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"ERROR [line: %d] %s\0A\00"
@.str.1 = [25 x i8] c"pth_str02: Test Failed\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"ERROR [line: %d] %s\0A\00"
@str = [24 x i8] c"pth_str02: Test Failed\00"
define void @error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
}
void caller_2_1_2_1_2_2_2() {}


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

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

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

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