xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ error(char *);
int read(int, char *, int);
int read_from_socket(int sockfd, char buf[256]) {
  bzero(buf, 256);
  int n = read(sockfd, buf, 255);
  if (n < 0)
    error("ERROR reading from socket");
  return n;
}


x86 assembly (clang, -O0):
<read_from_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x100,%esi
call   1050 <bzero@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0xff,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1177 <read_from_socket+0x47>
lea    0xe8e(%rip),%rdi
call   1040 <error@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_from_socket>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    $0x100,%esi
call   1050 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
call   1030 <read@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1166 <read_from_socket+0x36>
lea    0xe9f(%rip),%rdi
call   1040 <error@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"ERROR reading from socket\00"
define i32 @read_from_socket(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @bzero(i8* %6, i32 256)
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @read(i32 %8, i8* %9, i32 255)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [26 x i8] c"ERROR reading from socket\00"
define i32 @read_from_socket(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @bzero(i8* %1, i32 256)
%4 = tail call i32 @read(i32 %0, i8* %1, i32 255)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i32 %4
}
int test_imm_BCuint32_reg(unsigned int val) {
  return ((val) & (0xBC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BCuint32_reg(i32 %0) {
%2 = and i32 %0, 188
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage_message(const char *options[]) {
  int index;
  for (index = 0; *options[index]; ++index) {
    printf("%s\n", options[index]);
  }
}


x86 assembly (clang, -O0):
<print_usage_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmpb   $0x0,(%rax)
je     115e <print_usage_message+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_usage_message+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage_message>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
cmpb   $0x0,(%rsi)
je     1144 <print_usage_message+0x34>
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
cmpb   $0x0,(%rsi)
jne    1130 <print_usage_message+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_usage_message(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %1
ret void
}
/* Variables and functions */
scalar_t__ mik_isupper(int);
int mik_tolower(int c) { return ((mik_isupper(c)) ? (c | ('a' - 'A')) : c); }


x86 assembly (clang, -O0):
<mik_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mik_isupper@plt>
cmp    $0x0,%rax
je     113b <mik_tolower+0x2b>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <mik_tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mik_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <mik_isupper@plt>
mov    %ebx,%ecx
or     $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mik_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @mik_isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @mik_tolower(i32 %0) {
%2 = tail call i64 @mik_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int foo(char, short);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char c = -1;
  short s = -2;
  printf("%d\n", foo(c, s));
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xff,-0x5(%rbp)
movw   $0xfffe,-0x8(%rbp)
mov    -0x5(%rbp),%al
movsbl %al,%edi
movswl -0x8(%rbp),%esi
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
mov    $0xfffffffe,%esi
call   1040 <foo@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @foo(i8 signext -1, i16 signext -2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void end_screen() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @end_screen() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int main() {
  f1(1);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 1)
ret i32 0
}
/* Variables and functions */
int arg_rest(char **);
int numeric_arg(char **, int);
int optional_num(char **av, int n, int dft) {
  int ret = dft;
  if (arg_rest(av) > n)
    ret = numeric_arg(av, n);
  return ret;
}


x86 assembly (clang, -O0):
<optional_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <arg_rest@plt>
cmp    -0xc(%rbp),%eax
jle    1159 <optional_num+0x39>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <numeric_arg@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optional_num>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%rbp
call   1030 <arg_rest@plt>
cmp    %ebx,%eax
jle    1143 <optional_num+0x23>
mov    %rbp,%rdi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <numeric_arg@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @optional_num(i8** %0, i32 %1, i32 %2) {
%4 = tail call i32 @arg_rest(i8** %0)
%5 = icmp sgt i32 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @numeric_arg(i8** %0, i32 %1)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ %2, %3 ]
ret i32 %9
}
void parfil_(mask, npix, nrast) float mask[];
int *npix, *nrast;
{ parallelogram_fill(mask, *npix, *nrast); }


x86 assembly (clang, -O0):
<parfil_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1030 <parallelogram_fill@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parfil_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
xor    %eax,%eax
jmp    1030 <parallelogram_fill@plt>

LLVM IR (-O0):
define void @parfil_(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @parallelogram_fill to i32 (float*, i32, i32, ...)*)(float* %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @parfil_(float* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @parallelogram_fill to i32 (float*, i32, i32, ...)*)(float* %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sig_child(int signo) {
  signal(SIGCHLD, sig_child);
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<sig_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    0x2e95(%rip),%rsi
call   1030 <signal@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
cmp    $0x0,%rax
jle    1166 <sig_child+0x46>
jmp    1140 <sig_child+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_child>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rsi
call   1030 <signal@plt>
mov    0x2eab(%rip),%rbx
nopl   (%rax)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
test   %rax,%rax
jg     1140 <sig_child+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@SIGCHLD = global i32 0
@WNOHANG = global i32 0
define void @sig_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGCHLD
%4 = call i32 @signal(i32 %3, void (i32)* @sig_child)
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i64 @waitpid(i32 -1, i32* null, i32 %6)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
@WNOHANG = global i32 0
define void @sig_child(i32 %0) {
%2 = load i32, i32* @SIGCHLD
%3 = tail call i32 @signal(i32 %2, void (i32)* @sig_child)
br label %4
4: ; preds = %4, %1
%5 = load i32, i32* @WNOHANG
%6 = tail call i64 @waitpid(i32 -1, i32* null, i32 %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
void CFGMR3QueryStringAllocDef(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryStringAllocDef() {
ret void
}
int rnddiv2(int x) { return (x + (x > 0)) >> 1; }


x86 assembly (clang, -O0):
<rnddiv2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnddiv2>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
add    %edi,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @rnddiv2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
%8 = ashr i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @rnddiv2(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = add nsw i32 %3, %0
%5 = ashr i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int main() {
  while (1) {
    pause();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pause@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <pause@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @pause()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @pause()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *strdup(char const *);
char *x_strdup(const char *s) {
  char *r = strdup(s);
  if (!r) {
    fprintf(stderr, "Fatal: strdup() failed\n");
    exit(EXIT_FAILURE);
  }
  return r;
}


x86 assembly (clang, -O0):
<x_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <x_strdup+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_strdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <x_strdup+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Fatal: strdup() failed\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @x_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Fatal: strdup() failed\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @x_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
void gtk_im_multicontext_append_menuitems() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void rh_kabi_6_2(struct rh_kabi_structs_6_2 *rh_kabi_structs_6_2) {
  panic("Problem exists between keyboard and your seat.");
}


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

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

LLVM IR (-O0):
%struct.rh_kabi_structs_6_2 = type { i32 }
@.str = [47 x i8] c"Problem exists between keyboard and your seat.\00"
define void @rh_kabi_6_2(%struct.rh_kabi_structs_6_2* %0) {
%2 = alloca %struct.rh_kabi_structs_6_2*
store %struct.rh_kabi_structs_6_2* %0, %struct.rh_kabi_structs_6_2** %2
%3 = call i32 @panic(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.rh_kabi_structs_6_2 = type { i32 }
@.str = [47 x i8] c"Problem exists between keyboard and your seat.\00"
define void @rh_kabi_6_2(%struct.rh_kabi_structs_6_2* nocapture readnone %0) {
%2 = tail call i32 @panic(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
int _kb_iswin(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_kb_iswin() {
ret i32 0
}
/* Variables and functions */
int factorial(int);
unsigned call_factorial(void) { return factorial(42); }


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

x86 assembly (clang, -O2):
<call_factorial>:
mov    $0x2a,%edi
jmp    1030 <factorial@plt>

LLVM IR (-O0):
define i32 @call_factorial() {
%1 = call i32 @factorial(i32 42)
ret i32 %1
}

LLVM IR (-O2):
define i32 @call_factorial() {
%1 = tail call i32 @factorial(i32 42)
ret i32 %1
}
/* Variables and functions */
int start_client(char *);
int start_server();
bool rvl_connection_new(char *host) {
  return (host == NULL) ? start_server() : start_client(host);
}


x86 assembly (clang, -O0):
<rvl_connection_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1146 <rvl_connection_new+0x26>
mov    $0x0,%al
call   1040 <start_server@plt>
mov    %eax,-0xc(%rbp)
jmp    1152 <rvl_connection_new+0x32>
mov    -0x8(%rbp),%rdi
call   1030 <start_client@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rvl_connection_new>:
test   %rdi,%rdi
je     112a <rvl_connection_new+0xa>
jmp    1030 <start_client@plt>
xor    %eax,%eax
jmp    1040 <start_server@plt>

LLVM IR (-O0):
define i32 @rvl_connection_new(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @start_server()
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @start_client(i8* %8)
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @rvl_connection_new(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @start_server()
br label %7
5: ; preds = %1
%6 = tail call i32 @start_client(i8* %0)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ findLastChar(char, char *);
int /*<<< orphan*/ test(int /*<<< orphan*/, int);
void testFindLastChar(void) {
  test(findLastChar('c', "abcabc"), 5);
  test(findLastChar('d', "abcabc"), -1);
}


x86 assembly (clang, -O0):
<testFindLastChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x63,%edi
lea    0xed0(%rip),%rsi
call   1030 <findLastChar@plt>
mov    %eax,%edi
mov    $0x5,%esi
call   1040 <test@plt>
mov    $0x64,%edi
lea    0xeb3(%rip),%rsi
call   1030 <findLastChar@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFindLastChar>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0x63,%edi
mov    %rbx,%rsi
call   1030 <findLastChar@plt>
mov    %eax,%edi
mov    $0x5,%esi
call   1040 <test@plt>
mov    $0x64,%edi
mov    %rbx,%rsi
call   1030 <findLastChar@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
pop    %rbx
jmp    1040 <test@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"abcabc\00"
define void @testFindLastChar() {
%1 = call i32 @findLastChar(i8 signext 99, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test(i32 %1, i32 5)
%3 = call i32 @findLastChar(i8 signext 100, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @test(i32 %3, i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"abcabc\00"
define void @testFindLastChar() {
%1 = tail call i32 @findLastChar(i8 signext 99, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, i32 5)
%3 = tail call i32 @findLastChar(i8 signext 100, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @test(i32 %3, i32 -1)
ret void
}
/* Variables and functions */
int ChangeEndianness(int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%x\n", ChangeEndianness(0x12345678)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%edi
call   1040 <ChangeEndianness@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @ChangeEndianness(i32 305419896)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__getresgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getresgid>:
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 @__getresgid(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* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__getresgid(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
int ap_do_command_only(int, int);
int ap_save_playlist(int session) {
  return (ap_do_command_only(session, 0xcc29));
}


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

x86 assembly (clang, -O2):
<ap_save_playlist>:
mov    $0xcc29,%esi
jmp    1030 <ap_do_command_only@plt>

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

LLVM IR (-O2):
define i32 @ap_save_playlist(i32 %0) {
%2 = tail call i32 @ap_do_command_only(i32 %0, i32 52265)
ret i32 %2
}
/* Variables and functions */
unsigned int __gnu_h2f_internal(unsigned int, int);
unsigned int __gnu_h2f_ieee(unsigned int a) { return __gnu_h2f_internal(a, 1); }


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

x86 assembly (clang, -O2):
<__gnu_h2f_ieee>:
mov    $0x1,%esi
jmp    1030 <__gnu_h2f_internal@plt>

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

LLVM IR (-O2):
define i32 @__gnu_h2f_ieee(i32 %0) {
%2 = tail call i32 @__gnu_h2f_internal(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ send(char);
void PrintChar(char c) { send(c); }


x86 assembly (clang, -O0):
<PrintChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintChar>:
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define void @PrintChar(i8 signext %0) {
%2 = tail call i32 @send(i8 signext %0)
ret void
}
int test(int v) {
  int x = 0;
  int u;
  for (u = 0; u < 2; u++) {
    if (u > v) {
      if (u % 2 == 1)
        x++;
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1160 <test+0x60>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    114d <test+0x4d>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1148 <test+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <test+0x4d>
jmp    1152 <test+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <test+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct vm_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vm_putc(struct vm_state *, char);
void vm_putx(struct vm_state *M, unsigned char ch) {
  vm_putc(M, "0123456789abcdef"[0x0f & (ch >> 4)]);
  vm_putc(M, "0123456789abcdef"[0x0f & (ch >> 0)]);
}


x86 assembly (clang, -O0):
<vm_putx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xec6(%rip),%rax
movsbl (%rax,%rcx,1),%esi
call   1030 <vm_putc@plt>
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
sar    $0x0,%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xea5(%rip),%rax
movsbl (%rax,%rcx,1),%esi
call   1030 <vm_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vm_putx>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %esi,%ebx
mov    %rbx,%rax
shr    $0x4,%rax
lea    0xed8(%rip),%r15
movsbl (%rax,%r15,1),%esi
call   1030 <vm_putc@plt>
and    $0xf,%ebx
movsbl (%rbx,%r15,1),%esi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <vm_putc@plt>

LLVM IR (-O0):
%struct.vm_state = type { i32 }
@.str = [17 x i8] c"0123456789abcdef\00"
define void @vm_putx(%struct.vm_state* %0, i8 zeroext %1) {
%3 = alloca %struct.vm_state*
%4 = alloca i8
store %struct.vm_state* %0, %struct.vm_state** %3
store i8 %1, i8* %4
%5 = load %struct.vm_state*, %struct.vm_state** %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = ashr i32 %7, 4
%9 = and i32 15, %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = call i32 @vm_putc(%struct.vm_state* %5, i8 signext %12)
%14 = load %struct.vm_state*, %struct.vm_state** %3
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = ashr i32 %16, 0
%18 = and i32 15, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = call i32 @vm_putc(%struct.vm_state* %14, i8 signext %21)
ret void
}

LLVM IR (-O2):
%struct.vm_state = type { i32 }
@.str = [17 x i8] c"0123456789abcdef\00"
define void @vm_putx(%struct.vm_state* %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = lshr i32 %3, 4
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @vm_putc(%struct.vm_state* %0, i8 signext %7)
%9 = and i32 %3, 15
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i32 @vm_putc(%struct.vm_state* %0, i8 signext %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookinteger16array(long long int *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 16));
}


x86 assembly (clang, -O0):
<lookinteger16array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x4,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookinteger16array>:
shl    $0x4,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookinteger16array(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 = bitcast i64* %5 to i8*
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 16
%9 = call i32 @lookNarray(i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookinteger16array(i64* %0, i32 %1) {
%3 = bitcast i64* %0 to i8*
%4 = shl nsw i32 %1, 4
%5 = tail call i32 @lookNarray(i8* %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
int ft_putchar(int c) { write(1, &c, 1); }


x86 assembly (clang, -O0):
<ft_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%edx
lea    -0x8(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ft_putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i32* %2, i32 1)
ret i32 undef
}
/* Variables and functions */
char *place_commas_in_number_string(char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned long);
char *place_commas_in_unsigned_long(unsigned long n) {
  char s[64];
  sprintf(s, "%lu", n);
  return place_commas_in_number_string(s);
}


x86 assembly (clang, -O0):
<place_commas_in_unsigned_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<place_commas_in_unsigned_long>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lu\00"
define i8* @place_commas_in_unsigned_long(i64 %0) {
%2 = alloca i64
%3 = alloca [64 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i8* @place_commas_in_number_string(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define i8* @place_commas_in_unsigned_long(i64 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = call i8* @place_commas_in_number_string(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_bat_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("bat", " rem comment"),
                            "comment", "rem comment");
}


x86 assembly (clang, -O0):
<test_bat_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
lea    0xebe(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bat_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xece(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"bat\00"
@.str.1 = [13 x i8] c" rem comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [12 x i8] c"rem comment\00"
define void @test_bat_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"bat\00"
@.str.1 = [13 x i8] c" rem comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [12 x i8] c"rem comment\00"
define void @test_bat_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IP_OPTIONS;
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/ *, int /*<<< orphan*/);
int os_disable_options(int fd) {
  return (0 == setsockopt(fd, IPPROTO_IP, IP_OPTIONS, NULL, 0));
}


x86 assembly (clang, -O0):
<os_disable_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <setsockopt@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_disable_options>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <setsockopt@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_IP = global i32 0
@IP_OPTIONS = global i32 0
define i32 @os_disable_options(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPPROTO_IP
%5 = load i32, i32* @IP_OPTIONS
%6 = call i64 @setsockopt(i32 %3, i32 %4, i32 %5, i32* null, i32 0)
%7 = icmp eq i64 0, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@IPPROTO_IP = global i32 0
@IP_OPTIONS = global i32 0
define i32 @os_disable_options(i32 %0) {
%2 = load i32, i32* @IPPROTO_IP
%3 = load i32, i32* @IP_OPTIONS
%4 = tail call i64 @setsockopt(i32 %0, i32 %2, i32 %3, i32* null, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int clip_x_origin;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
void set_XGCValues_clip_x_origin(void *_p, int _v) {
  ((XGCValues *)_p)->clip_x_origin = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XGCValues_clip_x_origin>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGCValues_clip_x_origin(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGCValues_clip_x_origin(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
__attribute__((no, noclone)) unsigned __int128 t150_5add(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_add_overflow(x, (unsigned __int128)(3), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t150_5add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0x3,%rdx
adc    $0x0,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t150_5add+0x48>
jmp    115f <t150_5add+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t150_5add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x3,%rbx
adc    $0x0,%r14
jae    112b <t150_5add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t150_5add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %11, i128 3)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t150_5add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %6, i128 3)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
scalar_t__ regexec(int /*<<< orphan*/ *, char const *, size_t,
                   int /*<<< orphan*/ *, int /*<<< orphan*/);
int regexMatch(const char *string, regex_t re) {
  return regexec(&re, string, (size_t)0, NULL, 0) == 0;
}


x86 assembly (clang, -O0):
<regexMatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
mov    %rcx,%rdx
call   1030 <regexec@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regexMatch>:
push   %rax
mov    %rdi,%rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rax,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <regexec@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @regexMatch(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i64 @regexec(i32* %4, i8* %5, i64 0, i32* null, i32 0)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @regexMatch(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @regexec(i32* %3, i8* %0, i64 0, i32* null, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char toupper(char);
char *stringToFirst(char *inputString) {
  char *changer = inputString;
  *changer = toupper(*changer);
  return changer;
}


x86 assembly (clang, -O0):
<stringToFirst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringToFirst>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @stringToFirst(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = call signext i8 @toupper(i8 signext %6)
%8 = load i8*, i8** %3
store i8 %7, i8* %8
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @stringToFirst(i8* returned %0) {
%2 = load i8, i8* %0
%3 = tail call signext i8 @toupper(i8 signext %2)
store i8 %3, i8* %0
ret i8* %0
}
void test_uqueue_on_two_stacks(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_1_1_2_2_2() {
ret void
}
int left(int i) { return (i * 2 + 1); }


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}