xunge/DecIR huggingface dataset:
/* Variables and functions */
bool is_operand_valid(char c) {
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') ||
         (c >= 'A' && c <= 'Z');
}


x86 assembly (clang, -O0):
<is_operand_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <is_operand_valid+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_operand_valid+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_operand_valid+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_operand_valid+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <is_operand_valid+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_operand_valid>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x1a,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_operand_valid(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 i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 90
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_operand_valid(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
unsigned xrop3_45_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_45_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_45_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    -0x100(%rdi),%edx
xor    %ecx,%edx
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_45_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_45_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %3, -256
%8 = xor i32 %6, %7
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int int8_to_int(int8_t n) { return (int)n; }


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

x86 assembly (clang, -O2):
<int8_to_int>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @int8_to_int(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @int8_to_int(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t read32(uint32_t nAddress) { return *((uint32_t *)nAddress); }


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

x86 assembly (clang, -O2):
<read32>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @read32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @read32(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint8_t *setfield16(uint8_t *field, uint16_t val) {
  memcpy(field, &val, sizeof(uint16_t));
  return field + sizeof(uint16_t);
}


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

x86 assembly (clang, -O2):
<setfield16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32* @setfield16(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 = call i32 @memcpy(i32* %5, i32* %4, i32 4)
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 4
ret i32* %8
}

LLVM IR (-O2):
define i32* @setfield16(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
%5 = getelementptr inbounds i32, i32* %0, i64 4
ret i32* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int FileProxy_WriteFile(char *filename, char *buf, int size) {
  FILE *ifp;
  if ((ifp = fopen(filename, "w")) == NULL) {
    return (1);
  }
  fprintf(ifp, "%s", buf);
  fclose(ifp);
  return (0);
}


x86 assembly (clang, -O0):
<FileProxy_WriteFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    116d <FileProxy_WriteFile+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1191 <FileProxy_WriteFile+0x61>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe86(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileProxy_WriteFile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1162 <FileProxy_WriteFile+0x32>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    1167 <FileProxy_WriteFile+0x37>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @FileProxy_WriteFile(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @fputs(i8* %1, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *prog) {
  printf("Usage:\n");
  printf("%s xmlfile\n", prog);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [12 x i8] c"%s xmlfile\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"%s xmlfile\0A\00"
@str = [7 x i8] c"Usage:\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, int, int /*<<< orphan*/ *);
size_t f_read(FILE *f, void *buf, size_t size) {
  return fread(buf, size, 1, f);
}


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

x86 assembly (clang, -O2):
<f_read>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x1,%edx
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @f_read(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fread(i8* %1, i64 %2, i32 1, i32* %0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void version(char *progname) {
  printf("%s version %s\n"
         "%s\n",
         progname, "0.3", "This program is in the public domain.");
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"%s version %s\0A%s\0A\00"
@.str.1 = [4 x i8] c"0.3\00"
@.str.2 = [38 x i8] c"This program is in the public domain.\00"
define void @version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s version %s\0A%s\0A\00"
@.str.1 = [4 x i8] c"0.3\00"
@.str.2 = [38 x i8] c"This program is in the public domain.\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret void
}
const char *yaml_get_version_string(void) { return "0.1.4"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"0.1.4\00"
define i8* @yaml_get_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int debug(char *msg) {}


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

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

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

LLVM IR (-O2):
define i32 @debug(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ change_srv_plist_serial();
int /*<<< orphan*/ clear_playlist();
scalar_t__ options_get_int(char *);
int /*<<< orphan*/ send_int_to_srv(int);
void cmd_clear_playlist() {
  if (options_get_int("SyncPlaylist")) {
    send_int_to_srv(0x29);
    send_int_to_srv(0x26);
    change_srv_plist_serial();
    send_int_to_srv(0x2a);
  } else
    clear_playlist();
}


x86 assembly (clang, -O0):
<cmd_clear_playlist>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <options_get_int@plt>
cmp    $0x0,%rax
je     1184 <cmd_clear_playlist+0x44>
mov    $0x29,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x26,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x0,%al
call   1050 <change_srv_plist_serial@plt>
mov    $0x2a,%edi
call   1030 <send_int_to_srv@plt>
jmp    118b <cmd_clear_playlist+0x4b>
mov    $0x0,%al
call   1060 <clear_playlist@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_clear_playlist>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <options_get_int@plt>
test   %rax,%rax
je     1178 <cmd_clear_playlist+0x38>
mov    $0x29,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x26,%edi
call   1030 <send_int_to_srv@plt>
xor    %eax,%eax
call   1050 <change_srv_plist_serial@plt>
mov    $0x2a,%edi
pop    %rax
jmp    1030 <send_int_to_srv@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <clear_playlist@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"SyncPlaylist\00"
define void @cmd_clear_playlist() {
%1 = call i64 @options_get_int(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = call i32 @send_int_to_srv(i32 41)
%5 = call i32 @send_int_to_srv(i32 38)
%6 = call i32 (...) @change_srv_plist_serial()
%7 = call i32 @send_int_to_srv(i32 42)
br label %10
8: ; preds = %0
%9 = call i32 (...) @clear_playlist()
br label %10
10: ; preds = %8, %3
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"SyncPlaylist\00"
define void @cmd_clear_playlist() {
%1 = tail call i64 @options_get_int(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @send_int_to_srv(i32 41)
%5 = tail call i32 @send_int_to_srv(i32 38)
%6 = tail call i32 (...) @change_srv_plist_serial()
%7 = tail call i32 @send_int_to_srv(i32 42)
br label %10
8: ; preds = %0
%9 = tail call i32 (...) @clear_playlist()
br label %10
10: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int soma(int, int *);
int main() {
  int vetor[5] = {1, 2, 3, 4, 5};
  printf("Soma:%d\n", soma(5, vetor));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x5,%edi
call   1040 <soma@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
call   1040 <soma@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.vetor = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [9 x i8] c"Soma:%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @soma(i32 5, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_or_insert(int);
void *process2(void *arg) {
  int val = 20;
  int found = find_or_insert(val);
  assert(found);
  return NULL;
}


x86 assembly (clang, -O0):
<process2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <find_or_insert@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @process2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 20, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @find_or_insert(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @assert(i32 %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @process2(i8* nocapture readnone %0) {
%2 = tail call i32 @find_or_insert(i32 20)
%3 = tail call i32 @assert(i32 %2)
ret i8* null
}
void _UShortTo2Bytes(const unsigned short shortValue, unsigned char *_2bytes) {
  unsigned short temp = shortValue;
  unsigned long loop = 0;
  for (loop = 0; loop < 2; loop++) {
    _2bytes[loop] = (unsigned char)(temp % 0x100);
    temp /= 0x100;
  }
}


x86 assembly (clang, -O0):
<_UShortTo2Bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x12(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x2,-0x20(%rbp)
jae    116a <_UShortTo2Bytes+0x6a>
movzwl -0x12(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movzwl -0x12(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %ax,-0x12(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1127 <_UShortTo2Bytes+0x27>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_UShortTo2Bytes>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @_UShortTo2Bytes(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i64
store i16 %0, i16* %3
store i8* %1, i8** %4
%7 = load i16, i16* %3
store i16 %7, i16* %5
store i64 0, i64* %6
store i64 0, i64* %6
br label %8
8: ; preds = %23, %2
%9 = load i64, i64* %6
%10 = icmp ult i64 %9, 2
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = srem i32 %13, 256
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = load i64, i64* %6
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 %15, i8* %18
%19 = load i16, i16* %5
%20 = zext i16 %19 to i32
%21 = sdiv i32 %20, 256
%22 = trunc i32 %21 to i16
store i16 %22, i16* %5
br label %23
23: ; preds = %11
%24 = load i64, i64* %6
%25 = add i64 %24, 1
store i64 %25, i64* %6
br label %8
26: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @_UShortTo2Bytes(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = trunc i16 %0 to i8
store i8 %3, i8* %1
%4 = lshr i16 %0, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void lib1_function(void) {
  fprintf(stdout, "Hello from lib1.c\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<lib1_function>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib1_function>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [19 x i8] c"Hello from lib1.c\0A\00"
define void @lib1_function() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [19 x i8] c"Hello from lib1.c\0A\00"
define void @lib1_function() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_array(int *ar, int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d\n", *(ar + i));
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print_array+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_array+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int fun1371() { return 1371; }


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

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

LLVM IR (-O0):
define i32 @fun1371() {
ret i32 1371
}

LLVM IR (-O2):
define i32 @fun1371() {
ret i32 1371
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printUsage() {
  puts("Usage: huffman inputFile      [outputFile.huff]");
  puts("       huffman inputFile.huff [outputFile]");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Usage: huffman inputFile [outputFile.huff]\00"
@.str.1 = [43 x i8] c" huffman inputFile.huff [outputFile]\00"
define void @printUsage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Usage: huffman inputFile [outputFile.huff]\00"
@.str.1 = [43 x i8] c" huffman inputFile.huff [outputFile]\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *, int);
void main() {
  foo();
  static int wxyz = 12345;
  if (1) {
    static int wxyz = 54321;
    printf("%d\n", wxyz);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <foo@plt>
mov    0x2f03(%rip),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
lea    0xed1(%rip),%rdi
mov    $0xd431,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@main.wxyz = internal global i32 12345
@main.wxyz.1 = internal global i32 54321
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = call i32 (...) @foo()
%2 = load i32, i32* @main.wxyz.1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 54321)
ret void
}
int cond_stmt() {}


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

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

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

LLVM IR (-O2):
define i32 @cond_stmt() {
ret i32 undef
}
int test() {}


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

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

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

LLVM IR (-O2):
define i32 @test() {
ret i32 undef
}
void libretro_dummy_retro_cheat_reset() {}


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

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

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

LLVM IR (-O2):
define void @libretro_dummy_retro_cheat_reset() {
ret void
}
int ret0(int a0, int a1, int a2, int a3, int a4, int a5) { return a0; }


x86 assembly (clang, -O0):
<ret0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ret0(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
define i32 @ret0(i32 returned %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct carousel {
  int dummy;
};

/* Variables and functions */
void add_dsmcc_pid(struct carousel *car, uint16_t pid) { ; }


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

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

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

LLVM IR (-O2):
%struct.carousel = type { i32 }
define void @add_dsmcc_pid(%struct.carousel* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
uint8_t aes_div2(uint8_t a) { return (a >> 1u) ^ ((-(a & 1u)) & 141u); }


x86 assembly (clang, -O0):
<aes_div2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
and    $0x8d,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_div2>:
mov    %edi,%eax
shr    %eax
and    $0x1,%edi
neg    %edi
and    $0x8d,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @aes_div2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, 1
%7 = sub i32 0, %6
%8 = and i32 %7, 141
%9 = xor i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @aes_div2(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %0, 1
%4 = sub nsw i32 0, %3
%5 = and i32 %4, 141
%6 = xor i32 %5, %2
ret i32 %6
}
char ais2ascii(char value) {
  value = value & 0x3F;
  if (value < 0x20)
    return value + 0x40;
  else
    return value;
}


x86 assembly (clang, -O0):
<ais2ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
and    $0x3f,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jge    1130 <ais2ascii+0x30>
movsbl -0x2(%rbp),%eax
add    $0x40,%eax
mov    %al,-0x1(%rbp)
jmp    1136 <ais2ascii+0x36>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ais2ascii>:
and    $0x3f,%dil
lea    0x40(%rdi),%eax
cmp    $0x20,%dil
movzbl %dil,%ecx
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @ais2ascii(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 63
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 32
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 64
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @ais2ascii(i8 signext %0) {
%2 = and i8 %0, 63
%3 = icmp ult i8 %2, 32
%4 = or i8 %2, 64
%5 = select i1 %3, i8 %4, i8 %2
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int sock;
  sock = socket(AF_INET6, SOCK_STREAM, 0);
  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    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @AF_INET6
%8 = load i32, i32* @SOCK_STREAM
%9 = call i32 @socket(i32 %7, i32 %8, i32 0)
store i32 %9, i32* %6
ret i32 0
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @AF_INET6
%4 = load i32, i32* @SOCK_STREAM
%5 = tail call i32 @socket(i32 %3, i32 %4, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ end();
void endonion(void) { end(); }


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

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

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

LLVM IR (-O2):
define void @endonion() {
%1 = tail call i32 (...) @end()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int main() {
  do {
    f();
  } while (0);
  g();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main+0x9>
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1040 <g@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
br label %1
1: ; preds = %0
%2 = call i32 (...) @f()
br label %3
3: ; preds = %1
%4 = call i32 (...) @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
ret i32 0
}
unsigned long GET_GPFSEL_ADDR(int pin) {
  int reg_num = 0;
  reg_num = pin / 10;
  switch (reg_num) {
  case 0:
    return 0x20200000;
    break;
  case 1:
    return 0x20200004UL;
    break;
  case 2:
    return 0x20200008UL;
    break;
  case 3:
    return 0x2020000cUL;
    break;
  case 4:
    return 0x20200010UL;
    break;
  case 5:
    return 0x20200014UL;
    break;
  default:
    return 0;
    break;
  }
}


x86 assembly (clang, -O0):
<GET_GPFSEL_ADDR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0xc(%rbp),%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x5,%rax
ja     119c <GET_GPFSEL_ADDR+0x9c>
mov    -0x18(%rbp),%rax
lea    0xebb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movq   $0x20200000,-0x8(%rbp)
20
jmp    11a4 <GET_GPFSEL_ADDR+0xa4>
movq   $0x20200004,-0x8(%rbp)
20
jmp    11a4 <GET_GPFSEL_ADDR+0xa4>
movq   $0x20200008,-0x8(%rbp)
20
jmp    11a4 <GET_GPFSEL_ADDR+0xa4>
movq   $0x2020000c,-0x8(%rbp)
20
jmp    11a4 <GET_GPFSEL_ADDR+0xa4>
movq   $0x20200010,-0x8(%rbp)
20
jmp    11a4 <GET_GPFSEL_ADDR+0xa4>
movq   $0x20200014,-0x8(%rbp)
20
jmp    11a4 <GET_GPFSEL_ADDR+0xa4>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_GPFSEL_ADDR>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x22,%rcx
add    %eax,%ecx
xor    %eax,%eax
cmp    $0x6,%ecx
lea    0x20200000(,%rcx,4),%rcx
20
cmovb  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @GET_GPFSEL_ADDR(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 10
store i32 %6, i32* %4
%7 = load i32, i32* %4
switch i32 %7, label %14 [
i32 0, label %8
i32 1, label %9
i32 2, label %10
i32 3, label %11
i32 4, label %12
i32 5, label %13
]
8: ; preds = %1
store i64 538968064, i64* %2
br label %15
9: ; preds = %1
store i64 538968068, i64* %2
br label %15
10: ; preds = %1
store i64 538968072, i64* %2
br label %15
11: ; preds = %1
store i64 538968076, i64* %2
br label %15
12: ; preds = %1
store i64 538968080, i64* %2
br label %15
13: ; preds = %1
store i64 538968084, i64* %2
br label %15
14: ; preds = %1
store i64 0, i64* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
define i64 @GET_GPFSEL_ADDR(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = icmp ult i32 %2, 6
%4 = zext i32 %2 to i64
%5 = shl nuw nsw i64 %4, 2
%6 = add nuw nsw i64 %5, 538968064
%7 = select i1 %3, i64 %6, i64 0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void my_puts(char *str) {
  while (*str)
    putchar(*str++);
}


x86 assembly (clang, -O0):
<my_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <my_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <my_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <my_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <my_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @my_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int main() {
  test_INT();
  test_UINT();
  asm volatile(".byte 0xd6" : : "a"(0));
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_INT()
%2 = tail call i32 (...) @test_UINT()
tail call void asm sideeffect ".byte 0xd6", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ playAGame(int **);
int /*<<< orphan*/ shuffle(int **);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  srand(time(0));
  int deck[4][13] = {{0}};
  shuffle(deck);
  playAGame(deck);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0xd0,%edx
call   1050 <memset@plt>
lea    -0xe0(%rbp),%rdi
call   1040 <shuffle@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <playAGame@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <shuffle@plt>
mov    %rbx,%rdi
call   1030 <playAGame@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [13 x i32]]
store i32 0, i32* %1
%3 = call i32 @time(i32 0)
%4 = call i32 @srand(i32 %3)
%5 = bitcast [4 x [13 x i32]]* %2 to i8*
%6 = getelementptr inbounds [4 x [13 x i32]], [4 x [13 x i32]]* %2, i64 0, i64 0
%7 = bitcast [13 x i32]* %6 to i32**
%8 = call i32 @shuffle(i32** %7)
%9 = getelementptr inbounds [4 x [13 x i32]], [4 x [13 x i32]]* %2, i64 0, i64 0
%10 = bitcast [13 x i32]* %9 to i32**
%11 = call i32 @playAGame(i32** %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x [13 x i32]]
%2 = tail call i32 @time(i32 0)
%3 = tail call i32 @srand(i32 %2)
%4 = bitcast [4 x [13 x i32]]* %1 to i8*
%5 = bitcast [4 x [13 x i32]]* %1 to i32**
%6 = call i32 @shuffle(i32** %5)
%7 = call i32 @playAGame(i32** %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vp8_variance(unsigned char *, int, unsigned char *, int, int,
                                int, unsigned int *, int *);
unsigned int vp8_variance8x16_c(unsigned char *src_ptr, int source_stride,
                                unsigned char *ref_ptr, int recon_stride,
                                unsigned int *sse) {
  unsigned int var;
  int avg;
  vp8_variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 16, &var,
               &avg);
  *sse = var;
  return (var - ((avg * avg) >> 7));
}


x86 assembly (clang, -O0):
<vp8_variance8x16_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x8,%r8d
mov    $0x10,%r9d
lea    -0x2c(%rbp),%r10
lea    -0x30(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <vp8_variance@plt>
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
imul   -0x30(%rbp),%ecx
sar    $0x7,%ecx
sub    %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_variance8x16_c>:
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
lea    0x8(%rsp),%rax
lea    0xc(%rsp),%r10
mov    $0x8,%r8d
mov    $0x10,%r9d
push   %rax
push   %r10
call   1030 <vp8_variance@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
mov    0x8(%rsp),%ecx
imul   %ecx,%ecx
shr    $0x7,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @vp8_variance8x16_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = call i32 @vp8_variance(i8* %13, i32 %14, i8* %15, i32 %16, i32 8, i32 16, i32* %11, i32* %12)
%18 = load i32, i32* %11
%19 = load i32*, i32** %10
store i32 %18, i32* %19
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %12
%23 = mul nsw i32 %21, %22
%24 = ashr i32 %23, 7
%25 = sub i32 %20, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @vp8_variance8x16_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* nocapture writeonly %4) {
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %6 to i8*
%9 = bitcast i32* %7 to i8*
%10 = call i32 @vp8_variance(i8* %0, i32 %1, i8* %2, i32 %3, i32 8, i32 16, i32* %6, i32* %7)
%11 = load i32, i32* %6
store i32 %11, i32* %4
%12 = load i32, i32* %7
%13 = mul nsw i32 %12, %12
%14 = lshr i32 %13, 7
%15 = sub i32 %11, %14
ret i32 %15
}
void ff_hevc_put_hevc_epel_h6_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h6_8_sse4() {
ret void
}
long f(int i) { return i ?: (long)2; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1124 <f+0x24>
mov    -0x8(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
jmp    1132 <f+0x32>
mov    $0x2,%eax
mov    %rax,-0x10(%rbp)
jmp    1132 <f+0x32>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
mov    $0x2,%eax
cmovne %edi,%eax
cltq
ret

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

LLVM IR (-O2):
define i64 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 2, i32 %0
%4 = sext i32 %3 to i64
ret i64 %4
}