xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int, char *, char *);
char *strrchr(char const *, int);
void fig08_23() {
  const char *string1 = "A zoo has many animals including zebras";
  int c = 'z';
  printf("%s\n%s'%c'%s\"%s\"\n", "The reminder of string1 beginning with the",
         "last occurrence of character ", c, " is: ", strrchr(string1, c));
}


x86 assembly (clang, -O0):
<fig08_23>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x7a,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <strrchr@plt>
mov    -0x10(%rbp),%ecx
mov    %rax,%r9
lea    0xecf(%rip),%rdi
lea    0xed9(%rip),%rsi
lea    0xefd(%rip),%rdx
lea    0xf14(%rip),%r8
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig08_23>:
lea    0xf11(%rip),%rdi
lea    0xf1b(%rip),%rsi
lea    0xf3f(%rip),%rdx
lea    0xf56(%rip),%r8
lea    0xeee(%rip),%r9
mov    $0x7a,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"A zoo has many animals including zebras\00"
@.str.1 = [17 x i8] c"%s\0A%s'%c'%s\22%s\22\0A\00"
@.str.2 = [43 x i8] c"The reminder of string1 beginning with the\00"
@.str.3 = [30 x i8] c"last occurrence of character \00"
@.str.4 = [6 x i8] c" is: \00"
define void @fig08_23() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8** %1
store i32 122, i32* %2
%3 = load i32, i32* %2
%4 = load i8*, i8** %1
%5 = load i32, i32* %2
%6 = call i8* @strrchr(i8* %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"A zoo has many animals including zebras\00"
@.str.1 = [17 x i8] c"%s\0A%s'%c'%s\22%s\22\0A\00"
@.str.2 = [43 x i8] c"The reminder of string1 beginning with the\00"
@.str.3 = [30 x i8] c"last occurrence of character \00"
@.str.4 = [6 x i8] c" is: \00"
define void @fig08_23() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 122, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 33))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main() {
  int j = 0;
  if (!j) {
    return 1;
  } else {
    foo();
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    114a <main+0x3a>
mov    $0x0,%al
call   1030 <foo@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void tegra_sdmmc_tap_delay(struct clk *c, int delay) {}


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

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

LLVM IR (-O0):
%struct.clk = type opaque
define void @tegra_sdmmc_tap_delay(%struct.clk* %0, i32 %1) {
%3 = alloca %struct.clk*
%4 = alloca i32
store %struct.clk* %0, %struct.clk** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.clk = type opaque
define void @tegra_sdmmc_tap_delay(%struct.clk* nocapture %0, i32 %1) {
ret void
}
const char *STM_getName() { return "ShrunkTileMap (compressed)"; }


x86 assembly (clang, -O0):
<STM_getName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"ShrunkTileMap (compressed)\00"
define i8* @STM_getName() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"ShrunkTileMap (compressed)\00"
define i8* @STM_getName() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ dump(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Usage: %s filename\n", argv[0]);
    return -1;
  }
  dump(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <dump@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     113c <main+0x1c>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1040 <dump@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Usage: %s filename\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @dump(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ -1, %4 ], [ 0, %7 ]
ret i32 %12
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISLNK(int /*<<< orphan*/);
scalar_t__ lstat(char const *, struct stat *);
extern int issym(const char *fn) {
  struct stat buf;
  return (lstat(fn, &buf) ? 0 : S_ISLNK(buf.st_mode));
}


x86 assembly (clang, -O0):
<issym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
je     114d <issym+0x2d>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <issym+0x38>
mov    -0x10(%rbp),%edi
call   1030 <S_ISLNK@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issym>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
test   %rax,%rax
je     1132 <issym+0x12>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISLNK@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @issym(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @lstat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISLNK(i32 %10)
br label %12
12: ; preds = %8, %7
%13 = phi i32 [ 0, %7 ], [ %11, %8 ]
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @issym(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISLNK(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
double atmoT(double);
double sqrt(double);
double atmoC(double h) {
  double c;
  double T;
  T = atmoT(h);
  c = 20.05 * sqrt(T);
  return c;
}


x86 assembly (clang, -O0):
<atmoC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <atmoT@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeaf(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmoC>:
push   %rax
call   1030 <atmoT@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1136 <atmoC+0x16>
sqrtsd %xmm0,%xmm0
jmp    113b <atmoC+0x1b>
call   1040 <sqrt@plt>
mulsd  0xebd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atmoC(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @atmoT(double %5)
store double %6, double* %4
%7 = load double, double* %4
%8 = call double @sqrt(double %7)
%9 = fmul double 2.005000e+01, %8
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @atmoC(double %0) {
%2 = tail call double @atmoT(double %0)
%3 = tail call double @sqrt(double %2)
%4 = fmul double %3, 2.005000e+01
ret double %4
}
void glUseProgram(unsigned int program) {}


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

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

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

LLVM IR (-O2):
define void @glUseProgram(i32 %0) {
ret void
}
int smb1357_set_Ichg(int i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @smb1357_set_Ichg(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ call7h(unsigned short, unsigned long, unsigned int, char,
                          int, short, long, float, unsigned char, double);
void call7g(double d, unsigned short us, unsigned long ul, unsigned int ui,
            char c, int i, short s, long l, float f, unsigned char uc) {
  call7h(us, ul, ui, c, i, s, l, f, uc, d);
}


x86 assembly (clang, -O0):
<call7g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r9w,%ax
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9
movsd  %xmm0,-0x8(%rbp)
mov    %di,-0xa(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %cl,-0x1d(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %ax,-0x26(%rbp)
movss  %xmm1,-0x2c(%rbp)
mov    -0xa(%rbp),%di
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x1d(%rbp),%cl
mov    -0x24(%rbp),%r8d
mov    -0x26(%rbp),%r9w
mov    0x10(%rbp),%r10
movss  -0x2c(%rbp),%xmm0
mov    0x18(%rbp),%al
movsd  -0x8(%rbp),%xmm1
movzwl %di,%edi
movsbl %cl,%ecx
movswl %r9w,%r9d
mov    %r10,(%rsp)
movzbl %al,%eax
mov    %eax,0x8(%rsp)
call   1030 <call7h@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call7g>:
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
jmp    1030 <call7h@plt>

LLVM IR (-O0):
define void @call7g(double %0, i16 zeroext %1, i64 %2, i32 %3, i8 signext %4, i32 %5, i16 signext %6, i64 %7, float %8, i8 zeroext %9) {
%11 = alloca double
%12 = alloca i16
%13 = alloca i64
%14 = alloca i32
%15 = alloca i8
%16 = alloca i32
%17 = alloca i16
%18 = alloca i64
%19 = alloca float
%20 = alloca i8
store double %0, double* %11
store i16 %1, i16* %12
store i64 %2, i64* %13
store i32 %3, i32* %14
store i8 %4, i8* %15
store i32 %5, i32* %16
store i16 %6, i16* %17
store i64 %7, i64* %18
store float %8, float* %19
store i8 %9, i8* %20
%21 = load i16, i16* %12
%22 = load i64, i64* %13
%23 = load i32, i32* %14
%24 = load i8, i8* %15
%25 = load i32, i32* %16
%26 = load i16, i16* %17
%27 = load i64, i64* %18
%28 = load float, float* %19
%29 = load i8, i8* %20
%30 = load double, double* %11
%31 = call i32 @call7h(i16 zeroext %21, i64 %22, i32 %23, i8 signext %24, i32 %25, i16 signext %26, i64 %27, float %28, i8 zeroext %29, double %30)
ret void
}

LLVM IR (-O2):
define void @call7g(double %0, i16 zeroext %1, i64 %2, i32 %3, i8 signext %4, i32 %5, i16 signext %6, i64 %7, float %8, i8 zeroext %9) {
%11 = tail call i32 @call7h(i16 zeroext %1, i64 %2, i32 %3, i8 signext %4, i32 %5, i16 signext %6, i64 %7, float %8, i8 zeroext %9, double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
bool destroy_unix_stream_socket(int sock) {
  close(sock);
  return true;
}


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

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

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

LLVM IR (-O2):
define i32 @destroy_unix_stream_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(~1 == -2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
int isspecial(unsigned char c) {
  return (c == '/' || c == '"' || c == '{' || c == '[' || c == ']' || c == '}');
}


x86 assembly (clang, -O0):
<isspecial>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspecial+0x71>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x22,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspecial+0x71>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7b,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspecial+0x71>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5b,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspecial+0x71>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5d,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspecial+0x71>
movzbl -0x1(%rbp),%eax
cmp    $0x7d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspecial>:
mov    $0x1,%eax
lea    -0x22(%rdi),%ecx
cmp    $0x3b,%cl
ja     1120 <isspecial+0x20>
movzbl %cl,%ecx
movabs $0xa00000000002001,%rdx
bt     %rcx,%rdx
jb     1126 <isspecial+0x26>
cmp    $0x7b,%dil
jne    1127 <isspecial+0x27>
ret
xor    %eax,%eax
cmp    $0x7d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isspecial(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 47
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 34
br i1 %9, label %26, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 123
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 91
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %20, 93
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = icmp eq i32 %24, 125
br label %26
26: ; preds = %22, %18, %14, %10, %6, %1
%27 = phi i1 [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @isspecial(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 123, label %5
i8 93, label %5
i8 91, label %5
i8 47, label %5
i8 34, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 125
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void eth_int_disable(void) {
  *((volatile unsigned long *)(0x92000000 + 0x08)) = 0;
}


x86 assembly (clang, -O0):
<eth_int_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x92000008,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<eth_int_disable>:
mov    $0x92000008,%eax
movq   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @eth_int_disable() {
store volatile i64 0, i64* inttoptr (i64 2449473544 to i64*)
ret void
}

LLVM IR (-O2):
define void @eth_int_disable() {
store volatile i64 0, i64* inttoptr (i64 2449473544 to i64*)
ret void
}
void outer_flush_all(void) {}


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

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

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

LLVM IR (-O2):
define void @outer_flush_all() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_get_monotonic_usec(void *m, uint64_t *usec) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_get_monotonic_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_get_monotonic_usec>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_monotonic_usec(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_monotonic_usec(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int consecutivechar(char *, char, int, int);
int replacespaces(char aux[], int pos, int mintabs, int minblanks) {
  pos = consecutivechar(aux, '\t', pos, mintabs);
  pos = consecutivechar(aux, ' ', pos, minblanks);
  return pos;
}


x86 assembly (clang, -O0):
<replacespaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x9,%esi
call   1030 <consecutivechar@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    $0x20,%esi
call   1030 <consecutivechar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replacespaces>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rbx
mov    $0x9,%esi
call   1030 <consecutivechar@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %eax,%edx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <consecutivechar@plt>

LLVM IR (-O0):
define i32 @replacespaces(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @consecutivechar(i8* %9, i8 signext 9, i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = call i32 @consecutivechar(i8* %13, i8 signext 32, i32 %14, i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
define i32 @replacespaces(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @consecutivechar(i8* %0, i8 signext 9, i32 %1, i32 %2)
%6 = tail call i32 @consecutivechar(i8* %0, i8 signext 32, i32 %5, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ AL_SetMaxMidiChannel(int);
void MUSIC_SetMaxFMMidiChannel(int channel) { AL_SetMaxMidiChannel(channel); }


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

x86 assembly (clang, -O2):
<MUSIC_SetMaxFMMidiChannel>:
jmp    1030 <AL_SetMaxMidiChannel@plt>

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

LLVM IR (-O2):
define void @MUSIC_SetMaxFMMidiChannel(i32 %0) {
%2 = tail call i32 @AL_SetMaxMidiChannel(i32 %0)
ret void
}
double f_eval_small(double x, double v, double A, double B) {
  return (1 + A) * (B - v) + x * (1 + B) * (A - v);
}


x86 assembly (clang, -O0):
<f_eval_small>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  0xee0(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  0xec4(%rip),%xmm3
addsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movsd  -0x18(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eval_small>:
movsd  0xef8(%rip),%xmm4
movapd %xmm2,%xmm5
addsd  %xmm4,%xmm5
addsd  %xmm3,%xmm4
subsd  %xmm1,%xmm3
mulsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm0
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @f_eval_small(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = fadd double 1.000000e+00, %9
%11 = load double, double* %8
%12 = load double, double* %6
%13 = fsub double %11, %12
%14 = load double, double* %5
%15 = load double, double* %8
%16 = fadd double 1.000000e+00, %15
%17 = fmul double %14, %16
%18 = load double, double* %7
%19 = load double, double* %6
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = call double @llvm.fmuladd.f64(double %10, double %13, double %21)
ret double %22
}

LLVM IR (-O2):
define double @f_eval_small(double %0, double %1, double %2, double %3) {
%5 = fadd double %2, 1.000000e+00
%6 = fsub double %3, %1
%7 = fadd double %3, 1.000000e+00
%8 = fmul double %7, %0
%9 = fsub double %2, %1
%10 = fmul double %9, %8
%11 = tail call double @llvm.fmuladd.f64(double %5, double %6, double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "%s: DOCSET_DIR\n", progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"%s: DOCSET_DIR\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"%s: DOCSET_DIR\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void incorect_param() {
  fprintf(stderr, "You need enter 2 parameters:\n                 \r1. Memory "
                  "id \n                 \r2. Multiplier for rand\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<incorect_param>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<incorect_param>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [103 x i8] c"You need enter 2 parameters:\0A \0D1. Memory id \0A \0D2. Multiplier for rand\0A\00"
@EXIT_FAILURE = global i32 0
define void @incorect_param() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [103 x i8] c"You need enter 2 parameters:\0A \0D1. Memory id \0A \0D2. Multiplier for rand\0A\00"
@EXIT_FAILURE = global i32 0
define void @incorect_param() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ __wcstoull_internal(int /*<<< orphan*/ const *,
                                       int /*<<< orphan*/ **, int,
                                       int /*<<< orphan*/);
uintmax_t wcstoumax(const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
                    int base) {
  return __wcstoull_internal(nptr, endptr, base, 0);
}


x86 assembly (clang, -O0):
<wcstoumax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <__wcstoull_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstoumax>:
xor    %ecx,%ecx
jmp    1030 <__wcstoull_internal@plt>

LLVM IR (-O0):
define i32 @wcstoumax(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32**
%6 = alloca i32
store i32* %0, i32** %4
store i32** %1, i32*** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32**, i32*** %5
%9 = load i32, i32* %6
%10 = call i32 @__wcstoull_internal(i32* %7, i32** %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @wcstoumax(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = tail call i32 @__wcstoull_internal(i32* %0, i32** %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void delayMicroseconds(unsigned int howLong) {
  struct timespec sleeper, dummy;
  sleeper.tv_sec = 0;
  sleeper.tv_nsec = (long)(howLong * 1000);
  nanosleep(&sleeper, &dummy);
}


x86 assembly (clang, -O0):
<delayMicroseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayMicroseconds>:
sub    $0x28,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%edi,%eax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @delayMicroseconds(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %5
%6 = load i32, i32* %2
%7 = mul i32 %6, 1000
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @delayMicroseconds(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %6
%7 = mul i32 %0, 1000
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret void
}
void gtk_im_multicontext_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_multicontext_new() {
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;
typedef unsigned int ino_t;

/* Variables and functions */
uint32_t hash_inode(ino_t ino, unsigned int hashsize) {
  return ino & (hashsize - 1);
}


x86 assembly (clang, -O0):
<hash_inode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_inode>:
lea    -0x1(%rsi),%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hash_inode(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 = sub i32 %6, 1
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash_inode(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
int rand_2() {
  static unsigned int c_for_rand_2 = 0x1E459090;
  c_for_rand_2 = 214013 * c_for_rand_2 + 2531011;
  return (c_for_rand_2 >> 16) & 0x7FFF;
}


x86 assembly (clang, -O0):
<rand_2>:
push   %rbp
mov    %rsp,%rbp
imul   $0x343fd,0x2f12(%rip),%eax
add    $0x269ec3,%eax
mov    %eax,0x2f07(%rip)
mov    0x2f01(%rip),%eax
shr    $0x10,%eax
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_2>:
imul   $0x343fd,0x2f16(%rip),%eax
add    $0x269ec3,%eax
mov    %eax,0x2f0b(%rip)
shr    $0x10,%eax
and    $0x7fff,%eax
ret

LLVM IR (-O0):
@rand_2.c_for_rand_2 = internal global i32 507875472
define i32 @rand_2() {
%1 = load i32, i32* @rand_2.c_for_rand_2
%2 = mul i32 214013, %1
%3 = add i32 %2, 2531011
store i32 %3, i32* @rand_2.c_for_rand_2
%4 = load i32, i32* @rand_2.c_for_rand_2
%5 = lshr i32 %4, 16
%6 = and i32 %5, 32767
ret i32 %6
}

LLVM IR (-O2):
@rand_2.c_for_rand_2 = internal unnamed_addr global i32 507875472
define i32 @rand_2() {
%1 = load i32, i32* @rand_2.c_for_rand_2
%2 = mul i32 %1, 214013
%3 = add i32 %2, 2531011
store i32 %3, i32* @rand_2.c_for_rand_2
%4 = lshr i32 %3, 16
%5 = and i32 %4, 32767
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void printf(int fd, char *s, ...) { write(fd, s, strlen(s)); }


x86 assembly (clang, -O0):
<printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    %rdi,-0x18(%rbp)
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @printf(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @printf(i32 %0, i8* %1, ...) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void efree(void *c) {
  free(c);
  return;
}


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

LLVM IR (-O0):
define void @efree(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 @efree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void INT_Excep_SCI5_ERI5(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI5_ERI5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void het_import_usage(void) {
  printf("Usage: het_import cstext_file het_file\n");
}


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"Usage: het_import cstext_file het_file\00"
define void @het_import_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long atoi(char *);
int /*<<< orphan*/ redundant_call();
int main(int argc, char *argv[]) {
  long i, n;
  n = atoi(argv[1]);
  for (i = 0; i < n; i++)
    redundant_call();
  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    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1175 <main+0x55>
mov    $0x0,%al
call   1030 <redundant_call@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114f <main+0x2f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
test   %rax,%rax
jle    114d <main+0x2d>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <redundant_call@plt>
add    $0xffffffffffffffff,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
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 1
%10 = load i8*, i8** %9
%11 = call i64 @atoi(i8* %10)
store i64 %11, i64* %7
store i64 0, i64* %6
br label %12
12: ; preds = %18, %2
%13 = load i64, i64* %6
%14 = load i64, i64* %7
%15 = icmp slt i64 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = call i32 (...) @redundant_call()
br label %18
18: ; preds = %16
%19 = load i64, i64* %6
%20 = add nsw i64 %19, 1
store i64 %20, i64* %6
br label %12
21: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @atoi(i8* %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ 0, %2 ]
%9 = tail call i32 (...) @redundant_call()
%10 = add nuw nsw i64 %8, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret i32 0
}
void INT_Excep_DEU_DEU0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_DEU_DEU0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  i = 1;
  i = i + 1;
  assert(i != 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
int parse_is_percent(unsigned long long val) {
  return val <= -1ULL && val >= (-1ULL - 100ULL);
}


x86 assembly (clang, -O0):
<parse_is_percent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0xffffffffffffffff,-0x8(%rbp)
mov    %al,-0x9(%rbp)
ja     1123 <parse_is_percent+0x23>
cmpq   $0xffffffffffffff9b,-0x8(%rbp)
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_is_percent>:
xor    %eax,%eax
cmp    $0xffffffffffffff9b,%rdi
setae  %al
ret

LLVM IR (-O0):
define i32 @parse_is_percent(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp uge i64 %6, -101
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @parse_is_percent(i64 %0) {
%2 = icmp ugt i64 %0, -102
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo1(int);
int /*<<< orphan*/ foo2(int);
void t(int x, int y) {
  if (y < 5)
    foo1(120);
  else
    foo2(120);
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1147 <t+0x27>
mov    $0x78,%edi
call   1040 <foo1@plt>
jmp    1151 <t+0x31>
mov    $0x78,%edi
call   1030 <foo2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
mov    $0x78,%edi
cmp    $0x4,%esi
jg     112f <t+0xf>
jmp    1040 <foo1@plt>
jmp    1030 <foo2@plt>

LLVM IR (-O0):
define void @t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @foo1(i32 120)
br label %11
9: ; preds = %2
%10 = call i32 @foo2(i32 120)
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
define void @t(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 5
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @foo1(i32 120)
br label %8
6: ; preds = %2
%7 = tail call i32 @foo2(i32 120)
br label %8
8: ; preds = %6, %4
ret void
}
void makeTable() {}


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

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

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

LLVM IR (-O2):
define void @makeTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int i = 0;
  while (1) {
    i++;
    if (i == 3) {
      printf("I will raise SIGINT to myself...\n");
      raise(SIGINT);
    }
    printf("I am running now...\n");
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1173 <main+0x43>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebp
lea    0xed1(%rip),%r14
mov    0x2e9e(%rip),%r15
lea    0xeaf(%rip),%rbx
jmp    1172 <main+0x42>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
sub    $0x1,%ebp
jae    1160 <main+0x30>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    (%r15),%edi
call   1030 <raise@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [34 x i8] c"I will raise SIGINT to myself...\0A\00"
@SIGINT = global i32 0
@.str.1 = [21 x i8] c"I am running now...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %12
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @SIGINT
%11 = call i32 @raise(i32 %10)
br label %12
12: ; preds = %8, %3
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [20 x i8] c"I am running now...\00"
@str.2 = [33 x i8] c"I will raise SIGINT to myself...\00"
define i32 @main() {
br label %1
1: ; preds = %9, %0
%2 = phi i32 [ 0, %0 ], [ %3, %9 ]
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %3, 3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.2, i64 0, i64 0))
%7 = load i32, i32* @SIGINT
%8 = tail call i32 @raise(i32 %7)
br label %9
9: ; preds = %5, %1
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @sleep(i32 1)
br label %1
}
void user() {}


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

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

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

LLVM IR (-O2):
define void @user() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void vga_set_reset(int mask) {
  outb(0x00, 0x3ce);
  outb(mask, 0x3cf);
}


x86 assembly (clang, -O0):
<vga_set_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
mov    $0x3cf,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_set_reset>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    %ebx,%edi
mov    $0x3cf,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @vga_set_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @outb(i32 0, i32 974)
%4 = load i32, i32* %2
%5 = call i32 @outb(i32 %4, i32 975)
ret void
}

LLVM IR (-O2):
define void @vga_set_reset(i32 %0) {
%2 = tail call i32 @outb(i32 0, i32 974)
%3 = tail call i32 @outb(i32 %0, i32 975)
ret void
}
/* Variables and functions */
bool is_even(int number) {
  int remainder = number % 2;
  if (remainder == 0) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112b <is_even+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1132 <is_even+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_even>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
int size_of_2d_array(char **array) {
  int result;
  result = 0;
  while (array[result])
    result++;
  return (result);
}


x86 assembly (clang, -O0):
<size_of_2d_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <size_of_2d_array+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <size_of_2d_array+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_of_2d_array>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <size_of_2d_array+0x10>
ret

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

LLVM IR (-O2):
define i32 @size_of_2d_array(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}