xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int byte_order;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_byte_order(void *_p, int _v) {
  ((XImage *)_p)->byte_order = (int)_v;
}


x86 assembly (clang, -O0):
<set_XImage_byte_order>:
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_XImage_byte_order>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XImage_byte_order(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_XImage_byte_order(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_menu_hdr(char *);
int /*<<< orphan*/ printf(char *);
int modify_empl() {
  print_menu_hdr("MODIFY");
  printf("\n Menu3: Modify is not implemented.");
}


x86 assembly (clang, -O0):
<modify_empl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <print_menu_hdr@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modify_empl>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print_menu_hdr@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"MODIFY\00"
@.str.1 = [36 x i8] c"\0A Menu3: Modify is not implemented.\00"
define i32 @modify_empl() {
%1 = alloca i32
%2 = call i32 @print_menu_hdr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"MODIFY\00"
@.str.1 = [36 x i8] c"\0A Menu3: Modify is not implemented.\00"
define i32 @modify_empl() {
%1 = tail call i32 @print_menu_hdr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_NOW;
int /*<<< orphan*/ dirname(char const *);
void *dlopen(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, void *);
char *strcat(int /*<<< orphan*/, char *);
int main(int argc, const char **argv) {
  char *dylib =
      strcat(dirname(argv[0]), "/UnitTest.xctest/Contents/MacOS/test");
  void *test_case = dlopen(dylib, RTLD_NOW);
  printf("%p\n", test_case);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <dirname@plt>
mov    %eax,%edi
lea    0xe95(%rip),%rsi
call   1060 <strcat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e69(%rip),%rax
mov    (%rax),%esi
call   1050 <dlopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1040 <dirname@plt>
lea    0xeb0(%rip),%rsi
mov    %eax,%edi
call   1060 <strcat@plt>
mov    0x2e8a(%rip),%rcx
mov    (%rcx),%esi
mov    %rax,%rdi
call   1050 <dlopen@plt>
lea    0xeb6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"/UnitTest.xctest/Contents/MacOS/test\00"
@RTLD_NOW = global i32 0
@.str.1 = [4 x i8] c"%p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @dirname(i8* %10)
%12 = call i8* @strcat(i32 %11, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i32, i32* @RTLD_NOW
%15 = call i8* @dlopen(i8* %13, i32 %14)
store i8* %15, i8** %7
%16 = load i8*, i8** %7
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"/UnitTest.xctest/Contents/MacOS/test\00"
@RTLD_NOW = global i32 0
@.str.1 = [4 x i8] c"%p\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @dirname(i8* %3)
%5 = tail call i8* @strcat(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @RTLD_NOW
%7 = tail call i8* @dlopen(i8* %5, i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}
int sgs_hexchar(int c) {
  return ((c) >= '0' && (c) <= '9') || ((c) >= 'a' && (c) <= 'f') ||
         ((c) >= 'A' && (c) <= 'F');
}


x86 assembly (clang, -O0):
<sgs_hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <sgs_hexchar+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <sgs_hexchar+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <sgs_hexchar+0x39>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <sgs_hexchar+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <sgs_hexchar+0x52>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgs_hexchar>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @sgs_hexchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @sgs_hexchar(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int get_dow_1(char *, char **);
int get_dow_2(char *buf, char **end) {
  int res = get_dow_1(buf, end);
  return res == 0 ? 7 : res;
}


x86 assembly (clang, -O0):
<get_dow_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <get_dow_1@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1147 <get_dow_2+0x37>
mov    $0x7,%eax
mov    %eax,-0x18(%rbp)
jmp    114d <get_dow_2+0x3d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dow_2>:
push   %rax
call   1030 <get_dow_1@plt>
test   %eax,%eax
mov    $0x7,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_dow_2(i8* %0, i8** %1) {
%3 = tail call i32 @get_dow_1(i8* %0, i8** %1)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 7, i32 %3
ret i32 %5
}
void writel(unsigned int value, unsigned int address) {
  *((volatile unsigned int *)address) = value;
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @writel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @writel(i32 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 %0, i32* %4
ret void
}
unsigned long hash(const char *str) {
  unsigned long hash = 5381;
  int chr;
  while ((chr = *str++))
    hash = ((hash << 5) + hash) + chr;
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage(const char *progname) {
  printf("Usage: %s [errno]\n\n[errno] is whitespace-delimited list of errno "
         "numbers\n",
         progname);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"Usage: %s [errno]\0A\0A[errno] is whitespace-delimited list of errno numbers\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [74 x i8] c"Usage: %s [errno]\0A\0A[errno] is whitespace-delimited list of errno numbers\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *_dlerror() { return (char *)0; }


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

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

LLVM IR (-O0):
define i8* @_dlerror() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_dlerror() {
ret i8* null
}
minuspr(x, y) {
  char buf[30];
  sprintf(buf, "%d-%d", x, y);
  printf(" %4s", buf);
}


x86 assembly (clang, -O0):
<minuspr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minuspr>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ecx
mov    %edi,%edx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d-%d\00"
@.str.1 = [5 x i8] c" %4s\00"
define i32 @minuspr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [30 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d-%d\00"
@.str.1 = [5 x i8] c" %4s\00"
define i32 @minuspr(i32 %0, i32 %1) {
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void table(int n) {
  int i;
  for (i = 1; i <= n; i++) {
    printf("\t%d x %d = %d\n", i, n, i * n);
  }
}


x86 assembly (clang, -O0):
<table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1155 <table+0x45>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0x4(%rbp),%ecx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <table+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<table>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    1165 <table+0x55>
mov    %edi,%r15d
mov    %edi,%r12d
neg    %r12d
mov    $0x1,%ebx
lea    0xecf(%rip),%r14
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
lea    (%r12,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
add    %r15d,%ebp
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <table+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"\09%d x %d = %d\0A\00"
define void @table(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = mul nsw i32 %4, %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %0, i32 %5)
%7 = add nuw i32 %4, 1
%8 = icmp eq i32 %4, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
findv(dirv, dirc, cp) char **dirv;
int dirc;
char *cp;
{
  while (dirc > 0)
    findin(*dirv++, cp), dirc--;
}


x86 assembly (clang, -O0):
<findv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1158 <findv+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <findin@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <findv+0x13>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findv>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <findv+0x39>
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx),%rdi
add    $0x8,%rbx
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <findin@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <findv+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @findv(i8** nocapture %0, i32 %1, i8* %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3, %5
%6 = phi i8** [ %8, %5 ], [ %0, %3 ]
%7 = phi i32 [ %11, %5 ], [ %1, %3 ]
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %6
%10 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @findin to i32 (i8*, i8*, ...)*)(i8* %9, i8* %2)
%11 = add nsw i32 %7, -1
%12 = icmp ugt i32 %7, 1
br i1 %12, label %5, label %13
13: ; preds = %5, %3
ret i32 undef
}
void gdk_drawable_set_colormap() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drawable_set_colormap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Usage: cpu_speed [SPEED]\n");
  printf("SPEED should be a multiple of 3 between 45 and 81 inclusively.\n");
  printf("The Apple OS default is 66MHz, ZeroSlackr's default is 75MHz.\n");
  printf("To prevent your iPod from overheating, avoid extended usage at 78MHz "
         "or higher.\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: cpu_speed [SPEED]\0A\00"
@.str.1 = [64 x i8] c"SPEED should be a multiple of 3 between 45 and 81 inclusively.\0A\00"
@.str.2 = [63 x i8] c"The Apple OS default is 66MHz, ZeroSlackr's default is 75MHz.\0A\00"
@.str.3 = [81 x i8] c"To prevent your iPod from overheating, avoid extended usage at 78MHz or higher.\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Usage: cpu_speed [SPEED]\00"
@str.4 = [63 x i8] c"SPEED should be a multiple of 3 between 45 and 81 inclusively.\00"
@str.5 = [62 x i8] c"The Apple OS default is 66MHz, ZeroSlackr's default is 75MHz.\00"
@str.6 = [80 x i8] c"To prevent your iPod from overheating, avoid extended usage at 78MHz or higher.\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutInitDisplayMode(int);
void glutInitDisplayMode(int mode) { fn_glutInitDisplayMode(mode); }


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

x86 assembly (clang, -O2):
<glutInitDisplayMode>:
jmp    1030 <fn_glutInitDisplayMode@plt>

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

LLVM IR (-O2):
define void @glutInitDisplayMode(i32 %0) {
%2 = tail call i32 @fn_glutInitDisplayMode(i32 %0)
ret void
}
void Print(char text[]) {
  unsigned short *DisplayMemoryPtr = (unsigned short *)0xB8000;
  int i;
  for (i = 0; text[i] != 0; i++) {
    DisplayMemoryPtr[i] = (unsigned short)(0x0200 | text[i]);
  }
}


x86 assembly (clang, -O0):
<Print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <Print+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
or     $0x200,%eax
mov    %ax,%dx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <Print+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print>:
mov    (%rdi),%cl
test   %cl,%cl
je     112e <Print+0x2e>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
or     $0x200,%ecx
mov    %cx,0xb8000(%rax,%rax,1)
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <Print+0x10>
ret

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

LLVM IR (-O2):
define void @Print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = sext i8 %6 to i16
%8 = or i16 %7, 512
%9 = getelementptr inbounds i16, i16* inttoptr (i64 753664 to i16*), i64 %5
store i16 %8, i16* %9
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char const);
void printeltname1(void *d, const char *name, int l) {
  int i;
  printf("element ");
  for (i = 0; i < l; i++)
    putchar(name[i]);
}


x86 assembly (clang, -O0):
<printeltname1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1171 <printeltname1+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <printeltname1+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printeltname1>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
test   %ebp,%ebp
jle    1153 <printeltname1+0x33>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   (%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <printeltname1+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"element \00"
define void @printeltname1(i8* nocapture readnone %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @putchar(i8 signext %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %3
ret void
}
int map_comp_ptr(const void *a, const void *b) {
  return a > b ? 1 : a == b ? 0 : -1;
}


x86 assembly (clang, -O0):
<map_comp_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <map_comp_ptr+0x27>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <map_comp_ptr+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_comp_ptr>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
neg    %ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @map_comp_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ugt i8* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = icmp eq i8* %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 -1
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ 1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @map_comp_ptr(i8* readnone %0, i8* readnone %1) {
%3 = icmp ugt i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
void ExttTemplateAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttTemplateAuxTable() {
ret void
}
/* Variables and functions */
scalar_t__ prime_check(int);
int prime_max(int n) {
  int prime = 0;
  for (prime = n; prime > 1; prime--) {
    if (prime_check(prime))
      return prime;
  }
  return 0;
}


x86 assembly (clang, -O0):
<prime_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1162 <prime_max+0x52>
mov    -0xc(%rbp),%edi
call   1030 <prime_check@plt>
cmp    $0x0,%rax
je     114f <prime_max+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <prime_max+0x59>
jmp    1154 <prime_max+0x44>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <prime_max+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime_max>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     113a <prime_max+0x2a>
mov    %edi,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <prime_check@plt>
test   %rax,%rax
jne    1138 <prime_max+0x28>
lea    -0x1(%rbx),%eax
cmp    $0x2,%ebx
mov    %eax,%ebx
jg     1120 <prime_max+0x10>
jmp    113a <prime_max+0x2a>
mov    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @prime_max(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = tail call i64 @prime_check(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = icmp sgt i32 %4, 2
br i1 %9, label %3, label %10
10: ; preds = %3, %7, %1
%11 = phi i32 [ 0, %1 ], [ 0, %7 ], [ %4, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ go_straight_with_power(int);
void ramming_speed() { go_straight_with_power(127); }


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

x86 assembly (clang, -O2):
<ramming_speed>:
mov    $0x7f,%edi
jmp    1030 <go_straight_with_power@plt>

LLVM IR (-O0):
define void @ramming_speed() {
%1 = call i32 @go_straight_with_power(i32 127)
ret void
}

LLVM IR (-O2):
define void @ramming_speed() {
%1 = tail call i32 @go_straight_with_power(i32 127)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EMACTimestampTargetIntDisable(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x400EC000);
  (*((volatile uint32_t *)(ui32Base + 0x00000700))) &= ~0x00000010;
}


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

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

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

LLVM IR (-O2):
define void @EMACTimestampTargetIntDisable(i32 %0) {
%2 = icmp eq i32 %0, 1074708480
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 1792
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, -17
store volatile i32 %9, i32* %7
ret void
}
/* Type definitions */
struct group {
  int dummy;
};

/* Variables and functions */
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
struct group *getgrnam(char const *);
int /*<<< orphan*/ stderr;
struct group *v_getgrnam(const char *name) {
  struct group *grp;
  grp = NULL;
  if (!(grp = getgrnam(name)))
    fprintf(stderr, "Error %d: getgrnam() failure\n", errno);
  return (grp);
}


x86 assembly (clang, -O0):
<v_getgrnam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getgrnam@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1169 <v_getgrnam+0x49>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_getgrnam>:
push   %rbx
call   1040 <getgrnam@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <v_getgrnam+0x2c>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.group = type { i32 }
@stderr = global i32 0
@.str = [30 x i8] c"Error %d: getgrnam() failure\0A\00"
@errno = global i32 0
define %struct.group* @v_getgrnam(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.group*
store i8* %0, i8** %2
store %struct.group* null, %struct.group** %3
%4 = load i8*, i8** %2
%5 = call %struct.group* @getgrnam(i8* %4)
store %struct.group* %5, %struct.group** %3
%6 = icmp ne %struct.group* %5, null
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load %struct.group*, %struct.group** %3
ret %struct.group* %12
}

LLVM IR (-O2):
%struct.group = type { i32 }
@stderr = global i32 0
@.str = [30 x i8] c"Error %d: getgrnam() failure\0A\00"
@errno = global i32 0
define %struct.group* @v_getgrnam(i8* %0) {
%2 = tail call %struct.group* @getgrnam(i8* %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret %struct.group* %2
}
a() {}


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

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

LLVM IR (-O0):
define i32 @a() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @a() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_scalbn();
scalar_t__ scalbn(double, int);
void test_scalbn(double d, int x) {
  if (scalbn(d, x) != scalbn(d, x))
    link_failure_scalbn();
}


x86 assembly (clang, -O0):
<test_scalbn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <scalbn@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <scalbn@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1165 <test_scalbn+0x45>
mov    $0x0,%al
call   1040 <link_failure_scalbn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scalbn>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movsd  %xmm0,(%rsp)
call   1030 <scalbn@plt>
mov    %rax,%r14
movsd  (%rsp),%xmm0
mov    %ebx,%edi
call   1030 <scalbn@plt>
cmp    %rax,%r14
jne    114c <test_scalbn+0x2c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_scalbn@plt>

LLVM IR (-O0):
define void @test_scalbn(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = call i64 @scalbn(double %5, i32 %6)
%8 = load double, double* %3
%9 = load i32, i32* %4
%10 = call i64 @scalbn(double %8, i32 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_scalbn()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_scalbn(double %0, i32 %1) {
%3 = tail call i64 @scalbn(double %0, i32 %1)
%4 = tail call i64 @scalbn(double %0, i32 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_scalbn()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _s2warn(char *, char *);
void ss2pt_(unsigned int *iid) {
  _s2warn("ss2pt", "function not available from FORTRAN");
  return;
}


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

x86 assembly (clang, -O2):
<ss2pt_>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <_s2warn@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ss2pt\00"
@.str.1 = [36 x i8] c"function not available from FORTRAN\00"
define void @ss2pt_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @_s2warn(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ss2pt\00"
@.str.1 = [36 x i8] c"function not available from FORTRAN\00"
define void @ss2pt_(i32* nocapture readnone %0) {
%2 = tail call i32 @_s2warn(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret void
}
execvsrh(argv) char **argv;
{ return (excvsrh(argv[0], argv)); }


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

x86 assembly (clang, -O2):
<execvsrh>:
mov    %rdi,%rsi
mov    (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <excvsrh@plt>

LLVM IR (-O0):
define i32 @execvsrh(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @excvsrh to i32 (i8*, i8**, ...)*)(i8* %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @execvsrh(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @excvsrh to i32 (i8*, i8**, ...)*)(i8* %2, i8** %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  char c1;
  int i = 0;
  c1 = 'a';
  while (c1 >= 'a' && c1 <= 'z') {
    c1++;
    i++;
  }
  printf("%d", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movb   $0x61,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0xd(%rbp)
jl     1149 <main+0x39>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1159 <main+0x49>
jmp    116f <main+0x5f>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <main+0x1a>
mov    -0xc(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 26)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _ReadWriteBarrier();
void check_ReadWriteBarrier() { _ReadWriteBarrier(); }


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

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

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

LLVM IR (-O2):
define void @check_ReadWriteBarrier() {
%1 = tail call i32 (...) @_ReadWriteBarrier()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __destroy(void *value) { free(value); }


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

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

LLVM IR (-O2):
define void @__destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_8Fuint32_reg(unsigned int val) {
  return ((val) & (0x8F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Fuint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 143
%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_8Fuint32_reg(i32 %0) {
%2 = and i32 %0, 143
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *strncpy(char *dest, const char *src, size_t n) {
  const char *s = src;
  char *d = dest;
  while (n-- && (*d++ = *s++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x29(%rbp)
je     116c <strncpy+0x6c>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    117c <strncpy+0x7c>
jmp    1181 <strncpy+0x81>
jmp    1120 <strncpy+0x20>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rcx,%rdx
je     1126 <strncpy+0x26>
movzbl (%rsi,%rcx,1),%edi
mov    %dil,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dil,%dil
jne    1110 <strncpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i64 [ %2, %3 ], [ %10, %9 ]
%6 = phi i8* [ %1, %3 ], [ %11, %9 ]
%7 = phi i8* [ %0, %3 ], [ %13, %9 ]
%8 = icmp eq i64 %5, 0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = add i64 %5, -1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %6
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %12, i8* %7
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %9
ret i8* %0
}