xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_logtalk_comments() {
  test_parser_verify_parse(test_parser_sourcefile("logtalk", " %comment"),
                           "logtalk", "", "%comment", 0);
}


x86 assembly (clang, -O0):
<test_logtalk_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec0(%rip),%rdx
lea    0xebb(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_logtalk_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec9(%rip),%rdx
lea    0xec4(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"logtalk\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"%comment\00"
define void @test_logtalk_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"logtalk\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"%comment\00"
define void @test_logtalk_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *,
                           char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "%s%s\n\t%s%s\n", "usage: crunchgen [-foq] ",
          "[-h <makefile-header-name>] [-m <makefile>]",
          "[-p <obj-prefix>] [-c <c-file-name>] [-e <exec-file>] ",
          "<conffile>");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed1(%rip),%rdx
lea    0xee3(%rip),%rcx
lea    0xf08(%rip),%r8
lea    0xf38(%rip),%r9
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xed4(%rip),%rdx
lea    0xee6(%rip),%rcx
lea    0xf0b(%rip),%r8
lea    0xf3b(%rip),%r9
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"%s%s\0A\09%s%s\0A\00"
@.str.1 = [25 x i8] c"usage: crunchgen [-foq] \00"
@.str.2 = [44 x i8] c"[-h <makefile-header-name>] [-m <makefile>]\00"
@.str.3 = [55 x i8] c"[-p <obj-prefix>] [-c <c-file-name>] [-e <exec-file>] \00"
@.str.4 = [11 x i8] c"<conffile>\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"%s%s\0A\09%s%s\0A\00"
@.str.1 = [25 x i8] c"usage: crunchgen [-foq] \00"
@.str.2 = [44 x i8] c"[-h <makefile-header-name>] [-m <makefile>]\00"
@.str.3 = [55 x i8] c"[-p <obj-prefix>] [-c <c-file-name>] [-e <exec-file>] \00"
@.str.4 = [11 x i8] c"<conffile>\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
void set_bit(uint64_t *number, uint32_t bit_num) { *number |= 1 << bit_num; }


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @set_bit(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 = shl i32 1, %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = or i32 %8, %6
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @set_bit(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i32, i32* %0
%5 = or i32 %4, %3
store i32 %5, i32* %0
ret void
}
int test_imm_C2uint8_reg(unsigned char val) {
  return ((val) & (-0xC2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C2uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff3e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_C2uint8_reg(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, -194
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_C2uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 62
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *oss_mus_audio_system_name(int system) { return ("OSS"); }


x86 assembly (clang, -O0):
<oss_mus_audio_system_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"OSS\00"
define i8* @oss_mus_audio_system_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"OSS\00"
define i8* @oss_mus_audio_system_name(i32 %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
int fstat(int filedes, struct stat *buf) {
  long __res;
  __asm__ volatile("int $0x80"
                   : "=a"(__res)
                   : "0"(108), "b"((long)(filedes)), "c"((long)(buf)));
  do {
    if ((unsigned long)(__res) >= (unsigned long)(-125)) {
      __res = -1;
    }
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movslq -0xc(%rbp),%rbx
mov    -0x18(%rbp),%rcx
mov    $0x6c,%eax
int    $0x80
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffff83,-0x20(%rbp)
jb     1132 <fstat+0x32>
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
mov    -0x20(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
push   %rbx
mov    %rsi,%rcx
movslq %edi,%rbx
mov    $0x6c,%eax
int    $0x80
cmp    $0xffffffffffffff83,%rax
mov    $0xffffffff,%ecx
cmovae %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
%5 = alloca i64
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load %struct.stat*, %struct.stat** %4
%9 = ptrtoint %struct.stat* %8 to i64
%10 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 108, i64 %7, i64 %9)
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
%13 = icmp uge i64 %12, -125
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 -1, i64* %5
br label %15
15: ; preds = %14, %11
%16 = load i64, i64* %5
%17 = trunc i64 %16 to i32
br label %18
18: ; preds = %15
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = sext i32 %0 to i64
%4 = ptrtoint %struct.stat* %1 to i64
%5 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 108, i64 %3, i64 %4)
%6 = icmp ugt i64 %5, -126
%7 = trunc i64 %5 to i32
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int read_int(char *, char const *);
int read_backlight(const char *driver) {
  return read_int("actual_brightness", driver);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"actual_brightness\00"
define i32 @read_backlight(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @read_int(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"actual_brightness\00"
define i32 @read_backlight(i8* %0) {
%2 = tail call i32 @read_int(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void fn_test2(int *pa[2]) {
  int i;
  for (i = 0; i < 2; i++)
    printf("%d(%p), ", *pa[i], pa[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<fn_test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1163 <fn_test2+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <fn_test2+0x13>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_test2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdx
mov    (%rdx),%esi
lea    0xecd(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rdx
mov    (%rdx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d(%p), \00"
define void @fn_test2(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i32* %2)
%5 = getelementptr inbounds i32*, i32** %0, i64 1
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32* %6)
%9 = tail call i32 @putchar(i32 10)
ret void
}
int isalpha_lead(char c) {
  if ((unsigned int)c > 127)
    return 1;
  if ('a' <= c && c <= 'z')
    return 1;
  if ('A' <= c && c <= 'Z')
    return 1;
  if ('_' == c)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isalpha_lead>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7f,%eax
jbe    1123 <isalpha_lead+0x23>
movl   $0x1,-0x4(%rbp)
jmp    119b <isalpha_lead+0x9b>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     114d <isalpha_lead+0x4d>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     114d <isalpha_lead+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    119b <isalpha_lead+0x9b>
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1177 <isalpha_lead+0x77>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1177 <isalpha_lead+0x77>
movl   $0x1,-0x4(%rbp)
jmp    119b <isalpha_lead+0x9b>
movsbl -0x5(%rbp),%ecx
mov    $0x5f,%eax
cmp    %ecx,%eax
jne    1194 <isalpha_lead+0x94>
movl   $0x1,-0x4(%rbp)
jmp    119b <isalpha_lead+0x9b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha_lead>:
test   %dil,%dil
sets   %al
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x1a,%cl
setb   %cl
cmp    $0x5f,%dil
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @isalpha_lead(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ugt i32 %5, 127
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %32
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 97, %10
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 122
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %2
br label %32
17: ; preds = %12, %8
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sle i32 65, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 1, i32* %2
br label %32
26: ; preds = %21, %17
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = icmp eq i32 95, %28
br i1 %29, label %30, label %31
30: ; preds = %26
store i32 1, i32* %2
br label %32
31: ; preds = %26
store i32 0, i32* %2
br label %32
32: ; preds = %31, %30, %25, %16, %7
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @isalpha_lead(i8 signext %0) {
%2 = icmp slt i8 %0, 0
%3 = and i8 %0, -33
%4 = add i8 %3, -65
%5 = icmp ult i8 %4, 26
%6 = or i1 %2, %5
%7 = icmp eq i8 %0, 95
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ScuSendSoundRequest();
void scu_interrupt_handler(void) { ScuSendSoundRequest(); }


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

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

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

LLVM IR (-O2):
define void @scu_interrupt_handler() {
%1 = tail call i32 (...) @ScuSendSoundRequest()
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ read(int, void *, size_t);
ssize_t read_nointr(int fd, void *buf, size_t count) {
  ssize_t ret;
  do {
    ret = read(fd, buf, count);
  } while (ret < 0 && errno == EINTR);
  return ret;
}


x86 assembly (clang, -O0):
<read_nointr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jge    1161 <read_nointr+0x51>
mov    0x2e92(%rip),%rax
mov    (%rax),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1123 <read_nointr+0x13>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_nointr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read@plt>
test   %rax,%rax
jns    114b <read_nointr+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <read_nointr+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i64 @read_nointr(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i64 @read(i32 %9, i8* %10, i64 %11)
store i64 %12, i64* %7
br label %13
13: ; preds = %8
%14 = load i64, i64* %7
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i64, i64* %7
ret i64 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i64 @read_nointr(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%6 = icmp slt i64 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ printf(char *);
void umain() {
  char *args[] = {"/bin/login", 0};
  execv(args[0], args);
  printf("exec failed\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<umain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <execv@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <umain+0x37>

x86 assembly (clang, -O2):
<umain>:
sub    $0x18,%rsp
movaps 0x2ce5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeca(%rip),%rdi
mov    %rsp,%rsi
call   1040 <execv@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
nopw   0x0(%rax,%rax,1)
jmp    1150 <umain+0x30>

LLVM IR (-O0):
@.str = [11 x i8] c"/bin/login\00"
@__const.umain.args = [2 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [13 x i8] c"exec failed\0A\00"
define void @umain() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = load i8*, i8** %3
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%6 = call i32 @execv(i8* %4, i8** %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %8, %0
br label %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"/bin/login\00"
@__const.umain.args = [2 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* null]
@str = [12 x i8] c"exec failed\00"
define void @umain() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %6, %0
br label %6
}
/* Type definitions */
struct VectorNumBase {
  int dummy;
};
struct Simhasher {
  int dummy;
};

/* Variables and functions */
struct VectorNumBase *GetSimhasherVectorNum(struct Simhasher *, char const *,
                                            size_t);
struct VectorNumBase *sim_vector_num_result(struct Simhasher *handle,
                                            const char *code, size_t topn) {
  return GetSimhasherVectorNum(handle, code, topn);
}


x86 assembly (clang, -O0):
<sim_vector_num_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <GetSimhasherVectorNum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_vector_num_result>:
jmp    1030 <GetSimhasherVectorNum@plt>

LLVM IR (-O0):
%struct.VectorNumBase = type { i32 }
%struct.Simhasher = type { i32 }
define %struct.VectorNumBase* @sim_vector_num_result(%struct.Simhasher* %0, i8* %1, i64 %2) {
%4 = alloca %struct.Simhasher*
%5 = alloca i8*
%6 = alloca i64
store %struct.Simhasher* %0, %struct.Simhasher** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.Simhasher*, %struct.Simhasher** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call %struct.VectorNumBase* @GetSimhasherVectorNum(%struct.Simhasher* %7, i8* %8, i64 %9)
ret %struct.VectorNumBase* %10
}

LLVM IR (-O2):
%struct.VectorNumBase = type { i32 }
%struct.Simhasher = type { i32 }
define %struct.VectorNumBase* @sim_vector_num_result(%struct.Simhasher* %0, i8* %1, i64 %2) {
%4 = tail call %struct.VectorNumBase* @GetSimhasherVectorNum(%struct.Simhasher* %0, i8* %1, i64 %2)
ret %struct.VectorNumBase* %4
}
void mdp4_overlay0_done_lcdc(int cndx) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_overlay0_done_lcdc(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] g1 g2\n", name);
  fprintf(stderr, "       %s -m r:m\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


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>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xee1(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xee1(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s [options] g1 g2\0A\00"
@.str.1 = [18 x i8] c" %s -m r:m\0A\00"
@.str.2 = [36 x i8] c"For more information type: %s -h \0A\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 ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s [options] g1 g2\0A\00"
@.str.1 = [18 x i8] c" %s -m r:m\0A\00"
@.str.2 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
void dummy_elapsed_time_in_seconds() {}


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

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

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

LLVM IR (-O2):
define void @dummy_elapsed_time_in_seconds() {
ret void
}
/* Variables and functions */
size_t my_strlen(const char *str) {
  size_t size = 0;
  while (str[size] != '\0') {
    size++;
  }
  return size;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <my_strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void UARTGuardTimeSet(unsigned long ulBase, unsigned long ulGuardTime) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000018))) &= ~0x0000FF00;
  (*((volatile unsigned long *)(ulBase + 0x00000018))) |=
      (ulGuardTime << 8) & 0x0000FF00;
}


x86 assembly (clang, -O0):
<UARTGuardTimeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rcx
and    $0xffffffffffff00ff,%rcx
mov    %rcx,0x18(%rax)
mov    -0x10(%rbp),%rdx
shl    $0x8,%rdx
and    $0xff00,%rdx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTGuardTimeSet>:
andq   $0xffffffffffff00ff,0x18(%rdi)
ff
shl    $0x8,%esi
movzwl %si,%eax
or     %rax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @UARTGuardTimeSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 24
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -65281
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = shl i64 %10, 8
%12 = and i64 %11, 65280
%13 = load i64, i64* %3
%14 = add i64 %13, 24
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = or i64 %16, %12
store volatile i64 %17, i64* %15
ret void
}

LLVM IR (-O2):
define void @UARTGuardTimeSet(i64 %0, i64 %1) {
%3 = add i64 %0, 24
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -65281
store volatile i64 %6, i64* %4
%7 = shl i64 %1, 8
%8 = and i64 %7, 65280
%9 = load volatile i64, i64* %4
%10 = or i64 %9, %8
store volatile i64 %10, i64* %4
ret void
}
/* Variables and functions */
bool is_digit(const char ch) { return ch >= '0' && ch <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
size_t read_FD_BE(int, int /*<<< orphan*/ *, int);
size_t int16ReadFromFD(int fd, int16_t *data) {
  return read_FD_BE(fd, data, sizeof(uint16_t));
}


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

x86 assembly (clang, -O2):
<int16ReadFromFD>:
mov    $0x4,%edx
jmp    1030 <read_FD_BE@plt>

LLVM IR (-O0):
define i64 @int16ReadFromFD(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 = call i64 @read_FD_BE(i32 %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @int16ReadFromFD(i32 %0, i32* %1) {
%3 = tail call i64 @read_FD_BE(i32 %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void null_size(void) {
  fputs("Null size allocation requested!\n", stderr);
  abort();
}


x86 assembly (clang, -O0):
<null_size>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<null_size>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Null size allocation requested!\0A\00"
@stderr = global i32 0
define void @null_size() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Null size allocation requested!\0A\00"
@stderr = global i32 0
define void @null_size() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
char *module_name(void) { return "cd"; }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"cd\00"
define i8* @module_name() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
void unregister_wlags_sysfs(struct net_device *net) {}


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

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

LLVM IR (-O0):
%struct.net_device = type opaque
define void @unregister_wlags_sysfs(%struct.net_device* %0) {
%2 = alloca %struct.net_device*
store %struct.net_device* %0, %struct.net_device** %2
ret void
}

LLVM IR (-O2):
%struct.net_device = type opaque
define void @unregister_wlags_sysfs(%struct.net_device* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t write_FP(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int);
size_t int8WriteToFP(FILE *fp, const int8_t *data) {
  return write_FP(fp, data, sizeof(int8_t));
}


x86 assembly (clang, -O0):
<int8WriteToFP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write_FP@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int8WriteToFP>:
mov    $0x4,%edx
jmp    1030 <write_FP@plt>

LLVM IR (-O0):
define i64 @int8WriteToFP(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 = call i64 @write_FP(i32* %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @int8WriteToFP(i32* %0, i32* %1) {
%3 = tail call i64 @write_FP(i32* %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
bool read_challenge(char *buff) {
  if (fgets(buff, 512, stdin) == NULL) {
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<read_challenge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    1149 <read_challenge+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1150 <read_challenge+0x40>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_challenge>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1030 <fgets@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @read_challenge(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @stdin
%6 = call i32* @fgets(i8* %4, i32 512, i32 %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @read_challenge(i8* %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32* @fgets(i8* %0, i32 512, i32 %2)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
void TIM2_OC1_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM2_OC1_IRQHandler() {
ret void
}
/* Variables and functions */
int rand();
int gen_dest(int source_pos) {
  int num;
  do {
    num = rand() % 12;
  } while (num == source_pos);
  return num;
}


x86 assembly (clang, -O0):
<gen_dest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     111b <gen_dest+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_dest>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x21,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cmp    %ebx,%eax
je     1120 <gen_dest+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @gen_dest(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 12
%5 = icmp eq i32 %4, %0
br i1 %5, label %2, label %6
6: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mostrad(int *, int, int);
void mostra(int *seq, int tam) { mostrad(seq, -1, tam); }


x86 assembly (clang, -O0):
<mostra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0xffffffff,%esi
call   1030 <mostrad@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostra>:
mov    %esi,%edx
mov    $0xffffffff,%esi
jmp    1030 <mostrad@plt>

LLVM IR (-O0):
define void @mostra(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 = call i32 @mostrad(i32* %5, i32 -1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @mostra(i32* %0, i32 %1) {
%3 = tail call i32 @mostrad(i32* %0, i32 -1, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *, char const *,
                           char *, char const *);
void Utils_format(char *result, const char *type, const char *user,
                  const char *data) {
  sprintf(result, "%s%s%s%s%s", type, "~!~", user, "~!~", data);
}


x86 assembly (clang, -O0):
<Utils_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%rax
lea    0xec1(%rip),%rsi
lea    0xec5(%rip),%r9
mov    %r9,%rcx
mov    %rax,(%rsp)
call   1030 <sprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Utils_format>:
push   %rax
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %rcx,(%rsp)
lea    0xede(%rip),%rsi
lea    0xee2(%rip),%rcx
mov    %rcx,%r9
call   1030 <sprintf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%s%s%s%s%s\00"
@.str.1 = [4 x i8] c"~!~\00"
define void @Utils_format(i8* nocapture writeonly %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int russianPleasant(int, int);
int main() {
  printf("%u \n", russianPleasant(654, 3213));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28e,%edi
mov    $0xc8d,%esi
call   1040 <russianPleasant@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%u \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @russianPleasant(i32 654, i32 3213)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%u \0A\00"
define i32 @main() {
%1 = tail call i32 @russianPleasant(i32 654, i32 3213)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t get_mxcsr() {
  uint32_t result = 0;
  __asm__ __volatile__("stmxcsr %0" : : "m"(result));
  return result;
}


x86 assembly (clang, -O0):
<get_mxcsr>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
stmxcsr -0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mxcsr>:
movq   $0x0,-0x8(%rsp)
stmxcsr -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @get_mxcsr() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define i8* @get_mxcsr() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  scalar_t__ tv_nsec;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_THREAD_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t now_ns(void) {
  struct timespec ts;
  clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
  return ts.tv_sec * 1000000000LL + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<now_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now_ns>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_THREAD_CPUTIME_ID = global i32 0
define i64 @now_ns() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_THREAD_CPUTIME_ID
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_THREAD_CPUTIME_ID = global i32 0
define i64 @now_ns() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_THREAD_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul nsw i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void emit_usage(void) { errx(EX_USAGE, "[-s] [git-shell -c]"); }


x86 assembly (clang, -O0):
<emit_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_usage>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@EX_USAGE = global i32 0
@.str = [20 x i8] c"[-s] [git-shell -c]\00"
define void @emit_usage() {
%1 = load i32, i32* @EX_USAGE
%2 = call i32 @errx(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@EX_USAGE = global i32 0
@.str = [20 x i8] c"[-s] [git-shell -c]\00"
define void @emit_usage() {
%1 = load i32, i32* @EX_USAGE
%2 = tail call i32 @errx(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
void gtk_vruler_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_vruler_new() {
ret void
}
void atomic_inc(unsigned int *addr) {
  __asm__("lock incl %0" : : "m"(*addr) : "memory");
}


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

x86 assembly (clang, -O2):
<atomic_inc>:
lock incl (%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_inc(i32* %0) {
tail call void asm sideeffect "lock incl $0", "*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0)
ret void
}
int fnmatch(pattern, string, flags) const char *pattern;
const char *string;
int flags;
{ return internal_fnmatch(pattern, string, flags & (1 << 2), flags); }


x86 assembly (clang, -O0):
<fnmatch>:
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
and    $0x4,%edx
mov    -0x14(%rbp),%ecx
mov    $0x0,%al
call   1030 <internal_fnmatch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnmatch>:
mov    %edx,%ecx
and    $0x4,%edx
xor    %eax,%eax
jmp    1030 <internal_fnmatch@plt>

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

LLVM IR (-O2):
define i32 @fnmatch(i8* %0, i8* %1, i32 %2) {
%4 = and i32 %2, 4
%5 = tail call i32 (i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @internal_fnmatch to i32 (i8*, i8*, i32, i32, ...)*)(i8* %0, i8* %1, i32 %4, i32 %2)
ret i32 %5
}