xunge/DecIR huggingface dataset:
char *strcatm(char *s1, char *s2) {
  while (*(s1++) != '\0')
    ;
  s1--;
  while ((*(s1++) = *(s2++)) != '\0')
    ;
  return s1;
}


x86 assembly (clang, -O0):
<strcatm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112c <strcatm+0x2c>
jmp    110c <strcatm+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116b <strcatm+0x6b>
jmp    1138 <strcatm+0x38>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcatm>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1110 <strcatm+0x10>
mov    $0xffffffffffffffff,%rcx
movzbl 0x1(%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <strcatm+0x20>
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strcatm(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printno();
int /*<<< orphan*/ printyes();
void testTripleExp(void) { (1 == 2) ? printyes() : printno(); }


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

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

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

LLVM IR (-O2):
define void @testTripleExp() {
%1 = tail call i32 (...) @printno()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int dxl_read_byte(int, int);
void getD(int ID) {
  int dVal;
  dVal = dxl_read_byte(ID, 28);
  PrintErrorCode();
}


x86 assembly (clang, -O0):
<getD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1c,%esi
call   1040 <dxl_read_byte@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PrintErrorCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getD>:
push   %rax
mov    $0x1c,%esi
call   1040 <dxl_read_byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <PrintErrorCode@plt>

LLVM IR (-O0):
define void @getD(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dxl_read_byte(i32 %4, i32 28)
store i32 %5, i32* %3
%6 = call i32 (...) @PrintErrorCode()
ret void
}

LLVM IR (-O2):
define void @getD(i32 %0) {
%2 = tail call i32 @dxl_read_byte(i32 %0, i32 28)
%3 = tail call i32 (...) @PrintErrorCode()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_pointer(char *);
char *strdup(char const *);
char *safe_strdup(const char *s) {
  if (s == NULL) {
    return NULL;
  }
  char *ptr = strdup(s);
  check_pointer(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<safe_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <safe_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1162 <safe_strdup+0x42>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <check_pointer@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strdup>:
push   %rbx
test   %rdi,%rdi
je     1138 <safe_strdup+0x18>
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <check_pointer@plt>
jmp    113a <safe_strdup+0x1a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @safe_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = tail call i32 @check_pointer(i8* %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_and_reset() { printf(".[-]\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c".[-]\0A\00"
define void @print_and_reset() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c".[-]\00"
define void @print_and_reset() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void vzeroupper() {
  db(0xC5);
  db(0xF8);
  db(0x77);
}


x86 assembly (clang, -O0):
<vzeroupper>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc5,%edi
call   1030 <db@plt>
mov    $0xf8,%edi
call   1030 <db@plt>
mov    $0x77,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vzeroupper>:
push   %rax
mov    $0xc5,%edi
call   1030 <db@plt>
mov    $0xf8,%edi
call   1030 <db@plt>
mov    $0x77,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @vzeroupper() {
%1 = call i32 @db(i32 197)
%2 = call i32 @db(i32 248)
%3 = call i32 @db(i32 119)
ret void
}

LLVM IR (-O2):
define void @vzeroupper() {
%1 = tail call i32 @db(i32 197)
%2 = tail call i32 @db(i32 248)
%3 = tail call i32 @db(i32 119)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_out8(int, int);
int /*<<< orphan*/ wait_KBC_sendready();
void enable_mouse(void) {
  wait_KBC_sendready();
  io_out8(0x0064, 0xd4);
  wait_KBC_sendready();
  io_out8(0x0060, 0xf4);
  return;
}


x86 assembly (clang, -O0):
<enable_mouse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wait_KBC_sendready@plt>
mov    $0x64,%edi
mov    $0xd4,%esi
call   1040 <io_out8@plt>
mov    $0x0,%al
call   1030 <wait_KBC_sendready@plt>
mov    $0x60,%edi
mov    $0xf4,%esi
call   1040 <io_out8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_mouse>:
push   %rax
xor    %eax,%eax
call   1030 <wait_KBC_sendready@plt>
mov    $0x64,%edi
mov    $0xd4,%esi
call   1040 <io_out8@plt>
xor    %eax,%eax
call   1030 <wait_KBC_sendready@plt>
mov    $0x60,%edi
mov    $0xf4,%esi
pop    %rax
jmp    1040 <io_out8@plt>

LLVM IR (-O0):
define void @enable_mouse() {
%1 = call i32 (...) @wait_KBC_sendready()
%2 = call i32 @io_out8(i32 100, i32 212)
%3 = call i32 (...) @wait_KBC_sendready()
%4 = call i32 @io_out8(i32 96, i32 244)
ret void
}

LLVM IR (-O2):
define void @enable_mouse() {
%1 = tail call i32 (...) @wait_KBC_sendready()
%2 = tail call i32 @io_out8(i32 100, i32 212)
%3 = tail call i32 (...) @wait_KBC_sendready()
%4 = tail call i32 @io_out8(i32 96, i32 244)
ret void
}
void *fz_clampp(void *p, void *min, void *max) {
  return (p > min ? (p < max ? p : max) : min);
}


x86 assembly (clang, -O0):
<fz_clampp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    114e <fz_clampp+0x4e>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1139 <fz_clampp+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1141 <fz_clampp+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1156 <fz_clampp+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_clampp>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovb  %rdi,%rax
cmp    %rsi,%rdi
cmovbe %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @fz_clampp(i8* readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp ugt i8* %0, %1
%5 = icmp ult i8* %0, %2
%6 = select i1 %5, i8* %0, i8* %2
%7 = select i1 %4, i8* %6, i8* %1
ret i8* %7
}
void CONTINUE() {
  while (1) {
    continue;
  }
}


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

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

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

LLVM IR (-O2):
define void @CONTINUE() {
br label %1
1: ; preds = %0, %1
br label %1
}
int BGBDT_MM_QHashName(char *name) {
  char *s;
  int h;
  if (!name)
    return (0);
  s = name;
  h = 0;
  while (*s)
    h = h * 4093 + (*s++) + 1;
  return (h);
}


x86 assembly (clang, -O0):
<BGBDT_MM_QHashName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <BGBDT_MM_QHashName+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1167 <BGBDT_MM_QHashName+0x67>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <BGBDT_MM_QHashName+0x61>
imul   $0xffd,-0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <BGBDT_MM_QHashName+0x2e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BGBDT_MM_QHashName>:
xor    %eax,%eax
test   %rdi,%rdi
je     1139 <BGBDT_MM_QHashName+0x39>
mov    (%rdi),%cl
test   %cl,%cl
je     1139 <BGBDT_MM_QHashName+0x39>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
imul   $0xffd,%eax,%eax
movsbl %cl,%ecx
add    %ecx,%eax
add    $0x1,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <BGBDT_MM_QHashName+0x20>
ret

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

LLVM IR (-O2):
define i32 @BGBDT_MM_QHashName(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %15, %6 ], [ %4, %3 ]
%8 = phi i32 [ %14, %6 ], [ 0, %3 ]
%9 = phi i8* [ %11, %6 ], [ %0, %3 ]
%10 = mul nsw i32 %8, 4093
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = sext i8 %7 to i32
%13 = add i32 %10, 1
%14 = add i32 %13, %12
%15 = load i8, i8* %11
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %3, %1
%18 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %14, %6 ]
ret i32 %18
}
/* Variables and functions */
unsigned int etp_nready();
unsigned int eio_nready(void) { return etp_nready(); }


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

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

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

LLVM IR (-O2):
define i32 @eio_nready() {
%1 = tail call i32 (...) @etp_nready()
ret i32 %1
}
unsigned long ROR64(unsigned long word, int i) {
  asm("rorq %%cl, %0" : "=r"(word) : "0"(word), "c"(i));
  return word;
}


x86 assembly (clang, -O0):
<ROR64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
ror    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROR64>:
mov    %esi,%ecx
mov    %rdi,%rax
ror    %cl,%rax
ret

LLVM IR (-O0):
define i64 @ROR64(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i64 asm "rorq %cl, $0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %5, i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @ROR64(i64 %0, i32 %1) {
%3 = tail call i64 asm "rorq %cl, $0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i32 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ marker_A();
int /*<<< orphan*/ marker_B();
int /*<<< orphan*/ marker_C();
int /*<<< orphan*/ marker_D();
void test(int flag) {
  marker_A();
  if (flag) {
    marker_B();
    test(flag);
    marker_C();
  }
  marker_D();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <marker_A@plt>
cmpl   $0x0,-0x4(%rbp)
je     1182 <test+0x32>
mov    $0x0,%al
call   1060 <marker_B@plt>
mov    -0x4(%rbp),%edi
call   1070 <test@plt>
mov    $0x0,%al
call   1030 <marker_C@plt>
mov    $0x0,%al
call   1050 <marker_D@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <marker_A@plt>
test   %ebx,%ebx
je     1173 <test+0x23>
xor    %eax,%eax
call   1060 <marker_B@plt>
mov    %ebx,%edi
call   1070 <test@plt>
xor    %eax,%eax
call   1030 <marker_C@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <marker_D@plt>

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

LLVM IR (-O2):
define void @test(i32 %0) {
%2 = tail call i32 (...) @marker_A()
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (...) @marker_B()
tail call void @test(i32 %0)
%6 = tail call i32 (...) @marker_C()
br label %7
7: ; preds = %4, %1
%8 = tail call i32 (...) @marker_D()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ strtol(char const *, char **, int /*<<< orphan*/);
int parse_ssize(const char *arg, ssize_t *result) {
  char *end_arg;
  ssize_t val = strtol(arg, &end_arg, 0);
  if (*arg && !*end_arg) {
    *result = val;
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<parse_ssize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <parse_ssize+0x54>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1164 <parse_ssize+0x54>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    116b <parse_ssize+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_ssize>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <strtol@plt>
cmpb   $0x0,(%rbx)
je     1143 <parse_ssize+0x33>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    1143 <parse_ssize+0x33>
mov    %eax,(%r14)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_ssize(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtol(i8* %0, i8** %3, i32 0)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 %5, i32* %1
br label %13
13: ; preds = %2, %8, %12
%14 = phi i32 [ 1, %12 ], [ 0, %8 ], [ 0, %2 ]
ret i32 %14
}
int min3(int x, int y, int z) {
  int m;
  m = x;
  if (y < m) {
    m = y;
  }
  if (z < m) {
    m = z;
  }
  return m;
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1125 <min3+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1137 <min3+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Type definitions */
struct iiod_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct iiod_client *);
void iiod_client_destroy(struct iiod_client *client) { free(client); }


x86 assembly (clang, -O0):
<iiod_client_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):
<iiod_client_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.iiod_client = type { i32 }
define void @iiod_client_destroy(%struct.iiod_client* nocapture %0) {
%2 = tail call i32 @free(%struct.iiod_client* %0)
ret void
}
int clearbits_lsb(int num, int i) {
  int mask = ~((1 << (i + 1)) - 1);
  return num & mask;
}


x86 assembly (clang, -O0):
<clearbits_lsb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearbits_lsb>:
mov    %edi,%eax
lea    0x1(%rsi),%ecx
shr    %cl,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @clearbits_lsb(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = shl nsw i32 -1, %3
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ regsets_fetch_inferior_registers();
void fbsd_fetch_registers(int regno) { regsets_fetch_inferior_registers(); }


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

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

LLVM IR (-O0):
define void @fbsd_fetch_registers(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @regsets_fetch_inferior_registers()
ret void
}

LLVM IR (-O2):
define void @fbsd_fetch_registers(i32 %0) {
%2 = tail call i32 (...) @regsets_fetch_inferior_registers()
ret void
}
void foo(char **c) {
  *c = "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
       "2022-01-22/02-19-57/repos/0x0all/ROOT/refs/heads/bb-clusters/3rd/"
       "templight/clang/test/VFS/Inputs/external-names.h";
  int x = c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xeed(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0x0all/ROOT/refs/heads/bb-clusters/3rd/templight/clang/test/VFS/Inputs/external-names.h\00"
define void @foo(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
store i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8**, i8*** %2
%6 = ptrtoint i8** %5 to i32
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
@.str = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0x0all/ROOT/refs/heads/bb-clusters/3rd/templight/clang/test/VFS/Inputs/external-names.h\00"
define void @foo(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0), i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xdf() {
  Assert_real((isbdigit(223) == 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_isbdigit.c",
              1120, ("isbdigit should be 0 for 0xdf"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xdf>:
push   %rax
mov    $0xdf,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x460,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xdf\00"
define void @t_isbdigit_0xdf() {
%1 = call i64 @isbdigit(i32 223)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1120, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xdf\00"
define void @t_isbdigit_0xdf() {
%1 = tail call i64 @isbdigit(i32 223)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1120, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void solve() {}


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

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

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

LLVM IR (-O2):
define void @solve() {
ret void
}
void GPU_clearDynarec(void (*callback)(void)) {}


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

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

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

LLVM IR (-O2):
define void @GPU_clearDynarec(void ()* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int tenf = 10;
  int b = 10;
  while (b != 1) {
    b = b - 1;
    int f = tenf;
    tenf = f * b;
  }
  printf("%d\n", tenf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1155 <main+0x45>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @RGB24ToUVRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errc(int, int, char *);
void wp(int result) {
  if (result)
    errc(1, result, "pthread failed");
}


x86 assembly (clang, -O0):
<wp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1139 <wp+0x29>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
lea    0xecc(%rip),%rdx
call   1030 <errc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wp>:
test   %edi,%edi
je     1127 <wp+0x17>
mov    %edi,%esi
lea    0xee3(%rip),%rdx
mov    $0x1,%edi
jmp    1030 <errc@plt>
ret

LLVM IR (-O0):
@.str = [15 x i8] c"pthread failed\00"
define void @wp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @errc(i32 1, i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"pthread failed\00"
define void @wp(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @errc(i32 1, i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
int readint2(int *x) { return *x; }


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

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

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

LLVM IR (-O2):
define i32 @readint2(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Cbuf_InsertText(int /*<<< orphan*/);
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *);
char *Cvar_VariableString(int /*<<< orphan*/);
int /*<<< orphan*/ va(char *, char *);
void Cmd_Vstr_f(void) {
  char *v;
  if (Cmd_Argc() != 2) {
    Com_Printf("vstr <variablename> : execute a variable command\n");
    return;
  }
  v = Cvar_VariableString(Cmd_Argv(1));
  Cbuf_InsertText(va("%s\n", v));
}


x86 assembly (clang, -O0):
<Cmd_Vstr_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
je     1189 <Cmd_Vstr_f+0x29>
lea    0xe81(%rip),%rdi
call   1050 <Com_Printf@plt>
jmp    11b5 <Cmd_Vstr_f+0x55>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1080 <Cvar_VariableString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1070 <va@plt>
mov    %eax,%edi
call   1040 <Cbuf_InsertText@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_Vstr_f>:
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jne    1195 <Cmd_Vstr_f+0x35>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1080 <Cvar_VariableString@plt>
lea    0xead(%rip),%rdi
mov    %rax,%rsi
call   1070 <va@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <Cbuf_InsertText@plt>
lea    0xe64(%rip),%rdi
pop    %rax
jmp    1050 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"vstr <variablename> : execute a variable command\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @Cmd_Vstr_f() {
%1 = alloca i8*
%2 = call i32 (...) @Cmd_Argc()
%3 = icmp ne i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @Com_Printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %0
%7 = call i32 @Cmd_Argv(i32 1)
%8 = call i8* @Cvar_VariableString(i32 %7)
store i8* %8, i8** %1
%9 = load i8*, i8** %1
%10 = call i32 @va(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 @Cbuf_InsertText(i32 %10)
br label %12
12: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"vstr <variablename> : execute a variable command\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @Cmd_Vstr_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %10
5: ; preds = %0
%6 = tail call i32 @Cmd_Argv(i32 1)
%7 = tail call i8* @Cvar_VariableString(i32 %6)
%8 = tail call i32 @va(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = tail call i32 @Cbuf_InsertText(i32 %8)
br label %10
10: ; preds = %5, %3
ret void
}
double calcc2(double fieldOfViewCircumferential, double fieldOfViewRadial) {
  return fieldOfViewRadial * fieldOfViewRadial /
         (fieldOfViewCircumferential * fieldOfViewCircumferential);
}


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

x86 assembly (clang, -O2):
<calcc2>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calcc2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %4
%7 = fmul double %5, %6
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fmul double %8, %9
%11 = fdiv double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @calcc2(double %0, double %1) {
%3 = fmul double %1, %1
%4 = fmul double %0, %0
%5 = fdiv double %3, %4
ret double %5
}
int fun657() { return 657; }


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

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

LLVM IR (-O0):
define i32 @fun657() {
ret i32 657
}

LLVM IR (-O2):
define i32 @fun657() {
ret i32 657
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *my_strptime_guts(char const *, char const *, struct tm *);
char *my_strptime(const char *buf, const char *format, struct tm *tm) {
  if (!(buf = my_strptime_guts(buf, format, tm)))
    return NULL;
  return (char *)buf;
}


x86 assembly (clang, -O0):
<my_strptime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <my_strptime_guts@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1150 <my_strptime+0x40>
movq   $0x0,-0x8(%rbp)
jmp    1158 <my_strptime+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strptime>:
jmp    1030 <my_strptime_guts@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @my_strptime(i8* %0, i8* %1, %struct.tm* %2) {
%4 = tail call i8* @my_strptime_guts(i8* %0, i8* %1, %struct.tm* %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ on;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int const *, int);
int net_sock_reuseaddr(int sock) {
  const int on = 1;
  return setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
}


x86 assembly (clang, -O0):
<net_sock_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_sock_reuseaddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @net_sock_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @net_sock_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
/* Variables and functions */
void *safe_malloc_(size_t);
void *safe_malloc_add_3op_(size_t size1, size_t size2, size_t size3) {
  size2 += size1;
  if (size2 < size1)
    return 0;
  size3 += size2;
  if (size3 < size2)
    return 0;
  return safe_malloc_(size3);
}


x86 assembly (clang, -O0):
<safe_malloc_add_3op_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114b <safe_malloc_add_3op_+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    117f <safe_malloc_add_3op_+0x6f>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1172 <safe_malloc_add_3op_+0x62>
movq   $0x0,-0x8(%rbp)
jmp    117f <safe_malloc_add_3op_+0x6f>
mov    -0x20(%rbp),%rdi
call   1030 <safe_malloc_@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc_add_3op_>:
add    %rsi,%rdi
jb     111a <safe_malloc_add_3op_+0xa>
add    %rdx,%rdi
jae    111d <safe_malloc_add_3op_+0xd>
xor    %eax,%eax
ret
jmp    1030 <safe_malloc_@plt>

LLVM IR (-O0):
define i8* @safe_malloc_add_3op_(i64 %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = add i64 %9, %8
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = load i64, i64* %5
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i8* null, i8** %4
br label %26
15: ; preds = %3
%16 = load i64, i64* %6
%17 = load i64, i64* %7
%18 = add i64 %17, %16
store i64 %18, i64* %7
%19 = load i64, i64* %7
%20 = load i64, i64* %6
%21 = icmp ult i64 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %15
store i8* null, i8** %4
br label %26
23: ; preds = %15
%24 = load i64, i64* %7
%25 = call i8* @safe_malloc_(i64 %24)
store i8* %25, i8** %4
br label %26
26: ; preds = %23, %22, %14
%27 = load i8*, i8** %4
ret i8* %27
}

LLVM IR (-O2):
define i8* @safe_malloc_add_3op_(i64 %0, i64 %1, i64 %2) {
%4 = add i64 %1, %0
%5 = icmp ult i64 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = add i64 %4, %2
%8 = icmp ult i64 %7, %4
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i8* @safe_malloc_(i64 %7)
br label %11
11: ; preds = %6, %3, %9
%12 = phi i8* [ %10, %9 ], [ null, %3 ], [ null, %6 ]
ret i8* %12
}
/* Variables and functions */
int is_almost_zero_ex(double, int);
bool is_almost_zero(double val) { return is_almost_zero_ex(val, 1e-8); }


x86 assembly (clang, -O0):
<is_almost_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1030 <is_almost_zero_ex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_almost_zero>:
xor    %edi,%edi
jmp    1030 <is_almost_zero_ex@plt>

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

LLVM IR (-O2):
define i32 @is_almost_zero(double %0) {
%2 = tail call i32 @is_almost_zero_ex(double %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ cw_stop();
int /*<<< orphan*/ puts(char *);
void handle_signal(int signal) {
  puts("caught SIGINT, terminating...\n");
  cw_stop();
}


x86 assembly (clang, -O0):
<handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <cw_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_signal>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cw_stop@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"caught SIGINT, terminating...\0A\00"
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @cw_stop()
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"caught SIGINT, terminating...\0A\00"
define void @handle_signal(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @cw_stop()
ret void
}
int main() {
  unsigned char arg1 = 0x55;
  unsigned char arg2 = 0xAA;
  unsigned char out1 = 0;
  unsigned char out2 = 0;
  __asm__("xchgb %%al, %%cl" : "=a"(out1), "=c"(out2) : "a"(arg1), "c"(arg2));
  return (out1 == 0xAA) && (out2 == 0x55);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
movb   $0xaa,-0x6(%rbp)
movb   $0x0,-0x7(%rbp)
movb   $0x0,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    -0x6(%rbp),%cl
xchg   %cl,%al
mov    %al,-0x7(%rbp)
mov    %cl,-0x8(%rbp)
movzbl -0x7(%rbp),%ecx
xor    %eax,%eax
cmp    $0xaa,%ecx
mov    %al,-0x9(%rbp)
jne    114b <main+0x4b>
movzbl -0x8(%rbp),%eax
cmp    $0x55,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x55,%al
mov    $0xaa,%cl
xchg   %cl,%al
xor    $0xaa,%al
xor    $0x55,%cl
xor    %edx,%edx
or     %al,%cl
sete   %dl
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
store i8 -86, i8* %3
store i8 0, i8* %4
store i8 0, i8* %5
%6 = load i8, i8* %2
%7 = load i8, i8* %3
%8 = call { i8, i8 } asm "xchgb %al, %cl", "={ax},={cx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i8 %6, i8 %7)
%9 = extractvalue { i8, i8 } %8, 0
%10 = extractvalue { i8, i8 } %8, 1
store i8 %9, i8* %4
store i8 %10, i8* %5
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 170
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 85
br label %18
18: ; preds = %14, %0
%19 = phi i1 [ false, %0 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i8, i8 } asm "xchgb %al, %cl", "={ax},={cx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i8 85, i8 -86)
%2 = extractvalue { i8, i8 } %1, 0
%3 = extractvalue { i8, i8 } %1, 1
%4 = icmp eq i8 %2, -86
%5 = icmp eq i8 %3, 85
%6 = select i1 %4, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ SmsConn;

/* Variables and functions */
char *SmsGenerateClientID(SmsConn smsConn) { return (NULL); }


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

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

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

LLVM IR (-O2):
define noalias i8* @SmsGenerateClientID(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ sig_block(int /*<<< orphan*/);
extern void sig_alarm_block(void) { sig_block(SIGALRM); }


x86 assembly (clang, -O0):
<sig_alarm_block>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_alarm_block>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_block@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @sig_alarm_block() {
%1 = load i32, i32* @SIGALRM
%2 = call i32 @sig_block(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @sig_alarm_block() {
%1 = load i32, i32* @SIGALRM
%2 = tail call i32 @sig_block(i32 %1)
ret void
}