xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char str[] = "teste";
  char *strx = "teste";
  printf("%s", str);
  printf("%s", strx);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x6(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movw   $0x65,0x4(%rsp)
movl   $0x74736574,(%rsp)
lea    0xed7(%rip),%r14
lea    0xed6(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"teste\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void DecBin(int n) {
  if (n > 0) {
    DecBin(n / 2);
    printf("%d", n % 2);
  } else if (n != 0)
    printf("%d", n);
}


x86 assembly (clang, -O0):
<DecBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1165 <DecBin+0x45>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <DecBin@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <DecBin+0x63>
cmpl   $0x0,-0x4(%rbp)
je     117e <DecBin+0x5e>
mov    -0x4(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <DecBin+0x63>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecBin>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jle    1135 <DecBin+0x15>
mov    %ebx,%edi
shr    %edi
call   1040 <DecBin@plt>
and    $0x1,%ebx
jmp    1137 <DecBin+0x17>
je     1146 <DecBin+0x26>
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @DecBin(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %7, label %10
3: ; preds = %10, %7
%4 = phi i32 [ %9, %7 ], [ %0, %10 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3, %10
ret void
7: ; preds = %1
%8 = lshr i32 %0, 1
tail call void @DecBin(i32 %8)
%9 = and i32 %0, 1
br label %3
10: ; preds = %1
%11 = icmp eq i32 %0, 0
br i1 %11, label %6, label %3
}
void rop3_26_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S & T;
  stk2 = *D | stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_26_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_26_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %6
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_26_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
void smp_stop_cpu(void) {}


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

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

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

LLVM IR (-O2):
define void @smp_stop_cpu() {
ret void
}
int f4(int x, int y) { return (x & ~0xff) | (y & 0xff); }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff00,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
and    $0xffffff00,%edi
movzbl %sil,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @f4(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 = and i32 %5, -256
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f4(i32 %0, i32 %1) {
%3 = and i32 %0, -256
%4 = and i32 %1, 255
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int rom_present(char *);
int tvga8900d_available(void) {
  return rom_present(L"roms/video/tvga/trident.bin");
}


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

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

LLVM IR (-O0):
@.str = [28 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 116, i32 118, i32 103, i32 97, i32 47, i32 116, i32 114, i32 105, i32 100, i32 101, i32 110, i32 116, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @tvga8900d_available() {
%1 = call i32 @rom_present(i8* bitcast ([28 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [28 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 116, i32 118, i32 103, i32 97, i32 47, i32 116, i32 114, i32 105, i32 100, i32 101, i32 110, i32 116, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @tvga8900d_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([28 x i32]* @.str to i8*))
ret i32 %1
}
int ptls_server_name_is_ipaddr(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ptls_server_name_is_ipaddr(i8* nocapture readnone %0) {
ret i32 0
}
int postinc_arg_ptr(int *p) {
  int *q;
  q = p + 1;
  __builtin_prefetch(p++, 0, 0);
  return p == q;
}


x86 assembly (clang, -O0):
<postinc_arg_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
prefetchnta (%rax)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<postinc_arg_ptr>:
prefetchnta (%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @postinc_arg_ptr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %2
%8 = bitcast i32* %6 to i8*
%9 = load i32*, i32** %2
%10 = load i32*, i32** %3
%11 = icmp eq i32* %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @postinc_arg_ptr(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
tail call void @llvm.prefetch.p0i8(i8* %2, i32 0, i32 0, i32 1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void syslog_init(void) { openlog("webfsd", LOG_PID, LOG_DAEMON); }


x86 assembly (clang, -O0):
<syslog_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
lea    0xed3(%rip),%rdi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslog_init>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
lea    0xed7(%rip),%rdi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"webfsd\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @syslog_init() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_DAEMON
%3 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"webfsd\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @syslog_init() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_DAEMON
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
char *ctime(int *);
int /*<<< orphan*/ printf(char *, char *, ...);
int time(int /*<<< orphan*/);
int main() {
  int t = time(0);
  printf("%s\n", ctime(&t));
  printf("%s %s\n", "Mar 18 2022", "10:56:39");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    0xe9d(%rip),%rsi
lea    0xea2(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xeb6(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
lea    0xea2(%rip),%rsi
lea    0xea7(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
@.str.2 = [12 x i8] c"Mar 18 2022\00"
@.str.3 = [9 x i8] c"10:56:39\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @time(i32 0)
store i32 %2, i32* %1
%3 = call i8* @ctime(i32* %1)
%4 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
@.str.2 = [12 x i8] c"Mar 18 2022\00"
@.str.3 = [9 x i8] c"10:56:39\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32 0)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
__attribute__((no, noclone)) void f0(int x) {
  char vla[x];
  foo(vla);
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <foo@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
call   1030 <foo@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @f0(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = call i32 @foo(i8* %8)
%10 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @f0(i32 %0) {
%2 = zext i32 %0 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @foo(i8* %3)
ret void
}
int bit_RTS(unsigned char reg_value) { return (reg_value & 0x10) == 0x10; }


x86 assembly (clang, -O0):
<bit_RTS>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x10,%eax
cmp    $0x10,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_RTS>:
shr    $0x4,%dil
and    $0x1,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @bit_RTS(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 16
%6 = icmp eq i32 %5, 16
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @bit_RTS(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
void strncmp_constant0() {
  if (strncmp("123", "123", 3) != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncmp_constant0>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rsi
mov    $0x3,%edx
mov    %rsi,%rdi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1132 <strncmp_constant0+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_constant0>:
lea    0xee9(%rip),%rdi
mov    %rdi,%rsi
mov    $0x3,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strncmp_constant0() {
%1 = call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = load i8, i8* null
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strncmp_constant0() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
unsigned plus_1_mod_2(const unsigned x) { return x ^ 1u; }


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

x86 assembly (clang, -O2):
<plus_1_mod_2>:
mov    %edi,%eax
xor    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @plus_1_mod_2(i32 %0) {
%2 = xor i32 %0, 1
ret i32 %2
}
void sti() { __asm__ volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void gtk_text_iter_set_line_offset() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_set_line_offset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ curs_endwin();
int /*<<< orphan*/ curs_refresh();
int /*<<< orphan*/ dis_term();
void dis_scrn(void) {
  dis_term();
  curs_refresh();
  curs_endwin();
}


x86 assembly (clang, -O0):
<dis_scrn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dis_term@plt>
mov    $0x0,%al
call   1050 <curs_refresh@plt>
mov    $0x0,%al
call   1040 <curs_endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dis_scrn>:
push   %rax
xor    %eax,%eax
call   1030 <dis_term@plt>
xor    %eax,%eax
call   1050 <curs_refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <curs_endwin@plt>

LLVM IR (-O0):
define void @dis_scrn() {
%1 = call i32 (...) @dis_term()
%2 = call i32 (...) @curs_refresh()
%3 = call i32 (...) @curs_endwin()
ret void
}

LLVM IR (-O2):
define void @dis_scrn() {
%1 = tail call i32 (...) @dis_term()
%2 = tail call i32 (...) @curs_refresh()
%3 = tail call i32 (...) @curs_endwin()
ret void
}
void input_init() {}


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

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

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

LLVM IR (-O2):
define void @input_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crash();
void *malloc(size_t);
int /*<<< orphan*/ warnx(char *);
void *xmalloc(size_t size) {
  void *p;
  if ((p = malloc(size)) == NULL) {
    warnx("malloc failed");
    crash();
  }
  return (p);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1166 <xmalloc+0x36>
lea    0xea6(%rip),%rdi
call   1040 <warnx@plt>
mov    $0x0,%al
call   1030 <crash@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <xmalloc+0x21>
lea    0xebb(%rip),%rdi
call   1040 <warnx@plt>
xor    %eax,%eax
call   1030 <crash@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"malloc failed\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @warnx(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @crash()
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"malloc failed\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @warnx(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @crash()
br label %7
7: ; preds = %4, %1
ret i8* %2
}
int f(int a, int b, int c) {
  a -= (b >> 16) * (c >> 16);
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
imul   %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113a <f+0x3a>
movl   $0xa,-0x4(%rbp)
jmp    1140 <f+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sar    $0x10,%esi
sar    $0x10,%edx
imul   %esi,%edx
sub    %edx,%edi
mov    $0xa,%eax
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %1, 16
%5 = ashr i32 %2, 16
%6 = mul nsw i32 %5, %4
%7 = sub nsw i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 10, i32 %7
ret i32 %9
}
/* Variables and functions */
long strtol(char const *, int /*<<< orphan*/ *, int);
long atol(const char *nptr) { return strtol(nptr, NULL, 10); }


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

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
ret i64 %2
}
unsigned hash_uint(unsigned key, unsigned buckets) {
  return key * 0x61C88647 % buckets;
}


x86 assembly (clang, -O0):
<hash_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x61c88647,-0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_uint>:
imul   $0x61c88647,%edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash_uint(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 = mul i32 %5, 1640531527
%7 = load i32, i32* %4
%8 = urem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash_uint(i32 %0, i32 %1) {
%3 = mul i32 %0, 1640531527
%4 = urem i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cosmc(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double x;
  printf("cos(x)\nIntroduzca valor de x en grados: ");
  scanf("%lf", &x);
  x = x * (3.1416 / 180.0);
  printf("cos(x)=%lf\n", cosmc(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  0xe9b(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cosmc@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xea5(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1040 <cosmc@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"cos(x)\0AIntroduzca valor de x en grados: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [12 x i8] c"cos(x)=%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fmul double %5, 0x3F91DF495F7DCD44
store double %6, double* %2
%7 = load double, double* %2
%8 = call i32 @cosmc(double %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"cos(x)\0AIntroduzca valor de x en grados: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [12 x i8] c"cos(x)=%lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 0x3F91DF495F7DCD44
store double %6, double* %1
%7 = call i32 @cosmc(double %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
float min(float a, float b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <min+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgdec1ib(void) { ngen("%s\t(%%eax)", "decb", 0); }


x86 assembly (clang, -O0):
<cgdec1ib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec1ib>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09(%%eax)\00"
@.str.1 = [5 x i8] c"decb\00"
define void @cgdec1ib() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09(%%eax)\00"
@.str.1 = [5 x i8] c"decb\00"
define void @cgdec1ib() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
g() { return '\n'; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 10
}

LLVM IR (-O2):
define i32 @g() {
ret i32 10
}
void fftss_plan_with_nthreads(int nthreads) { return; }


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

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

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

LLVM IR (-O2):
define void @fftss_plan_with_nthreads(i32 %0) {
ret void
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  scalar_t__ sa_family;
};
typedef int socklen_t;

/* Variables and functions */
scalar_t__ AF_INET;
socklen_t get_sockaddr_size(const struct sockaddr *sa) {
  return sa->sa_family == AF_INET ? sizeof(struct sockaddr_in)
                                  : sizeof(struct sockaddr_in6);
}


x86 assembly (clang, -O0):
<get_sockaddr_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    0x2ed2(%rip),%rax
mov    (%rax),%rdx
mov    $0x4,%eax
cmp    %rdx,%rcx
cmove  %rax,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i64 }
@AF_INET = global i64 0
define i32 @get_sockaddr_size(%struct.sockaddr* %0) {
%2 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %2
%3 = load %struct.sockaddr*, %struct.sockaddr** %2
%4 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @AF_INET
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i64 4, i64 4
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i64 }
@AF_INET = global i64 0
define i32 @get_sockaddr_size(%struct.sockaddr* nocapture readnone %0) {
ret i32 4
}
int getMaxY(char *str) {
  int numOfHashes = 0, i = 0;
  while (str[i] != '\0') {
    if (str[i] == '#') {
      numOfHashes = numOfHashes + 1;
    }
    i = i + 1;
  }
  return (numOfHashes + 1);
}


x86 assembly (clang, -O0):
<getMaxY>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <getMaxY+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
jne    1149 <getMaxY+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <getMaxY+0x16>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMaxY>:
xor    %eax,%eax
jmp    1117 <getMaxY+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x23,%cl
je     1110 <getMaxY+0x10>
test   %cl,%cl
jne    1113 <getMaxY+0x13>
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getMaxY(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %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 %27
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 = icmp eq i32 %19, 35
br i1 %20, label %21, label %24
21: ; preds = %13
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %13
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
ret i32 %29
}

LLVM IR (-O2):
define i32 @getMaxY(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 35, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
%13 = add nsw i32 %4, 1
ret i32 %13
}
int using_time_asked(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @using_time_asked() {
ret i32 0
}
void gtk_rc_style_copy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_style_copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int strlen(char *);
int main() {
  char *hello = "Hello, world!";
  printf("Greeting message: %s\nLength: %i.\n", hello, strlen(hello));
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xed7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [34 x i8] c"Greeting message: %s\0ALength: %i.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %5)
ret i32 1
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [34 x i8] c"Greeting message: %s\0ALength: %i.\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
void XcmsSetCompressionProc() {}


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

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

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

LLVM IR (-O2):
define void @XcmsSetCompressionProc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ key(unsigned char, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ special(int, int /*<<< orphan*/, int /*<<< orphan*/);
void menu(int value) {
  if (value < 0)
    special(-value, 0, 0);
  else
    key((unsigned char)value, 0, 0);
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1148 <menu+0x28>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <special@plt>
jmp    1157 <menu+0x37>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <key@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
test   %edi,%edi
js     1131 <menu+0x11>
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <key@plt>
neg    %edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1040 <special@plt>

LLVM IR (-O0):
define void @menu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
%8 = call i32 @special(i32 %7, i32 0, i32 0)
br label %13
9: ; preds = %1
%10 = load i32, i32* %2
%11 = trunc i32 %10 to i8
%12 = call i32 @key(i8 zeroext %11, i32 0, i32 0)
br label %13
13: ; preds = %9, %5
ret void
}

LLVM IR (-O2):
define void @menu(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = tail call i32 @special(i32 %4, i32 0, i32 0)
br label %9
6: ; preds = %1
%7 = trunc i32 %0 to i8
%8 = tail call i32 @key(i8 zeroext %7, i32 0, i32 0)
br label %9
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
int *malloc(int);
int *malloc_loop_zero(int n) {
  int i, *a = malloc(n * sizeof(int));
  for (i = 0; i < n; i++)
    a[i] = 0;
  return a;
}


x86 assembly (clang, -O0):
<malloc_loop_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115e <malloc_loop_zero+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <malloc_loop_zero+0x25>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_loop_zero>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <malloc_loop_zero+0x29>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @malloc_loop_zero(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call i32* @malloc(i32 %8)
store i32* %9, i32** %4
store i32 0, i32* %3
br label %10
10: ; preds = %19, %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i32*, i32** %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 0, i32* %18
br label %19
19: ; preds = %14
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %10
22: ; preds = %10
%23 = load i32*, i32** %4
ret i32* %23
}

LLVM IR (-O2):
define noalias i32* @malloc_loop_zero(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = bitcast i32* %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %1
ret i32* %3
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double now() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
const char *strerrno(int err) {
  switch (err) {
  case 0:
    return "OK";
  default:
    return "E??";
  }
}


x86 assembly (clang, -O0):
<strerrno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <strerrno+0x27>
jmp    1117 <strerrno+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <strerrno+0x32>
lea    0xed5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerrno>:
test   %edi,%edi
lea    0xef7(%rip),%rcx
lea    0xef3(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [4 x i8] c"E??\00"
define i8* @strerrno(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [4 x i8] c"E??\00"
define i8* @strerrno(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *safeMalloc(int);
char *stringNew(size_t length) {
  char *cString = NULL;
  assert(length >= 0);
  cString = safeMalloc(sizeof(char) * (length + 1));
  if (cString == NULL) {
    return NULL;
  }
  cString[length] = '\0';
  return cString;
}


x86 assembly (clang, -O0):
<stringNew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <safeMalloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1175 <stringNew+0x55>
movq   $0x0,-0x8(%rbp)
jmp    1189 <stringNew+0x69>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringNew>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1040 <assert@plt>
lea    0x1(%rbx),%edi
call   1030 <safeMalloc@plt>
test   %rax,%rax
je     113f <stringNew+0x1f>
movb   $0x0,(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @stringNew(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* null, i8** %4
%5 = load i64, i64* %3
%6 = icmp uge i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i64, i64* %3
%10 = add i64 %9, 1
%11 = mul i64 1, %10
%12 = trunc i64 %11 to i32
%13 = call i8* @safeMalloc(i32 %12)
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %1
store i8* null, i8** %2
br label %22
17: ; preds = %1
%18 = load i8*, i8** %4
%19 = load i64, i64* %3
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %20
%21 = load i8*, i8** %4
store i8* %21, i8** %2
br label %22
22: ; preds = %17, %16
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @stringNew(i64 %0) {
%2 = tail call i32 @assert(i32 1)
%3 = trunc i64 %0 to i32
%4 = add i32 %3, 1
%5 = tail call i8* @safeMalloc(i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = getelementptr inbounds i8, i8* %5, i64 %0
store i8 0, i8* %8
br label %9
9: ; preds = %1, %7
ret i8* %5
}
/* Variables and functions */
unsigned char gf16_mul_8(unsigned char);
unsigned char gf256_mul_0x10(unsigned char a) {
  unsigned char a1 = (a >> 4);
  unsigned char rd0 = gf16_mul_8(a1);
  unsigned char a0 = a << 4;
  unsigned char _a1 = a & 0xf0;
  return a0 ^ _a1 ^ rd0;
}


x86 assembly (clang, -O0):
<gf256_mul_0x10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <gf16_mul_8@plt>
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf0,%eax
mov    %al,-0x5(%rbp)
movzbl -0x4(%rbp),%eax
movzbl -0x5(%rbp),%ecx
xor    %ecx,%eax
movzbl -0x3(%rbp),%ecx
xor    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf256_mul_0x10>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <gf16_mul_8@plt>
mov    %ebx,%ecx
shl    $0x4,%cl
and    $0xf0,%bl
xor    %cl,%bl
xor    %bl,%al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @gf256_mul_0x10(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %2
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 4
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = call zeroext i8 @gf16_mul_8(i8 zeroext %11)
store i8 %12, i8* %4
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 4
%16 = trunc i32 %15 to i8
store i8 %16, i8* %5
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = and i32 %18, 240
%20 = trunc i32 %19 to i8
store i8 %20, i8* %6
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = load i8, i8* %4
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
ret i8 %29
}

LLVM IR (-O2):
define zeroext i8 @gf256_mul_0x10(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call zeroext i8 @gf16_mul_8(i8 zeroext %2)
%4 = shl i8 %0, 4
%5 = and i8 %0, -16
%6 = xor i8 %4, %5
%7 = xor i8 %6, %3
ret i8 %7
}